python - On keystroke insert line of code in (mac)vim, for pdb -


i'm looking way insert line of code keystroke leaderp in macvim

i want insert following line of code:

import pdb; pdb.set_trace() 

probably not unheard of line of code in python land

this might not best vimscript every wat want! :-) place in .vimrc , can call leader p.

map <leader>p :call insertline()<cr>  function! insertline()   let trace = expand("import pdb; pdb.set_trace()")   execute "normal o".trace endfunction 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -