Update mappings, use noremap

This commit is contained in:
Eryn Wells 2013-10-02 09:13:08 -07:00
parent 05053f716f
commit 0929a3a7ab

73
vimrc
View file

@ -136,29 +136,27 @@ let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
" set the Gundo preview window on the bottom " set the Gundo preview window on the bottom
let g:gundo_preview_bottom = 1 let g:gundo_preview_bottom = 1
map <silent> <F2> :NERDTreeToggle<CR> noremap <silent> <F2> :NERDTreeToggle<CR>
map <silent> <F3> :GundoToggle<CR> noremap <silent> <F3> :GundoToggle<CR>
map <silent> <F4> :setlocal invlist<CR> noremap <silent> <F4> :setlocal invlist<CR>
inoremap jj <ESC> inoremap kj <ESC>
" allow starting commands with ; instead of : " allow starting commands with ; instead of :
nnoremap ; : nnoremap ; :
" tab to skip between braces and such in normal " tab to skip between braces and such in normal
nnoremap <tab> % nnoremap <silent> <tab> %
vnoremap <tab> % vnoremap <silent> <tab> %
" disable the help key! " disable the help key!
inoremap <F1> <ESC> noremap <silent> <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" make switching windows easier " make switching windows easier
nnoremap <C-h> <C-w>h nnoremap <silent> <C-h> <C-w>h
nnoremap <C-j> <C-w>j nnoremap <silent> <C-j> <C-w>j
nnoremap <C-k> <C-w>k nnoremap <silent> <C-k> <C-w>k
nnoremap <C-l> <C-w>l nnoremap <silent> <C-l> <C-w>l
" Usual EMACS (oh the horror!) begin-line and end-line keys for first and last " Usual EMACS (oh the horror!) begin-line and end-line keys for first and last
" buffer. " buffer.
@ -226,39 +224,36 @@ endfunction
let mapleader=',' let mapleader=','
" hide search terms
nnoremap <silent> <leader><space> :setlocal invhlsearch<CR>
" find all
nnoremap <leader>fa :%s/\v
" strip all trailing whitespace in the current file " strip all trailing whitespace in the current file
nnoremap <silent> <leader>W :call <SID>strip_trailing_whitespace()<CR> nnoremap <silent> <leader>W :call <SID>strip_trailing_whitespace()<CR>
" Source .vimrc and project.vim files " Source .vimrc
nmap <leader>V :source $MYVIMRC<CR> nnoremap <leader>sv :source $MYVIMRC<CR>
nmap <leader>P :call <SID>SourceProjectFile()<CR>
" Edit my .vimrc and project.vim files
nmap <leader>eV :edit $MYVIMRC<CR>
nmap <leader>eP :exec 'edit ' . GetProjectFile()<CR>
" hide search terms " Edit my .vimrc
nmap <silent> <leader><space> :setlocal invhlsearch<CR> nnoremap <leader>ev :split $MYVIMRC<CR>
" find all " Edit the snippet file for the current filetype
nmap <leader>fa :%s/\v nnoremap <leader>es :e ~/.vim/bundle/snipmate-snippets/snippets/<C-r>=&filetype<CR>.snippets<CR>
" Edit the ftplugin-after script for the current filetype
" Open the snippet file for the current filetype nnoremap <leader>ef :e ~/.vim/after/ftplugin/<C-r>=&filetype<CR>.vim<CR>
nmap <leader>esn :e ~/.vim/bundle/snipmate-snippets/snippets/<C-r>=&filetype<CR>.snippets<CR>
" Open the ftplugin-after script for the current filetype
nmap <leader>eft :e ~/.vim/after/ftplugin/<C-r>=&filetype<CR>.vim<CR>
" Toggle position highlighting " Toggle position highlighting
nmap <silent> <leader>cl :setlocal invcursorline<CR> nnoremap <silent> <leader>cl :setlocal invcursorline<CR>
nmap <silent> <leader>cc :setlocal invcursorcolumn<CR> nnoremap <silent> <leader>cc :setlocal invcursorcolumn<CR>
" Text bubbling (these depend on tpope's unimpaired plugin) " Text bubbling (these depend on tpope's unimpaired plugin)
nmap <C-Up> [e nnoremap <C-Up> [e
nmap <C-Down> ]e nnoremap <C-Down> ]e
vmap <C-Up> [egv vnoremap <C-Up> [egv
vmap <C-Down> ]egv vnoremap <C-Down> ]egv
" Select last edited text after cut and paste " Select last edited text after cut and paste
nmap gV `[v`] nnoremap gV `[v`]
" Command-T should open files in tabs when I hit <CR>; move opening files in " Command-T should open files in tabs when I hit <CR>; move opening files in
@ -267,9 +262,9 @@ nmap gV `[v`]
"let g:CommandTAcceptSelectionTabMap='<CR>' "let g:CommandTAcceptSelectionTabMap='<CR>'
" GitGutter shows changed lines in files. " GitGutter shows changed lines in files.
let g:gitgutter_enabled = 0 "let g:gitgutter_enabled = 0
highlight clear SignColumn "highlight clear SignColumn
nmap <silent> <leader>gg :ToggleGitGutter<CR> "nmap <silent> <leader>gg :ToggleGitGutter<CR>
if has('autocmd') if has('autocmd')
filetype plugin indent on filetype plugin indent on