Skip to content

Instantly share code, notes, and snippets.

@AndrewRadev
Created August 8, 2010 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRadev/513976 to your computer and use it in GitHub Desktop.
Save AndrewRadev/513976 to your computer and use it in GitHub Desktop.
" Remap the 'Enter' key to process the command line before executing
cnoremap <cr> <c-r>=<SID>DoSomeChecks()<cr><cr>
function! s:DoSomeChecks()
let g:debug = getcmdline()
" and some more stuff...
" :doautocmd with a custom event maybe?
return ''
endfunction
" do something like :some-command | echo g:debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment