Comments (9)
(mostly for Neovim compatability)
Sigh…
from vim.
The doc is riddled with "hackish" examples like this so why not one more? I find the idea of adding a small plugin better, though. MacVim releases are lagging a bit so I didn't have a chance to play with your commenting plugin yet but it definitely looks like the way to go.
FWIW, vim-cool was a pretty successful attempt to solve one of my pet peeves with hlsearch
: that it lingers on after it stopped being relevant. Whether it is through a built-in plugin, a snippet in the doc, a third-party plugin, or in the core, the problem can be considered solved at this point and, as such, doesn't deserve much attention.
But that still leaves the other one: that the highlighting affects all windows, for which there is no workaround AFAIK. If some effort can be made to improve hlsearch
, I think that's where it would be most useful.
from vim.
There is an entry in todo.txt to make 'hlsearch' global/local option. I remember I spent some time several years ago looking into it (but at least back then it wasn't that simple, but I forgot details).
Regarding @habamax request, does it make sense to add this (and possibly also the highlight-yank implementation from the help page) into the vim-scripts library. Not sure if we would be littering the library and if this is a particular good idea or rather a bad one 🤷
from vim.
I am not sure about library (don't know the purpose of it) but having packadd autonohlsearch
should be easy enough to use.
from vim.
alright then can you make this a real PR then please? Please don't forget a bit of documentation and also please leave adjusting 'updatetime' option value alone.
from vim.
I have something similar in my config, but I prefer 10 sec delay, and also have <esc>
do nohls
in addition. Maybe you can make the timeout configurable by using autocmd CursorHold * timer_start(timeout - &ut, (_) => feedkeys("\<plug>(nohlsearch)", 'm'))
.
I also prefer keeping highlights in insert mode as I replace some highlighted fragments (for instance).
from vim.
One other note: if hlsearch is made global/local, I’d prefer the default to stay as is (it’s remarkably useful when looking at commit diffs + an open buffer to quickly highlight long function names in all windows, for example).
from vim.
Maybe you can make the timeout configurable by using
autocmd CursorHold * timer_start(timeout - &ut, (_) => feedkeys("\<plug>(nohlsearch)", 'm'))
.
Wouldn't it trigger if after updatetime but before additional timeout there would be cursor movement? And what if at that time I will search for another thing? Say if there is 6 seconds of additional timeout, I theoretically can do another search which would be "unhighlighted" almost right away. Not sure though.
from vim.
Wouldn't it trigger if after updatetime but before additional timeout there would be cursor movement? And what if at that time I will search for another thing? Say if there is 6 seconds of additional timeout, I theoretically can do another search which would be "unhighlighted" almost right away. Not sure though.
Correct, there is no good solution. Although I set updatetime
to 10 seconds in my profile, it has an undesired effect: the swap file is not written soon enough. Ideally, there should be an independent hlsearchtimeout
variable implemented in the core.
from vim.
Related Issues (20)
- message "[termdebug] Termdebug already loaded." HOT 7
- Can build-in terminal supports t_Co=256 or termguicolors? HOT 1
- TSV runtime files are missing HOT 1
- segfault accessing list item coming from getregionpos in TextYankPost HOT 1
- Missing separator HOT 10
- Can't get '] boundary of some yanked text HOT 2
- A couple of minor corrections to the docs HOT 4
- Syntax: Mermaid-JS: Comment settings HOT 5
- "I am human" git-vim.org
- Internal error with file completion with fuzzy HOT 6
- The cursor position after wrapping with breakindent may be incorrect. HOT 1
- Tested remote debugging with Termdebug: a small report and a feature request. HOT 4
- Should fuzzy completion change the candidate list? HOT 6
- Fuzzy completion is incorrect when completeopt contains longest HOT 7
- Fuzzy completion may be affected by `set complete-=i`
- providing vim -u ~/config/vim/vimrc . won't open netrw tree HOT 10
- `vim` appears to hang with "Press ENTER or type command to continue" HOT 10
- Regression: exists(':keepalt') (and 5 more) return 0 instead of 2 (since Vim 9.1.352) HOT 2
- Incomplete Kconfig syntax highlighting
- duplicate runtime/syntax vimscript for Oracle PL/SQL HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim.