vim

vim's netrw plugin show error message:"The system cannot find the file specified." when change remote directory via FTP

remote ftp server is microsoft ftp. so, i suspect that this is a bug. can anyone knows what happend? ...

How can I make NERDTree to open on the same drive that the file that I'm editing?

NERDTree shows in viewport disk c: regardless from which disk do I open the file. When I use gvim in windows I open files using: gvim.exe --remote-tab-silent [FILE] I'm loading NERDTree with this line in _vimrc: au VimEnter * NERDTree Can NERDTree automaticaly change drive to correct drive somehow? ...

How to jump to next word in vim when pascal case is used?

I would like to move carret to Bar in FooBarFizzBuzz in vim. How to do that? How to make w 'pascal case aware'? Is there any other stroke already for this? ...

How can I save each match in a different file with Vim

Hi. I would like to save the output of g/pattern1/,/pattern2/ to a file (for each match, a different file). e.g. def ....... end def ....... end you would end up with a file for each "def...end". Tried using tempname() like so: g/pattern1/,/pattern2/exe 'w ' . tempname() but this fails with no range allowed for exe also tried g/...

Vim folding on syntax for R

I'm working with vim on my linux machine and need code folding to work for R. I have the Vim-R-plusing2 installed to enable passing code from vim into an R session, but the folding does not work when foldmethod=syntax. How do I get folding for R working? ...

What are ways to reduce mode errors while learning vim?

I frequently make mode errors while using vim, i.e. I'll start typing text while in Normal mode, or start typing commands while in Insert mode. I understand this goes away with time as vim's quirks seep into your bones, but are there any ways to speed the process? ...

Jump to function definition in vim, without using plugins or ctags

is it possible to jump to function definitions in vim without using plugins or ctags? and if so, how? a related question: http://stackoverflow.com/questions/635770/jump-to-function-definition-in-vim ...

vim run perl script with word under cursor as argument

is it possible to send the word under the cursor to a perl script by typing a shortcut? how do i do that? ...

How to make Vim's file browser open a file in a new buffer?

Sometimes I start Vim by pointing it at a directory, but I'm not certain yet which file I'll need to change, so I end up looking through several files. Is there a way to make the file browser open a selected file into a new buffer so that the file browser is still available without having to reopen it with :e path/to/directory ? ...

How do I prevent vim from expanding ~ during completion?

I'm on my macbook using vim, and let's say for simplicity's sake that I have ~/some_file.py, ~/some_other_file.py, and ~/user.py open. On the mac, ~ expands to /Users/<username>. So if I type in :b user and then hit tab to expand, it goes through each of the files instead of going straight to ~/user.py. Is there any way to prevent thi...

Command to SVN commit current file or directory or higher in the directory hierarchy

I have this shortcut in my vimrc: map cmt :!start TortoiseProc.exe /command:commit /path:"%" /closeonend:3 <CR> What this does is whenever I press 'cmt', vim will open the commit dialog for the file I'm currently editing with vim. What I'd like to do is write this command in such a way that if I put a number in front of it, it will o...

how do I cancel visual mode programmatically in vim

I'm running a bit of code in Vim and having a problem (I think) with not being in the correct mode. I'm trying to get the text between either '< >' or '[ ]' into a register. At point code starts below I know the cursor is between a pair of brackets, but I don't know what kind the brackets are: " put text in x reg if I'm in <> brac...

VIM search and replace - replace string that is found on particular lines only

So I have a bunch of lines like this - $ns duplex-link n1 n2 10mb 10ms DropTail $ns duplex-link-op n1 n2 10mb 10ms queuePos 0.5 $ns duplex-link n2 n3 10mb 10ms DropTail $ns duplex-link-op n2 n3 10mb 10ms queuePos 0.5 $ns duplex-link n3 n4 10mb 10ms DropTail $ns duplex-link-op n3 n4 10mb 10ms queuePos 0.5 Now here's the problem. I wan...

How to move to non-hidden buffer that exists in some window on some tab?

I work in Vim with lots of open buffers in various windows on various tabs. I know it's simple to just load one of the existing buffers into my current window. However, some of my buffers for large files use folding expressions that cause delay of several seconds when loading them into new window. On the other hand, if they are alread...

vim opens my folds on paste. how to prevent that ?

There's something weird going on in my fortran folding. This is the example file module foo contains subroutine hello() end subroutine hello subroutine hello() end subroutine subroutine hello() end subroutine end module foo subroutine hello() end subroutine subroutine hello() end subroutine subroutine hello() end subroutine an...

Use a register value as search pattern

I wish to use the content of a register as search pattern in Vim. I would like to do this from the command line so I cannot use the <c-r> syntax since that assumes an interactive session. It is possible to use a register as a replace pattern, like this :%s/foo/\=@a/g However using this syntax as a search pattern does not work :%s/...

Sending email from VIM

I'm planning to send emails from inside of VIM via SendEmail, but I have run into some problems. When piping part of the buffer (or the whole buffer) into SendEmail via the bang (!) operator, the text in my buffer gets replaced with SendEmail's output. So my first question is: how do I pipe a range into an external command and discard ...

vim rails javascript_tag highlighting

The problem: <% javascript_tag do %> // some js <% end %> When I use this method the javascript-syntax is not triggered inside the block. When I use the <script> tag it works. Is there a way to trigger the javascript syntax for the rails block in vim? Thanks. ...

vim multiline f

Hi, Anyone knows how to quickly find the next occurrence of a character (like the f command) but multi-line? I.e. to quickly jump to the next occurrence of some character in a file? Thanks! Yaniv ...

Why it's needed to "source" some Vim plugins?

From autotag.vim: install details Simply source the file autoTag.vim from your .vimrc file. This utility will (obviously) only work when using vim that's been compiled with python support. Is this needed because this is a Python plugin in vim, instead of a vimscript? Aren't plugins in .vim/plugin loaded automatically?...