vim

How to efficiently "make" with Vim

Hi, what I am triing to do seems a very basic stuff, but I can't find anything about it. I am working on a project built as usual: project |-- bin |-- inc `-- src I would like to make my project using the make command included in Vim. But each time I have to specify :make -C ../. I would prefer, if there is not Makefile file in the c...

copyright character in vim

I used to get this copyright symbol in vim earlier through some keys' combination. Can someone help me with it now? I simply fail to recollect it. Also, if possible, share some more of such characters... someone might need it sometime. ...

Vim duplicate selection

If i have something selected in VIM in visual mode .... how can i duplicate that selection and place it below or above the selection. ...

VIM: Bijection between VIM Taglist elements and code snippets?

My Taglist in a C code: macro || MIN_LEN || MAX_ITERATIONS ||- typedef || cell || source_cell ||- variable || len_given Taglist elements (domain): A = {MIN_LEN, MAX_ITERATIONS, cell, source_cell, len_given} Code snippets (codomain): B = {"code_MIN_LEN", "code_MAX_ITERATIONS", ..., "code_len_...

Creating a ctrl+tab keybinding in PuTTY

I'd like to be able to map the vim commands :tabnext and :tabprev to CTRL+TAB and CTRL+SHIFT+TAB respectively. Unfortunately, I seem to be running into the problem where PuTTY eats these character combinations. I've tried searching for information, but to no avail. I'm pretty sure this is a PuTTY thing but there doesn't seem to be any ...

vim mapping question. How can I make a map to :r! <script> execute right away?

I have a python script called showdate.py which I want to map to I do this by: map <F2> :r! showdate.py in my _gvimrc file. The problem is that I have to press enter when I press F2 to execute instead of executing immediately. Any ideas? Thanks! ...

How can I repeatedly match from A until B in VIM?

I need to get all text between <Annotation> and </Annotation>, where a word MATCH occurs. How can I do it in VIM? <Annotation about="MATCH UNTIL </Annotation> " timestamp="0x000463e92263dd4a" href=" 5raS5maS90ZWh0YXZha29rb2VsbWEvbGFza2FyaS8QyrqPk5L9mAI"> <La...

C function seemingly not defined anywhere!

I'm looking at the vim source code, specifically the file normal.c, and I see this function nv_operator being used, but it's not defined anywhere (I grepped the entire src directory) It's only declared as: static void nv_operator __ARGS((cmdarg_T *cap)); I've looked up the definition of __ARGS but it's just ... nothing (pretty much) ...

class & function names highlighting in Vim

I just recently set up my Vim environment from Textmate, after becoming addicted to its modal input. However, syntax highlighting seems to be not so beautiful in Vim. I code in C++ and since the function call and class names can't be highlighted, the code is more difficult to read. I played with color scheme for a bit, but couldn't fin...

displaying functions in c using vi

Is there a way to display all functions in a C source file using vim. This feature is available with the brief editor. And this would help me a lot. Note: This is not a programming question. ...

How can I recursively use the Global in VIM?

Is something wrong in ":g-2-g/3/" or is the recursion in the global just missing? I can not understand a reason for the error: E147: Cannot do :global recursive How can I get a recursive global search in VIM? [Neil's initial Suggestion with the operator \| ] g/1.*2\|2.*1/ A disadvantage is that the combinations expand with n nu...

Vim: how to use variables in vimrc?

Hello, here what I am trying to do, a simple function to increment a global variable. It works fine. let g:high_ind = 1 fun! IncHighlightInd() let g:high_ind = (g:high_ind + 1) %10 return g:high_ind endf I want to use this variable in a map map <C-h> :call IncHighlightInd() <CR> :Highlight g:high_ind <CR> But g:high_ind is no...

How to map Meta key to control key in vim?

Hey, How do I map my Windows key (which is defined as the Meta_L key in Ubuntu) so that it also works as the Control_L key in Vim? When I have my laptop docked, the Windows key is closer to my pinky, so I'd like the option to use that as the control key as well. ...

VIM Compilation in windows

I am interested in compiling windows for Python25 support but when I make -f Make_ming.mak gvim.exe I get the following (_MAX_PATH undeclared) : gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32 -DFE...

Set a hidden buffer as 'nobuflisted'

How may I set a hidden buffer as 'nolisted' from a vim script? I tried: call setbufvar(2, 'buflisted', 1) ...

Why is \%(\) faster than \(\) in Vim?

I am confused by the docs: \%(\) A pattern enclosed by escaped parentheses. */\%(\)* */\%(* *E53* Just like \(\), but without counting it as a sub-expression. This allows using more groups and it's a little bit faster. Can someone explain the reason for the difference? Is it because of backtracking or something else? ...

Get name of the file we're editing in vim

Hi. I'm trying to find the name of the file I'm editing inside of vim. So I can use it to map F5 to compile this file, for testing purposes. Would of course be great if I could recognize the file format, and choose compiler accordingly, but realy not necessary. If I find the name of the file, I could do that myself. But I really can't f...

show function parameters in vim

is there a way in vim to get a popup window with function parameters? (like in visual studio / slick edit) e.g. when i type "function_name(" vim will open a popup window (like when doing ctrl-n in new versions) and show me the function parameters and which one of them i'm currently typing. p.s. i'm looking for something a bit more co...

Move entire line up and down in Vim

In Notepad++, I can use ctrl + shift + up/down to move the current line up and down. Is there a similar command to this in Vim? I have looked through endless guides, but have found nothing. If there isn't, how could I bind the action to that key combination? Edit: Mykola's answer works for all lines, apart from those at the beginning ...

How do you search through vim's command history?

I would like to have the following search in Vim too (reverse-i-search)`': Enter a word of your previous command, and you get the full command. I know the chronological history tool in Vim q: However, it is not that useful as the reverse search. How can you have a similar reverse search in Vim as in terminal? ...