Skip to content

Instantly share code, notes, and snippets.

@ivanbrennan
Last active July 9, 2017 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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