vim

vim: Executing a list of editor commands

Hi, Is there a way in vim to give a list of editor commands? I want to execute a series of 'global' commands, and there is some pattern to the commands. So I would ideally like to generate the list of commands (using regex search & substitute), and then run them, instead of having to type in each command. Thanks! Gaurav ...

How to jump to the next tag in vim help file

I want to learn vim documentation given in standard help file. But I stuck on navigating issue - I just cannot go to the next tag without positioning cursor manually. I think you would agree that it is more productive to: go to the next tag with some keystroke press Ctrl-] to read corresponding topic press Ctrl-o to return continue rea...

Vim Ruby hash indentation

I am using Vim for Ruby development and I have some annoying problem. When I type Ruby hashes, I see the wrong indentation: { { #Here it is. } } How it is possible to resolve this? I am using akitaonrails vimfiles. ...

make gvim treat wrapped line as new line...

When I press "j" or arrow down in vim/gvim the cursor moves to the next line. which is good for writing code. When writing text however the lines are usually much longer then the text with. Therefore I can not easily get the word just above THIS word. So in almost all editors and text processors pressing the up arrow HERE ↑ would put th...

How to replace char in file with appropriate ascii code in vim...

In a vim buffer if I have a list of characters say: A B c C d D and for each one I want to replace it with its corresponding ascii code ( in decimal ). Is there a way to do this without using an external tool through :r!some_tool For instance, I know there is the :ascii and ga commands but they print the value to the screen but ...

How can I map a click in Vim?

I want to be able to click (or cmd+click on my Mac) on a function name in Gvim (or vim with set mouse=a) and have it run the command :tag to follow a ctag, but I don't know how to include a mouse click in a Vim mapping. ...

Validating HTML from the command line

I'm a web developer who is increasingly using Vim to code web sites. Are there any HTML validation utilities (or techniques) out there that will take whatever file I'm working on and validate against its DOCTYPE without leaving the shell? T ...

How to create an autocomplete list in ViM?

As I am typing code, I would like to get the symbol before and after a specific character (e.g. '.' in C#) and pass that to my own program which would then in return give a list of possible completions. For example if user is typing: m_Filename.M I would want to call out into my own DLL/EXE passing "m_Filename" and "M" and my program...

Favorite minimalistic .vimrc configuration

There are .vimrc related questions found here and here. This question wants to deal with a minimalistic .vimrc file. If you are on a new machine with no .vimrc file what are some 'must turn on' commands you use before doing any typing? ...

Change vim's current directory upon starting from command line

Vim (actually, gvim is in question, but I believe it works both ways) upon starting has its current directory in its runtime directory. I would like to upon starting, to have its cd in let's say, c:\pro I know I can just do :cd c:\pro, but is there a way to change it upon starting it, with something alike gvim c:\pro (only that doesn't ...

How to use lowercase marks as global in vim?

How can one use the lowercase marks as global buffers too? The marks are a-z, so there's really no need for me to have the lowercase ones reserved for buffer-only marks, since I don't have more than a few marks / buffer. So I will almost always want to have global marks, but ma is so much easier to type than mA, same goes for 'a vs 'A....

vim: open file from selected text

for example, if I have something like this: #include "filename.h" when I select filename.h I want to use it as the input for opening the file named filename.h in a split. thanks in advance for any help. ...

Vim: good way to setup makeprg=xcodebuild ?

What is the best way to set makeprg=xcodebuild in vim? I'm using filetype line in files to indicate that the file is objective-c (as opposed to matlab or cpp) by setting up the first line of my file to: /* vim: set filetype=objc : */ and having this in vimrc: set modelines=1 I would probably want to use :mak to run this command in...

How to "search file and send result into vim" in one command?

I used: find ~/web_project -name "config_*.php" -print | xargs vim In vim, anything is ok. But, if exit vim, terminal is freeze. My env: osx 10.6, macvim ...

Mapping a sequence of keystrokes to command-line commands

Hey, Is there a way to map a sequence of keystrokes to a command-line commmand (a command entered after : in the Ex mode) in vim? Thanks Sid ...

How to make color settings look the same in vim as in gvim

When I put the following in .vimrc colorscheme blue It gives me a nice blue colorscheme in gvim. However, when I use vim, it is light blue instead. Is there a setting I can change so that gvim and vim look the same? If not, then is there a way I can set it up so that my gvim settings do not interfere with my vim settings? ...

Make { and } ignore lines containing only whitespace

When you navigate by paragraph in vim using { and } it skips lines that contain nothing but whitespace though they are otherwise 'blank'. How can I convince vim to treat "whitespace only" lines as paragraph breaks so { and } will jump to them? ...

How to open file in existing Vim instance instead of getting "existing swapfile " warning

I want Vim to reuse the currently existing instance if it exists. Usually, Vim pops up a warning about an existing swap file. Specifically, this is for switching between Vim and Visual Studio. (I know about ViEmu, but it doesn't work with Visual Studio Express.) ...

How to make vimgrep do word match search?

I have below statement in _vimrc file to map F3 to do vimgrep for word under current cursor. map <F3> :execute "noautocmd vimgrep /" . expand("<cword>") . "/gj **/*." . expand("%:e") <Bar> cw<CR> Now, I want to make it vimgrep for exact word match for word under current cursor. I changed it as below but it doesn't work. map <leader>...

vim formating command

Today unintentionally I typed something when the cursor was on very long line and this formatted my line, by braking it several lines of limited length. This line looks something like: Foo("This is very long line (left '%s' right '%s) and it will never never never end", pNode->left.c_str(), pNode->right.c_str()); before formatting an...