[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

mapping in vi



 hi all,
    I found this very useful thing from some book.
    map #2 ^[:w^[^M
 ^[ is got by pressing <ctrl>v and escape(the escape
 character)
 ^M is equivalent to the enter key.
  This mapping can be added in your .exrc or .vimrc file.
 Now pressing F2 saves your file.
 This will be very useful if you want to save,compile and
 run
 different programs using a single keystroke.
 eg: 
   map #9 ^[:w^[:!cc %^[:!./a.out^[
pressing F9 will compile and run your c program.
can use in the same way for java,perl,programs.
vinu