Let’s say I have following typed in my source file.
var myFunction = function() { };
var anotherFunction = function() { };
var test-m
I can now press Ctrl + P and it will show ‘myFunction’ in the autocomplete list. It’s great and very helpful.
But what I want to do is make VIM treat ‘$’ in the same way it treats ‘-‘.
So when I type
var myFunction = function Module$m
and press Ctrl+P and it will show myFunction in autocomplete.
I have looked at this question and tried setting $ as keyword using iskeyword command but it didn’t help.
And I know it’s possible to do this as I used to have it working before and then I messed up my VIMRC and I am not able to get it work anymore. 🙁
Your help is appreciated, thanks!
To make vim use a dollar-sign as a word separator, do:
If wanting the opposite: (to autocomplete words containing a dollar sign, add a literal dollar sign to the current autocomplete match pattern, by doing the opposite:
To find your current iskeyword setting, do:
This will show you a list of ASCII ranges vim considers a single word. Mine looks like: