Skip to content

Instantly share code, notes, and snippets.

@whot
Last active September 3, 2019 21:34
Show Gist options
  • Save whot/db2139437a267f0234a033ece1875c24 to your computer and use it in GitHub Desktop.
Save whot/db2139437a267f0234a033ece1875c24 to your computer and use it in GitHub Desktop.
" function to insert a printf statement at the current line when typing "mm" in normal (not insert) mode
" useful for sprinkling debugging statements across files quickly
function! InsertMarker()
let string = "printf(\"::::::::: %s:%d:%s() - \\n\", __FILE__, __LINE__, __func__);"
call append(line('.'), string)
endfunction
command Marker call InsertMarker()
map mm :Marker<enter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment