Why is my vim mapping not working?

I made a guide here to create vim mappings. Put the .vimrcfollowing into the file :

let mapleader=','
if exists(":Tabularize")
  nmap <Leader>a= :Tabularize /=<CR>
  vmap <Leader>a= :Tabularize /=<CR>
  nmap <Leader>a: :Tabularize /:\zs<CR>
  vmap <Leader>a: :Tabularize /:\zs<CR>
endif

The page says when I type ,a=, it should tell Tabularize to align my lines. But instead, it inserts the character =where the cursor is.

I have Tabularize installed, and the command :Tabularizeworks when I call it without displaying.

What am I doing wrong?

+5
source share
2 answers

Your file is .vimrcread and executed before loading the plugins, therefore it is :Tabularizenot defined.

, :

:scriptnames

:

:help startup
+12

, ,. \.

vimrc :

let mapleader=","

, , , reset -. , , let mapleader .

0

All Articles