tags:

views:

87

answers:

4

Is there a way of saving the output of the command

:map

to a file?

In a related question, I have the following map in my vimrc file:

map <f1> :wa<cr>

when I load a latex file (I have the vim-latex plugin installed), the F1 key now invokes help. Is there a way of changing this without manually having to type the map again?

Thanks

+1  A: 

Maybe you can resource the .vimrc file again. Something like:

map <f2> :source /path/to/.vimrc
Yada
+2  A: 

If your problem is that <F1> gets remapped, you can use :verbose map <F1> to see where it is defined, and change it accordingly.

kemp
+1  A: 

I don't know a way to save the individual :map, but :mksession filename will save a file with the current state of the editor in it, which will include all the map definitions.

Dave Kirby
+2  A: 

q1. Redirecting

:redir >> ~/mymaps.txt
:map
:redir END

q2.

As kemp says you can find it using verbose and modify the plugin file

or you can create a vim file in your plugins directory that runs last eg ~/.vim/plugin/zzzmyremaps.vim (check by running scriptnames)

Edit: rampion is correct in the comments, as this is a filtype issue this should be handled in the after directory ~/.vim/after/plugin/latex.vim as the offending latex.vim file is not being loaded on startup but on a buffer enter.

Note .vimrc gets sourced first so plugins have a habit of overwriting them :scriptnames will show the order.

michael
The standard way of ensuring that your that your settings are read last is to use your `after` directory: `~/.vim/after/plugin/latex.vim` ~ that will be read after the standard vim-latex plugin, and you can fix anything that they do that you don't like.
rampion