Copying from vim search term

In command mode (where you are when you hit : in normal mode), you can do ctrl-R /, which will expand to your last search term (other ctrl-R favorites are ” for your yank buffer, or % for the full path of the current window) You actually don’t need to do that though. If you … Read more

Vim: How to keep folds on save?

This behavior is normal. Vim’s default is not to remember which code you had folded vs. unfolded from one session to the next. You can save your current folds; when you finish editing a file, before exiting vim, enter the command :mkview. When you next open the file, if you enter :loadview, it will restore … Read more

vimdiff and MacVim

From the terminal If you have the mvim script installed (it is in the dmg, just put it somewhere in your PATH), you can just type in a shell: mvim -d file1 file2 You can alias this to mvimdiff if you like. From within macvim In macvim, like in vim , you can also use: … Read more

Vim “yank” does not seem to work

If you have the setting set clipboard=unnamedplus in your .vimrc then this will not be working. For OSX you have to use set clipboard=unnamed For Linux you will probably need to use set clipboard=unnamedplus Heres the snippet from my personal .vimrc if system(‘uname -s’) == “Darwin\n” set clipboard=unnamed “OSX else set clipboard=unnamedplus “Linux endif