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
| " If you frequently find yourself printing values to console in JS for | |
| " debugging, add the line below to your .vimrc file. It sets you up | |
| " so that if you do <Leader>d then whatever you had yanked to the | |
| " default buffer will be put into a console.log statement. | |
| " Trust me. It's hacky (and could be better written to handle quotes), | |
| " but saves a ton of time. | |
| " | |
| " (For more info on leader keys, see: http://learnvimscriptthehardway.stevelosh.com/chapters/06.html) | |
| " | |
| " Example: | |
| " If you had yanked `this.myVariable` and then type <Leader>d, it would | |
| " paste the following into the next line: | |
| " | |
| " console.log('this.myVariable: ', this.myVariable) | |
| " | |
| autocmd BufEnter *.js :map <Leader>d <Esc>oconsole.log('<Esc>p$a:', <Esc>p$a)<Esc> |