vim

Vim: Find text in a specific column

When searching for text in Vim (specifically gVim, but it shouldn't matter), how do you specify what column to search? I'm looking for values in one column only. ...

How to select column in editors(Notepad++ , kate , vim , Netbeans , Eclips ,other editor)

How to select column in editors(Notepad++, Kate, vim, Netbeans, Eclipse, ...) ? for delete or insert or replace some characters. ...

How do I turn on search highlighting from a vim script?

If I do either of the following two: call search("searchString") exec "/ searchString" From a script, then vim does the search but does not highlight the results, even though hlsearch. Doing the same searches from outside a script highlights the results. Thanks ...

Vim: keyword coloring

Lately I came up here with a similar question. I want to color special words in all files independet from the active syntax-file. It works with words like DONE and ADD. I tried to achieve the same with [+] or [x] and [-] but it doesn't work. [+] and so on them not to be interpreted as keyword. Fooling around with iskeyword+=[+] and escap...

Vim: delete empty lines within a visual selected area

In ex-mode I can use :g/^$/d for the whole file. How to do it for a visual selected part of the file? ...

How do I substitute from a list of strings in VIM?

Hi, I am a vim user, and I want to be able to loop over a range of substrings when I am substituting. How can I use some vim magic to go from a set of lines like this: Afoo Bfoo Cfoo Dfoo to Abar Bbar Cbaz Dbaz ??? I want to search my file from the start for the next occurance of foo, and replace the first two instances with bar...

What is difference between "function" and "function!" in VIM?

I beheld quite a few usage of "function!" in others vimrc files, but there is no easy-to-find documentation of "function!". What's the difference between "function" and "function!"? ...

I am looking for tips for learning Vim or Emacs the smart way...

I am a quite happy user of Eclipse (I mostly develop in PHP and Python), however I found the answers to "What specific productivity gains does Vim/Emacs provide over GUI text editors?" interesting enough to make me wish to try out Vim or Emacs as well and see if they would turn out to be a better solution for me. I have the general feel...

Vim folding for php.

Vim privedes nice syntax folding for ruby and c(well, that is what I've tried) out of the box, but what about php? It doesnt have this feature! Am I missing something? ...

syntax highlighting in a VIM fold header

Is there any way to have VIM continue to apply formatting to the line used as the header for a fold? E.g., I have the following code: int foo(int a, int b) { int c; .... } When folded, I see: +-- 4 lines: int foo(int a, int b) {---------------------------- However, the whole line is highlighted as per the "Folded" class. Is th...

Why <C-PageUp> and <C-PageDown> not work in vim?

I have vim 7.2 installed in my windows. In gvim, the and works for navigation among tabs by default. However, it doesn't work for vim. Even I have below lines in _vimrc added. It still not work. map <C-PageUp> :tabp<CR> map <C-PageDown> :tabn<CR> But, map and works. map <C-left> :tabp<CR> map <C-right> :tabn<CR> Anybody has cl...

How to let omnicppcomplete automatically close empty argument lists?

Is it possible to let Vim's omnicppcomplete automatically close argument lists for functions or methods that do not take any arguments? For example, assuming v is an STL vector, when auto completing v.clear(), we end up with: v.clear( It would be nice if the closing parenthesis would be automatically added. Is this possible? ...

Vim syntax files ... trying to undestand "contains"

I'm trying to patch up a new vim syntax file for some custom format I'm using. Most of it I can understand, but the keyword "contains" is giving me trouble. Is there anyone here who could give me an explanation of what it does (I've read the help -> didn't quite get it) in a way as if he were explaining it to a tree. ...

How to send status to the VIM status line after calling custom VIM (Python) function

I've just created my first VIM script, I wrote it in Python. It's a simple script to switch color schemes from a directory (/vim/etc/colors). I would like to know how to send a notification after the color scheme changed with the name of the selected color scheme to the vim 'statusline'. rson gave an answer to my question, here is an up...

ctags problem when generating tags for .h and .c file in two different directory

Now I have two directory, all of header files *.h are included in directory /inc, while all of c file *.c are stored in /src directory. The directory just like this, (/project is a up level directory): /project-- |----/inc |----/src I want to use ctrl+] to locate definition of one parameter or one function in a source file...

vim command line completion when opening files

How to make VIM to always auto-complete filenames in command mode? It works fine when I type for example ":cd /ww[Tab]", but if I want to open a file and type ":o /ww[Tab]", it inserts "^I" character instead of completing. ...

find regex pattern in Vim

some text i dont care about, some_text_I_want, <bunch of spaces> some_text_I_want, I want my pattern to match second line, not first line. Basically wherever some_text_I_want, is not preceeded with a , ...

VIM Modality interface implementation

I've been searching on google and here on SO for any hints or tips and tricks on implementing the vim like modality interface (the command and insert modes) and possible [demo] commands or keystrokes. Are there any libraries out there for this? ...

how to remove file name from VIM dictionary menu?

Hi, I've installed pydiction dictionary in vim so that I'd be able to get a list of python commands when I press tab after partially typed command. Everything is working fine, except every time the menu shows up, there is a file name besides the each command in the list. How do I remove that filename from the menu? plz, take a look at t...

Finding definitions/references to C++ class members in Vim

I'm using Vim for a C++ project that I've started working on and I've been spending a lot of time lately browsing through the existing code to get a hang of it. To make the browsing easier, I've setup ctags and cscope in Vim to jump to definitions and find references. However, I find that neither of them are intelligent enough to know w...