Tip #469: The use of %< instead of %
tip karma |
Rating 0/9, Viewed by 2178
|
created: |
|
May 2, 2003 5:22 |
|
complexity: |
|
basic |
author: |
|
Vincent NAUDOT |
|
as of Vim: |
|
5.7 |
This tips is for vim or gvim user. We know the following map
map! /' ^[:w^M:! latex %^Mi
is doing the following. By typing "/'" in insert mode, this
will save the current tex file, and compile it.
The reader understand that one can change "/'" by anything he want,
as long as it does not bug its own configuration, I like this map 'cause
on an english keyboard both / and ' are close to eachother.
We may wonder
what to do if we wish to open the associated dvi file?!
Indeed one has to replace % by %<.dvi and then we get
map! <F4> ^[:! xdvi %<.dvi ^Mi
or
map! <F4> ^[:! kdvi %<.dvi ^M
if you are using K environement.
The same thing apply indeed for any other extension i.e.,
the map
map! <F5> ^[:! gv %<.ps ^Mi
will open the associated ps file with gv.
<<display date-and-time on status line |
Map to quickly swap/exchange arbitrary text >>
Additional Notes
|