Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== mapping keys ====== ===== points of interest ===== * for help see ':help mapping' in vim * typical syntax:<code> :mappingcommand [special arguments] {lhs} {rhs} example: " this sets F3 to toggle line wrapping :map <F3> :set wrap!<CR> </code> * [type]noremap is often used to redefine a command to avoid nested and recursive mappings * there are five sets of mappings:<code> :map (Normal, Visual+Select, Operator-Pending) :nmap (Normal, when vim is waiting for any key to be a command) :vmap (Visual, when a visual selection has begun) :omap (Operator-pending mode, after "d", "y", "c", etc...) :imap (Insert mode, when you are typing characters) :cmap (Command-line mode, when entering a ":" or "/" command) </code> * to remove a key mapping:<code> unmap nunmap vunmap ounmap iunmap cunmap </code> * on the Mac, the command key is mapped as <D- > * to view a list of current mappings:<code> :map </code> * to view a list of current mappings and the last place each item was set from:<code> :set verbose=1 :map </code> * on the Mac the pasteboard (clipboard) is at register "* ===== troubleshooting ===== * if you are using gvim in windows, and you lose your ability to cut/copy/paste with Control-X,C, and V, you probably had the carriage returns removed from your vimrc file * rename your .vimrc file temporarily * start up gvim and type :mkvimrc ~/.vimrc-default * compare the listings in this file with your vimrc file and fix as necessary docs/vim/mapping_keys.txt Last modified: 2009/07/01 00:13by billh