hello, i am a good user of VIM, but not very advanced. I use macros a lot. a 
frequent one that i use is to comment code in verilog, C, perl etc. now, i go 
back and forth frequenty between various code, and code comment macro (@c) and 
uncomment macro (@u) have to be different for perl and C, e.g. Now, what I do 
is that everytime I come to C code, i have to redefine the macro (pressing 
qc0i//<esc>jq) and next time i go to perl code, i have to do it again 
(qc0i#<esc>jq) .
i was wondering if i can put these keystrokes in a file (e.g. C_comment.macro 
and perl_comment.macro), and can source the file in VIM whenevr i want to. that 
way, i can put frequently used macros keystrokes in files, and read those 
commands at run time in VIM. any idea how to write that *.macro file (with 
these keystrokes)? I tried but <esc> does not work. (i put following thing in 
file: qc0i//<esc>jq. now when i source it, it keep inserting <esc> etc too, 
which is bugging me).
summary: what I want to do is that in VIM window, instead of pressing 
keystrokes on keyboard, VIM reads the keystrokes (as exactly if it were from 
keyboard, including insert mode) from a file...
  thanks for support..
 
--------------- http://onthethirdside.blogspot.com ----------------


Reply via email to