Wednesday, August 5, 2015

dot in iskeyword in C and sh files

Since some time cycling through variables in a shell file with the
asterisk '*' key is broken for me. In the simple example like that:

var="val"
echo "$var.whatever"

I was able to move cursor to "var=", hit "*" and saw all "var" strings
highlighted. Recently that broken, only the assignment in above example
is highlighted. If I put curly braces around the usage of "var" it gets
highlighted as well. But if I move to "whatever" then "var.whatever" is
highlighted. Surely thats wrong, "var.whatever" is not a word.

After some poking I found that iskeyword= is likely the knob to change.
First I did a test with a C file, like:

struct var var;
var.var = 0;

Oddly enough, each "var" is highlighted right away, witout the dot. So
it must be something special with files ending in ".sh". Even in this
mail each "var" is highlighted, without the dot itself.

Looking through the files provided by the vim.rpm I dont spot the place
where also the dot is considered a word.

Why does that happen for shell files?
Why would that behaviour desirable?

Olaf

--
--
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/d/optout.

No comments:

Post a Comment