vim & nvim plugin for quickly print some thing base by filetype or filename
plug 'yaocccc/vim-echo'
OR
use { 'yaocccc/vim-echo', cmd = "VECHO" }
" [ECHO] will be replace to your selected context.
e.g.
Your selected context: hello
fmt.Printf("[ECHO]: %s", [ECHO]) => fmt.Printf("hello: %s", hello);
" you can set custom config for difference filename or file ext, or you can set it is ''
let s:vim_echo_by_file = {
\ 'vim': 'echo("[ECHO]:" . [ECHO])',
\ 'go': 'fmt.Printf("[ECHO]: %+v\n", [ECHO])',
\ 'js': 'console.log(`[ECHO]: ${[ECHO]}`)',
\ 'ts': 'console.log(`[ECHO]: ${[ECHO]}`)',
\ 'vue': 'console.log(`[ECHO]: ${[ECHO]}`)',
\ 'sh': 'echo [ECHO]: $[ECHO]',
\ 'zsh': 'echo [ECHO]: $[ECHO]',
\ 'go.mod': '[ECHO]',
\ 'json': '',
\ }
" keymap
e.g.
vnoremap <silent> C :<c-u>VECHO<cr>