Last active
September 22, 2024 18:27
-
-
Save ivanbrennan/b8bf48733f9ae20ac2cca2665caa6026 to your computer and use it in GitHub Desktop.
Vim iskeyword workaround (after/ftplugin/vim.vim)
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
setlocal iskeyword-=# | |
nnoremap <buffer> <silent> <C-]> :tag <C-R>=Vimcword()<CR><CR> | |
nnoremap <buffer> <silent> g<C-]> :tjump <C-R>=Vimcword()<CR><CR> | |
nnoremap <buffer> <silent> g] :tselect <C-R>=Vimcword()<CR><CR> | |
func! Vimcword() | |
let l:orig=&l:iskeyword | |
setlocal iskeyword+=# | |
let l:cword=expand('<cword>') | |
let &l:iskeyword=l:orig | |
return l:cword | |
endf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment