Skip to content

Instantly share code, notes, and snippets.

@jashmenn
Created April 16, 2009 22:22
Show Gist options
  • Select an option

  • Save jashmenn/96721 to your computer and use it in GitHub Desktop.

Select an option

Save jashmenn/96721 to your computer and use it in GitHub Desktop.
" " command-line editing
" move-commands
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-B> <Left>
cnoremap <C-F> <Right>
cnoremap <Esc>b <S-Left>
cnoremap <Esc>w <S-Right>
cnoremap <Esc>e <S-Right>
cnoremap <Esc>B <C-Left>
cnoremap <Esc>W <C-Right>
cnoremap <Esc>E <C-Right>
" edit-commands
cnoremap <C-D> <Del>
cnoremap <C-G> <C-R>=expand("<cword>")<CR>
cnoremap <C-X> <C-R>=expand("<cWORD>")<CR>
" history-commands with comparing current command line
cnoremap <C-P> <Up>
cnoremap <C-N> <Down>
" history-commands without comparing current command line
cnoremap <Esc>k <S-Up>
cnoremap <Esc>j <S-Down>
" use bash completion
if version >= 502
set wildmode=longest,list
else
cnoremap <Tab> <C-L>
cnoremap <C-L> <C-D>
endif
" map two escapes to exit from command-line
cnoremap <Esc><Esc> <Esc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment