vim

For discussion on all things (neo)vim.
marrs 2020-03-13T18:40:29.072400Z

Hello vimmers, can anyone tell me why vim might be using different rules to define words for lisp as it does for other languages? And more importantly, how to stop it from doing that? Right now, words are defined more along the lines of a standard W than a w. This also affects searching for a word under the cursor with * or #

mjw 2020-03-13T18:50:46.074800Z

I’m trying to remember the name of the exact setting, but it’s possible define keyword boundaries per language. You probably have a plugin that’s setting those boundaries explicitly (e.g., jdbc/execute-one! is treated as a single word in Clojure whereas it might be two or three in other languages).

marrs 2020-03-13T18:56:48.077800Z

thx @matt.wistrand. The example you gave seems to be true for the standard lisp filetype setting as well. One way it differs from Clojure for me at least is that for a string like ring.util.blah, "ring", "util", and "blah" are treated as separate words

marrs 2020-03-13T18:57:49.078500Z

whereas in Clojure mode, everything that isn't a whitespace is matched

mjw 2020-03-13T19:04:30.080200Z

The setting is iskeyword. If you enter :set iskeyword in Vim, you’ll see a list of characters included in the file type’s definition of “word characters”. You’re supposed to be able to override that via ftplugin/clojure.vim but I’m having trouble doing so.

marrs 2020-03-13T19:04:51.080400Z

thx, I'll take a look

marrs 2020-03-13T19:13:57.082900Z

interesting, the rules for lisp and clojure are actually very similar. It looks like . is almost the only char that isn't included by the lisp ftplugin that is included by the clojure one. I guess the intention for both is that matching is on the entire symbol, rather than a portion of it. Anyway, I now know that it's a standard feature of vim rather than a plugin, so thanks for that. I'll see how i get on with the different defaults for both filetypes

mjw 2020-03-13T19:16:32.083800Z

Yeah, it’s not in any of my plugins, so :verbose set iskeyword reveals the setting is coming from (neo)vim itself.

marrs 2020-03-13T19:34:05.086400Z

@matt.wistrand found a nice solution. I'm going to guess you were trying to modify ~/.vim/ftplugin/clojure.vim. That won't work cos the installed ftplugin gets called after that. You have to create a file in ~/.vim/after/ftplugin/clojure.vim instead, and then you can modify the setings in there, so I added setlocal iskeyword-=/ to allow me to find all calls belonging to an imported package

🎉 1
marrs 2020-03-13T19:35:00.086900Z

(also, what is going on with Slack formatting?)

NoahTheDuke 2020-03-17T15:18:23.089400Z

do you mean the new editor stuff? if you want the old markdown-only method of formatting text, go to your preferences, advanced, click the "format messages with markup" button