Skip to content

Instantly share code, notes, and snippets.

@sagarrakshe
Last active March 20, 2016 02:22
Show Gist options
  • Save sagarrakshe/8a8cee7100328161cb6a to your computer and use it in GitHub Desktop.
Save sagarrakshe/8a8cee7100328161cb6a to your computer and use it in GitHub Desktop.
vimscripts
" 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