4 ms·
I only notice vim 9.0 because it highlights as you search. Otherwise I'm in total agreement.
by hiAndrewQuinn 2y ago
I only notice vim 9.0 because it highlights as you search. Otherwise I'm in total agreement.
- Sesse__ 2y ago“:set hlsearch” in pretty much any version of vim. (I don't know if vim 9.0 changed the default or not.)
- wruza 2y agoNo, it didn't. Vim rarely changes defaults, if at all, but it can add settings to example rc files.
- hiAndrewQuinn 2y agoThat's very odd, then... I definitely remember hlsearch being off in Vim 8, and on in Vim 9. Either way thank you! Now I have even less reason to notice.
- johnisgood 2y agoProbably distro-specific, so up to package maintainers.
- setopt 2y agoNote that some Linux distros provide their own versions of vimrc that overrides the upstream default settings. Note also that newer Vim versions come with a "defaults.vim" that you can load if you want, containing arguably sensible inoffensive defaults; if you or your distro loaded that, it might contain hlsearch as well.
- kazinator 2y agoVim did that in 1994 already.
- menaerus 2y agoI didn't find that feature to be that handy tbh. Mostly because it necessitates me to search for the pattern manually. What I usually want in my workflow is to highlight the word under the cursor automatically. This simplifies the code reading significantly for me and I am not aware of such Vim feature baked in? Luckily it's very easy to add one, e.g. function! HighlightWordUnderCursor() if getline(".")[col(".")-1] !~# '[[:punct:][:blank:]]' exec 'match' 'Search' '/\V\<'.expand('<cword>').'\>/' else match none endif endfunction autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor()
- gnubison 2y agoOr, a stupid way: “#*” Or, also stupid: “*``”