Install with your favorite plugin manager.
itchyny (https://github.com/itchyny)
This software is released under the MIT License, see LICENSE.
Underlines the word under the cursor
Home Page: http://www.vim.org/scripts/script.php?script_id=5100
License: MIT License
Install with your favorite plugin manager.
itchyny (https://github.com/itchyny)
This software is released under the MIT License, see LICENSE.
This is a good plug-in. When I use it, I find that the highlight flickers in the following two cases:
Here is my configuration:
let g:cursorword = 1
let g:cursorword_highlight = 0
let g:cursorword_delay = 50
hi CursorWord0 ctermbg=darkgrey guibg=darkgrey term=none cterm=none gui=none
hi CursorWord1 ctermbg=darkgrey guibg=darkgrey term=none cterm=none gui=none
I try to g:cursorword_delay = 10, but the flicker is still visible.
It causes issues that currently words are marked with hi Cursorline
after I change the colorscheme with a different cursorline. I remove all the code related to cursorword_id1
and now it seems that everything works correctly.
augroup cursorword
autocmd!
autocmd VimEnter,ColorScheme * call cursorword#highlight()
autocmd VimEnter,WinEnter,BufEnter,CursorMoved,CursorMovedI * call cursorword#matchadd()
augroup END
should be
augroup cursorword
autocmd!
autocmd VimEnter,WinEnter,BufEnter,ColorScheme * call cursorword#highlight()
autocmd VimEnter,WinEnter,BufEnter,CursorMoved,CursorMovedI * call cursorword#matchadd()
augroup END
When cursor moves through words that occur many times there is a performance drop.
Hi, itchyny. I come across an odd problem when using vim-startify and vim-cursorword at the same time, which vim-startify is lazy loaded by vim-plug.
Plug 'mhinz/vim-startify', { 'on': 'Startify' }
Plug 'itchyny/vim-cursorword'
Then an annoying error occurs:
Error detected while processing function cursorword#matchadd:
line 13:
E28: No such highlight group name: CursorWord0
If vim-startify is loaded without lazy loading, all is fine.
Plug 'mhinz/vim-startify'
Plug 'itchyny/vim-cursorword'
Do you have any clue on this?
Would you please add mbyte character support?
Underline all the same single character in range [\u4e00-\u9fa5]
is all I need.
Thank you very much.
In this line there is a comparison between byte length and the number of characters. Words containing multi-byte characters are therefore ignored by cursorword.
https://github.com/itchyny/vim-cursorword/blob/master/autoload/cursorword.vim#L32
Why is this check in place? Can't the plugin rely solely on the iskeyword
setting?
Hi @itchyny found something wrong with neovim head version
NVIM v0.5.0-dev+b0215afc8
check this pic. the cursor in word function
. but you can see it highlight the 1 with a space?
Hi, recently I found this useful plugin and try to use it.
Thank you for this amazing work.
But I had a little problem.
When I installed the plugin with plugin manager, it works normally.
But when I try to install and use this plugin with my .vimrc as follows, the plugin does not work and report error.
I have already moved the "cursorword.vim" to the plugin folder manually.
source ~/.vim/plugin/cursorword.vim
let g:cursorword = 1
let g:cursorword_highlight = 0
let g:cursorword_delay = 0
hi CursorWord0 ctermbg=lightgrey guibg=lightgrey term=none cterm=none gui=none
hi CursorWord1 ctermbg=lightgrey guibg=lightgrey term=none cterm=none gui=none
The error info is:
Error detected while processing CursorMoved Autocommands for "*":
E117: Unknown function: cursorword#cursormoved
Would you please help me out?
Thank you ;)
set inccommand=nosplit
と一緒に使い,cmdwinを開くとエラーが出ます
以下のvimrcと一緒に当該リポジトリ内で nvim -u vimrc
をして確認しています
nvim -v | head -1
は NVIM v0.5.0-330-g71ee46acc
let &rtp ..= ',' .. expand('<sfile>:h')
set icm=nosplit
iabc<ESC>
:s/ab<C-f>
Error detected while processing function cursorword#matchadd:
line 16:
E171: Missing :endif
E171: Missing :endif
(これは :mes
をすることでエラーが確認できたんですが,普段の自分のvimrcではエラーが出て中断されてしまいます)
<C-c>
Error detected while processing function cursorword#timer_callback[1]..cursorword#matchadd:
line 16:
E171: Missing :endif
parenmatchでも似たようなエラーが出ます itchyny/vim-parenmatch#5
Error detected while processing function cursorword#matchadd:
line 11:
E16: Invalid range
Cursorword does not play well with unicode chars. When I move cursor on say ē
, then error happens.
The undersline color changes with the color of words, i.e., if the word is colored by "green", then the underline color is "green" as well. How could I assign a color to underline persistently, like "yellow", no matter what the word color is? Thanks!
Thanks for writing this great tool, I love it! Here is an idea:
Underlining is supposed to highlight multiple occurrences of a word in the text.
If there is only one occurrence of the word under the curser, it should not underline that word.
This helps see quickly that there are no other occurrences of that word in the text.
I recently updated my vim-cursorword
and received the following error message when starting vim:
Error detected while processing function cursorword#matchadd:
line 14:
No such highlight group name: CursorWord1
I hope the error would be fixed ASAP. For now I will have to disable the plugin altogether.
便利に使わせていただいています。ただ、URL が大量に書かれたファイルにて URL の編集を行う際などハイライトされる部分がとても多い場合カーソルの動きが明らかに遅くなるため簡単にトグルができると助かります。
out of interest, you might want to see https://github.com/osyo-manga/vim-brightest as well. I'm not saying you should take yours down (since the other is in Japanese), but it could be useful to see.
Hey there, thanks for the plugin!
I'm wondering: can I configure the delay after which words get underlined? I have this effect where moving one character inside the word will refresh the underlining of that word, so it flashes a lot. With a longer delay/debounce, this could be a bit smoother.
My environment is Ubuntu20.04/ vim8.2.5105.
It's worked fine when start-up, but after I switch to another file by using Nerdtree or LeaderF, it has no cursorline at all! Only when I type whatever a colorscheme use command like: :colorscheme onedark
, it works again...
What is the cause of that?
I've asked a question related to this Plugin here:
https://vi.stackexchange.com/questions/12158/improperly-highlighted-when-used-with-cursorcolumn
I am wondering if this can be an issue of vim-cursorword
NOTE: Perhaps this is related to this w0ng/vim-hybrid#17
I'm using vim-cursorword
together with inkarkat/vim-mark
.
Underline of vim-cursorword
takes precedence over marks placed by vim-mark
.
This is inconvenient since there is no immediate visual feedback after marking a word by pressing \m
. I have to move the cursor to see the marks.
vim-cursorword
has a priority of -1 (unconfigurable)vim-mark
by default has a priority of -10 (configurable via g:mwMaxMatchPriority
)hlsearch
I would like to configure vim-cursorword
match priority.
Or leave it unconfigurable, but at least make it small enough, like -100
. In this case it is possible to revert to the old behavior by setting g:mwMaxMatchPriority
to e.g. -200
.
Or, if it is possible, make both plugins not interfere with each other. I.e. make vim-cursorword
underline not to override vim-mark
backgrounds.
It seems that the cursorword#highlight
function overrides my attempts at customizing the CursorWord[01]
highlight groups. Would it be possible to make a minor change that allows me to customize these groups?
How to fix the cursor style? I don't like the underline style, i love backgroundcolor style.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.