{"id":13485278,"url":"https://github.com/dominikduda/vim_current_word","last_synced_at":"2025-07-07T07:09:37.359Z","repository":{"id":19706724,"uuid":"87693908","full_name":"dominikduda/vim_current_word","owner":"dominikduda","description":"Plugin highlighting word under cursor and all of its occurences","archived":false,"fork":false,"pushed_at":"2023-11-09T01:01:24.000Z","size":3015,"stargazers_count":150,"open_issues_count":6,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-06T17:58:13.705Z","etag":null,"topics":["neovim","vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dominikduda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-09T08:28:43.000Z","updated_at":"2025-05-21T06:00:54.000Z","dependencies_parsed_at":"2024-01-14T15:26:45.837Z","dependency_job_id":"1ce6d827-feba-4a62-a39d-ee121ba82a5b","html_url":"https://github.com/dominikduda/vim_current_word","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dominikduda/vim_current_word","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikduda%2Fvim_current_word","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikduda%2Fvim_current_word/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikduda%2Fvim_current_word/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikduda%2Fvim_current_word/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominikduda","download_url":"https://codeload.github.com/dominikduda/vim_current_word/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikduda%2Fvim_current_word/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264032284,"owners_count":23546806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","vim","vim-plugin"],"created_at":"2024-07-31T17:01:53.760Z","updated_at":"2025-07-07T07:09:37.339Z","avatar_url":"https://github.com/dominikduda.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/dominikduda/vim_current_word/master/vim_current_word_logo.png\" width=\"500\" /\u003e\n\n# vim_current_word\n\nPlugin highlighting word under cursor and all of its occurrences.\n\n![customized](https://raw.githubusercontent.com/dominikduda/vim_current_word/master/gifs/customized.gif)\n\n##### Why should you use it?\n  - Helps predict how vim word movements (`w`, `e`, `b`) will behave\n  - Plays well with `*` and `#`\n  - Instant access to information where the variable under cursor is used\n  - Works out of the box!\n\n##### The most importantly it solves all the problems other similar plugins have with knowing what exactly is a word and when cursor is on the word.\n\nPlugin determines what is a word based on what is a keyword in current file type. For example `foo#bar` in `.vim` file will be a single word (because vimscript allows to put `#` as part of variable name), but in `.rb` file `foo#bar` will be considered as two words (because `#` starts comment).\n\n## Installation\nvia `Plug`, `Neobundle` or `Vundle`:\n```\nPlug 'dominikduda/vim_current_word'\nNeoBundle 'dominikduda/vim_current_word'\nPlugin 'dominikduda/vim_current_word'\n```\nvia `Pathogen`:\n```\ngit clone https://github.com/dominikduda/vim_current_word.git ~/.vim/bundle/vim_current_word\n```\nvia Vim 8 packages:\n```\ngit clone https://github.com/dominikduda/vim_current_word.git ~/.vim/pack/plugins/start/vim_current_word\n```\n\n## Quick start\n\nBy default vim_current_word will underline twins of word under cursor and use your `Search` highlight group to color word under cursor. If you want to change this behavior see the [styling](https://github.com/dominikduda/vim_current_word#styling) section.\n\nPlugin defines `:VimCurrentWordToggle` command which enables/disables plugin on the fly.\n\n## Customization (values written here are defaults)\n\n#### Enable/disable highlighting of:\n\n```vim\n\" Twins of word under cursor:\nlet g:vim_current_word#highlight_twins = 1\n\" The word under cursor:\nlet g:vim_current_word#highlight_current_word = 1\n```\n\n##### Delay highlighting:\n\nSetting this option to more than 0 will enable delayed highlighting. The value of this variable is a delay in milliseconds.\n```vim\nlet g:vim_current_word#highlight_delay = 0\n```\n\n##### Enable/disable highlighting only in focused window:\n\nDisabling this option will make the word highlight persist over window switches and even over focusing different application window.\n```vim\nlet g:vim_current_word#highlight_only_in_focused_window = 1\n```\n\n##### Blacklist filetypes:\n\nTo avoid specific filetypes, add this variable to your vimrc:\n```vim\nlet g:vim_current_word#excluded_filetypes = ['ruby']\n```\nIf you only want to disable the plugin in some buffers, see the next configuration item.\n\n##### Blacklist buffers:\n\nTo prevent the plugin from running in one or more buffers add following to your vimrc:\n```vim\nautocmd BufAdd NERD_tree_*,your_buffer_name.rb,*.js :let b:vim_current_word_disabled_in_this_buffer = 1\n```\nThe example above disables the plugin in:\n- Every buffer which name start with `NERD_tree_`\n- Every buffer which name equals `your_buffer_name.rb`\n- Every buffer which name ends with `.js`\n\n##### Enable/disable plugin:\n```vim\nlet g:vim_current_word#enabled = 1\n```\n\n## Styling\n\n#### To change any style paste related code into your `.vimrc`\n\nChange highlight style of **twins of word under cursor**:\n```vim\nhi CurrentWordTwins guifg=#XXXXXX guibg=#XXXXXX gui=underline,bold,italic ctermfg=XXX ctermbg=XXX cterm=underline,bold,italic\n\"                          └┴┴┴┴┤        └┴┴┴┴┤     └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤         └┴┤         └┴┤       └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤\n\"    gui-vim font color hex code│             │   gui-vim special styles│           │           │ console-vim special styles│\n\"    ───────────────────────────┘             │   ──────────────────────┘           │           │ ──────────────────────────┘\n\"            gui-vim background color hex code│     console-vim font term color code│           │\n\"            ─────────────────────────────────┘     ────────────────────────────────┘           │\n\"                                                         console-vim background term color code│\n\"                                                         ──────────────────────────────────────┘\n```\n\nChange highlight style of the **word under cursor**:\n```vim\nhi CurrentWord guifg=#XXXXXX guibg=#XXXXXX gui=underline,bold,italic ctermfg=XXX ctermbg=XXX cterm=underline,bold,italic\n\"                     └┴┴┴┴┴──┐     └┴┴┴┴┤     └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤         └┴┤         └┴┤       └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤\n\"  gui-vim font color hex code│          │   gui-vim special styles│           │           │ console-vim special styles│\n\"  ───────────────────────────┘          │   ──────────────────────┘           │           │ ──────────────────────────┘\n\"       gui-vim background color hex code│     console-vim font term color code│           │\n\"       ─────────────────────────────────┘     ────────────────────────────────┘           │\n\"                                                    console-vim background term color code│\n\"                                                    ──────────────────────────────────────┘\n```\n\nTo achieve the style from the first gif (in terminal vim):\n```vim\nhi CurrentWord ctermbg=53\nhi CurrentWordTwins ctermbg=237\n```\n\nRather important notes:\n- If you do not want any special styles just ommit them (or use `gui=NONE cterm=NONE`)\n- [Here](http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html) you can find color codes for console-vim\n\n## FAQ:\n\n##### Why doesn't my customized highlight work?\nYou have to set custom higlights below `colorscheme` in your `.vimrc`.\n\n## Advanced:\n\nChange word under cursor twins or word under cursor match id. You should touch this only if you encounter some `match id already taken` error - theoretically may occur when some other plugin will override required id.\n```\nlet g:vim_current_word#twins_match_id = 502\nlet g:vim_current_word#current_word_match_id = 502\n```\n\n## Credits\n\nThanks to [Bartosz Mąka](https://github.com/bartoszmaka) for creating the gifs and testing.\n\nThanks to [Dávid Csákvári](https://github.com/dodie) for information about a script which was the inspiration for this plugin.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/dominikduda/config_files/master/dd_logo_blue_bg.png\" width=\"300\" /\u003e\n\u003c/p\u003e\n\u003cp\u003ePlugin by Dominik Duda\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominikduda%2Fvim_current_word","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominikduda%2Fvim_current_word","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominikduda%2Fvim_current_word/lists"}