Giter Site home page Giter Site logo

vim-cursorword's Introduction

vim-cursorword

Underlines the word under the cursor

vim-cursorword

Installation

Install with your favorite plugin manager.

Author

itchyny (https://github.com/itchyny)

License

This software is released under the MIT License, see LICENSE.

vim-cursorword's People

Contributors

itchyny avatar sunaku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-cursorword's Issues

When you move the cursor or modify the text, the highlight flashes.

This is a good plug-in. When I use it, I find that the highlight flickers in the following two cases:

  1. When I move the cursor.
  2. When I edit the text.

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.

2021-06-06_15-34-38.mp4

What is the usage of cursorword_id1?

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 has a bug

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

E28: No such highlight group name: CursorWord0 when vim-startify is lazy loaded by vim-plug

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?

mbyte character support

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.

Bug with latest neovim

Hi @itchyny found something wrong with neovim head version

  • version : NVIM v0.5.0-dev+b0215afc8
  • env : mac os 10.15.7

Problem

check this pic. the cursor in word function. but you can see it highlight the 1 with a space?
image

The plugin does not work without plugin manager.

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 ;)

Error happened when opening cmdwin with Neovim inccommand=nosplit

set inccommand=nosplitと一緒に使い,cmdwinを開くとエラーが出ます

以下のvimrcと一緒に当該リポジトリ内で nvim -u vimrc をして確認しています

nvim -v | head -1NVIM 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 when cursor on unicode char

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.

assign a color to the underline

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!

機能の toggle を可能にしてほしい

便利に使わせていただいています。ただ、URL が大量に書かれたファイルにて URL の編集を行う際などハイライトされる部分がとても多い場合カーソルの動きが明らかに遅くなるため簡単にトグルができると助かります。

Unnecessary white background of cursorword appear when set cursorline

  • Disable cursorline

.vimrc

" set cursorline

Result:
disable_cursorline

  • Enable cursorline

.vimrc

set cursorline
highlight CursorLine cterm=none ctermfg=None
highlight Visual cterm=bold ctermbg=202 ctermfg=NONE

Result:
enable_cursorline

I don't want the white background appear. How could I to hide or make it transparent?

Configuring the delay

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.

Cursor word lose effect after switch to other files

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?

Priority

Use case

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)
  • both priorities have to be negative, otherwise, they would override hlsearch

Feature request

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.

Allow to customize highlight groups

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.