Created
June 16, 2021 09:58
-
-
Save millionfor/2d543ae00b539f7bb1390d9e926b4b67 to your computer and use it in GitHub Desktop.
This file contains 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
vnoremap <silent><buffer> C :<c-u>call <SID>console()<cr> | |
func s:console() | |
let tag = getline(line("."))[col("'<") - 1 : col("'>") - 2] | |
let l = line('.') | |
let space = substitute(getline(l), '\v(^\s*).*', '\1', '') | |
call appendbufline('%', line('.'), printf(space . 'console.log(`[logger-%s] => `, %s)', tag, tag)) | |
endf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment