Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

Simple tip how to use VIM NMAP command.

  1. This example shows a simple NMAP. The NMAP statement is written in the ~/.gvimrc file.

  2. In this case I find ;, go back one word, put the word under cursor in the search string, switch to file in buffer two, find the string and open the file, using gf command.

  3. The code is shown below:

    "1) debug file 2)e_list.txt 3)specman top import files
    nmap gimp /;h*:b2ngf

  4. To quickly find pattern. I declared the following shortcuts:

    nmap <silent> f1 /Error .*exp<Esc>
    nmap <silent> f2 /debug inspect required<Esc>

  5. An nmap statement can execute multiple VIM commands as in the following example. In this example, I created a new VIM command, called ind. It invokes a PERL script, that does indentation. without the "head" and "tail" commands, the cursor would end up, after script inovkation, at the botton of the file. So I first create a mark A and later jump back to it.
    This is shown below:

    nmap ind ma<CR>:%!perl ~/bin/vim_ind.pl<CR>'a<CR>

Contact me now at:

  ...




Search This Site


Feedback This Site




new pages on this site