Fork me on GitHub
#vim
<
2021-08-02
>
dharrigan16:08:31

Anyone got a good way of having vim recongise that if you highlight a word, i.e., foo that it can also highlight the word in foo/bar

dharrigan16:08:08

currently, when I hilight foo by itself is highlighted, but if it's part of a (in this case) namespace, i.e., foo/bar, that foo doesn't get highlighted

dharrigan16:08:13

must be something to do with word boundaries

nbardiuk16:08:29

word defined by iskeyword characters https://github.com/neovim/neovim/blob/master/runtime/ftplugin/clojure.vim#L20 * it puts word boundaries around word i.e. /\<word\> g* does not put boundaries i.e. /word

dharrigan16:08:46

investigating

walterl19:08:13

Changing iskeyword can have some unintended consequences. E.g. vim-fireplace uses the word under the cursor for "jump to definition" (IIRC), but if edn/read-string is now just read-string (or just edn), it doesn't work as expected.

walterl19:08:11

I just got used to doing /<Up><BS><BS> or /<Up><Home><Del><Del> to remove \> or \< from the search term 🤷

nbardiuk19:08:06

I've build a habit of using g* instead of * for the same reason - changing iskeyword breaks some tools

walterl19:08:05

Thanks for reminding me of g*, @nbardiuk

⬆️ 2