Wednesday, June 19, 2013

Re: Where to put "set iskeyword+=_" or remove "iskeyword-=_

Coot, I think the problem is that I am working with vim 7.3, patches 1-46. It is a locked down environment, so I've given up trying to upgrade for the next few years (which is not to say that I haven't submitted a request). There is no tex_isk in .../doc/syntax.txt in my install. The commands

echo tex_isk
echo g:tex_isk

yield the error messages:

E121: Undefined variable: tex_isk
E15: Invalid expression: tex_isk

E121: Undefined variable: g:tex_isk
E15: Invalid expression: g:tex_isk
--------------------------------------------------
Ben, Gary,

I don't have the authority to write to system-wide files. I tried autocommands and ~/vimfiles/after/syntax/tex.vim. No luck so far. In both cases, the result is that "setg isk?" and "setl isk?" show an underscore *before* enabling syntax, but the local version loses underscore after enabling syntax. I can tell that the local version takes precedence because underscore is no longer a keyword character, based on the fact that i_ctlr-p and i_ctrl-n does word completion only upto an underscore.

Here are the details behind my attempt at using autocommand and ~/vimfiles/after/syntax/tex.vim.

1 ~/vimfiles/after/syntax/tex.vim
2 -------------------------------
3 setg isk+=_
4 setlocal isk+=_
5
6 ~/.vim/after/syntax/tex.vim
7 ---------------------------
8 setg isk+=_
9 setlocal isk+=_
10
11 ~/_vimrc
12 --------
13 autocmd BufNewFile,BufRead,BufWinEnter *.tex setl isk+=_ | setg isk+=_
14 autocmd BufNewFile,BufRead,BufWinEnter *.bib setg isk+=_ | setl isk+=_
15 filetype on
16 au Syntax * setl isk+=_

I bastardized lines 13-14 from code higher up in the _vimrc, not sure if it is kosher.

Thanks for any other suggestions.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment