Last active
March 20, 2016 02:22
-
-
Save sagarrakshe/8a8cee7100328161cb6a to your computer and use it in GitHub Desktop.
vimscripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Insert debugger statement according to the filetype, mapped to <F2> key. | |
function! InsertDebugger() | |
if &ft == "python" | |
execute "normal oimport ipdb;ipdb.set_trace()\<Esc>" | |
elseif &ft == "javascript" | |
execute "normal odebugger;\<Esc>" | |
else | |
" it is something else | |
endif | |
endfunction | |
nnoremap <F2> :call InsertDebugger()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment