Skip to content

Instantly share code, notes, and snippets.

@ivanbrennan
Last active September 22, 2024 18:27
Show Gist options
  • Save ivanbrennan/b8bf48733f9ae20ac2cca2665caa6026 to your computer and use it in GitHub Desktop.
Save ivanbrennan/b8bf48733f9ae20ac2cca2665caa6026 to your computer and use it in GitHub Desktop.
Vim iskeyword workaround (after/ftplugin/vim.vim)
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