vim

How to turn-off a plugin in Vim temporarily?

I have multiple plugins in Vim and some of them modify the default behavior of Vim. For example I use Vimacs plugin, which makes Vim behave like emacs in the insert mode alone. Sometime I want to turn off the Vimacs plugin without moving the vimacs.vim out of the plugins directory. Is there a way to do it? ...

Remotely Programming

I'm doing my development work on my Windows machine, but my compiling on a remote Linux machine. What I currently do is start an X server on Windows, ssh into the Linux machine, then do the development remotely. What I'd like to do is edit my source on the Windows machine, and have it automatically copy files over to the Linux system w...

Tips for using vim over a slow connection?

I'm using vim over a slow connection and it is a little painful. Is there anything I can do in vim to alleviate the pain? ...

problem with xdebug vim plugin

Hi, I am using xdebug plugin for vim. After making few changes i was able to run debugger but not able to set breakpoints. So, I enabled xdebug.remote_log and below is the log statements corresponding to setting breakpoint. <- breakpoint_set -i 5 -t line -f file:///C:\htdocs\testLocal.php -n 36 -> Its issuing request to debugger in...

copying text from vim to windows

I am trying to copy a selection of text from vim to another windows application...say firefox or notepad for example. However I cant seem to do this with the 'y' command. I have windows hotkeys enabled so by pressing ctrl-c i can achieve this but was hoping to get rid entirely of these windows commands in vim. Is this possible? also w...

Why does Vim save files with a ~ extension?

I've found that while using Vim on Windows Vim saves the file, a .ext.swp file that's deleted on closing the Vim window and a .ext~ file. I assume the .ext.swp file is a session backup in case Vim crashes. What's the purpose of the .ext~ file however? Is this a permanent backup file? It's annoying as I'd like to copy all the files I'm ...

[Python] Is there anything that cannot appear inside parentheses?

I was intrigued by this answer to my question about getting vim to highlight unmatched brackets in python code. Specifically, I'm talking about the second part of his answer where he mentions that the C syntax highlighting is actually flagging as an error any instance of curly braces inside parens. It is an unobtrusive cue that you hav...

Effective use of gvim over a network

I currently use vim in a telnet window for editing code (very old school!). There is a lot of source code (mainly C), so I use tags, cscope etc. to get around. This is ok as far as it goes, but network latency can make every keystroke "laggy", which is not so good! I'd like to use gvim on my Windows PC (or any editor that can be set up ...

vim copy and replace text

Lets say that i have this text: $test = 'lorem'; $test2= 'ipsum'; and I want to copy lorem and paste into ipsum. I tried to do yi' on lorem and then went on ipsum and did ci' but that replaced my pastebin with ipsum. and my previous copy was lost. ...

Backup-restore the current repeat action (.) in VIM

I'd like to save the current single-repeat action (this is what happens when you press .), then run a macro, and then restore the . action (because macros usually change it). Is this possible? Alternatively, is it possible to write a macro without changing the current . action? I guess I could try to do everything in Command Mode, but...

How do I fix incorrect inline Javascript indentation in Vim?

I can't seem to get inline Javascript indenting properly in Vim. Consider the following: $(document).ready(function() { // Closing brace correctly indented $("input").focus(function() { $(this).closest("li").addClass("cur-focus"); }); // <-- I had to manually unindent this // Closing brace incorrectly indented ...

how to move a block or column of text

I have the following text as a simple case: ... abc xxx 123 456 wer xxx 345 678676 ... what I need to move a block of text xxx to another location: ... abc 123 xxx 456 wer 345 xxx 678676 ... I think I use visual mode to block a column of text, what are the other commands to move the block to another location? ...

Copy matching text to register

Hi, does anyone know if it is possible to concatenate matches resulting from a search into a single register? E.g, I have a file with following contents: aaa :xxx 123 bb :y 8 ccccc :zzzzz 1923 Now what I want is to copy column starting with ':' somewhere else. Unfortunatelly I can't use visual block mode, because the first column hasn...

C++ vim IDE. Things you'd need from it.

Hi guys. I was going to create the C++ IDE Vim extendable plugin. It is not a problem to make one which will satisfy my own needs. This plugin was going to work with workspaces, projects and its dependencies. This is for unix like system with gcc as c++ compiler. So my question is what is the most important things you'd need from an ID...

vim pastebin workflow

Hello i have recently started using vim editor ( actually the plugin for netbeans ) and i am having trouble with the pastebin. What would happen is i would yunk something in, and then do some deletes with dd and so i lose my initial yunk content. So for me as a beginner with vim its very confusing that delete actually does cut. How do...

Vim split line command

Duplicate: http://stackoverflow.com/questions/237383/how-do-i-insert-a-linebreak-where-the-cursor-is-without-entering-into-insert-mode In vim, "J" joins the next line to the current line. Is there a similar one-key (or relatively short) command to split a line at a given cursor position? I know it be done with a simple macro, but it s...

vim enter a new line with tabspaces

Lets say that i have this block of text public function __construct() { parent::__construct(); } and i want to insert a new line above parrent::construct at the same level. Like: public function __construct() { // this is the new line. parent::__construct(); } how can i do this. I try'ed to do CTRL+Enter in command mod...

Vim: Use an expression as a filename

I'm doing some debugging, which involves checking logfiles name "blah N.log" where N is an integer. Periodically, a new log file gets added, and I'd like to just skip to the next log file, rather than explicitly do :e blah\ N.log. I can't just do % vim *.log and then :n, b/c not all the log files exist yet. I've got an expression that...

VI Regular Expressions - Replacing using current line number

I'm not sure it's possible or not, but one of the things I find I need to do often is to replace the contents of the file, but I want to use the current line number as a replacement option. So if I had a file like: This is text to replace XX This is text to replace XX This is text to replace XX I would want to be able to run a rege...

Can you make vi "advance" the screen when opened?

I often work in vi, suspend vi, run something on the cli, and then fg back into vi to work on the results. For instance, fixing errors that showed up when I ran the cli command. However, when I fg vi, vi "wipes" the current terminal buffer and I can't see the "last screenful" of terminal output in the scrollback buffer. Is there some s...