Skip to content
Browse files

don't remap CR in command line windows

  • Loading branch information...
1 parent 6e45e89 commit a08fc42c592d133dfd43f472c02eed428f601189 @garybernhardt committed May 28, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 .vimrc
View
10 .vimrc
@@ -83,6 +83,11 @@ augroup vimrcEx
" Don't syntax highlight markdown because it's often wrong
autocmd! FileType mkd setlocal syn=off
+
+ " Leave the return key alone when in command line windows, since it's used
+ " to run commands there.
+ autocmd! CmdwinEnter * :unmap <cr>
+ autocmd! CmdwinLeave * :call MapCR()
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -111,7 +116,10 @@ imap <c-l> <space>=><space>
" Can't be bothered to understand ESC vs <c-c> in insert mode
imap <c-c> <esc>
" Clear the search buffer when hitting return
-:nnoremap <CR> :nohlsearch<cr>
+function! MapCR()
+ nnoremap <cr> :nohlsearch<cr>
+endfunction
+call MapCR()
nnoremap <leader><leader> <c-^>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

0 comments on commit a08fc42

Please sign in to comment.
Something went wrong with that request. Please try again.