Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vaklinzi
Forked from nervetattoo/console.log.vim
Created April 7, 2021 10:22
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 vaklinzi/b64da8db8ef0f9cd7b9a21042617fc36 to your computer and use it in GitHub Desktop.
Save vaklinzi/b64da8db8ef0f9cd7b9a21042617fc36 to your computer and use it in GitHub Desktop.
console.log in vim
" Console log from insert mode; Puts focus inside parentheses
imap cll console.log();<Esc>==f(a
" Console log from visual mode on next line, puts visual selection inside parentheses
vmap cll yocll<Esc>p
" Console log from normal mode, inserted on next line with word your on inside parentheses
nmap cll yiwocll<Esc>p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment