{"id":13485230,"url":"https://github.com/azabiong/vim-highlighter","last_synced_at":"2025-03-27T17:30:54.124Z","repository":{"id":40296918,"uuid":"365307614","full_name":"azabiong/vim-highlighter","owner":"azabiong","description":"Highlight words and expressions","archived":false,"fork":false,"pushed_at":"2025-03-14T15:22:16.000Z","size":297,"stargazers_count":249,"open_issues_count":3,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-14T16:29:56.130Z","etag":null,"topics":["grep","highlighter","neovim","vim"],"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/azabiong.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":"2021-05-07T17:30:59.000Z","updated_at":"2025-03-14T15:22:20.000Z","dependencies_parsed_at":"2024-03-13T00:34:08.765Z","dependency_job_id":"31238ecb-3a6d-4f56-b753-2883b99d5efb","html_url":"https://github.com/azabiong/vim-highlighter","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azabiong%2Fvim-highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azabiong%2Fvim-highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azabiong%2Fvim-highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azabiong%2Fvim-highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azabiong","download_url":"https://codeload.github.com/azabiong/vim-highlighter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245892492,"owners_count":20689508,"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":["grep","highlighter","neovim","vim"],"created_at":"2024-07-31T17:01:52.313Z","updated_at":"2025-03-27T17:30:54.116Z","avatar_url":"https://github.com/azabiong.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"\u003c!-- https://github.com/azabiong/vim-highlighter --\u003e\n\n# Vim Highlighter\n\n \u003cp\u003e\u003ch6\u003e \u0026nbsp;\u0026nbsp; ver 1.63.3 \u003c/h6\u003e\u003c/p\u003e\n\n \u003cimg width=\"220\" alt=\"highlighter\" align=\"right\" src=\"https://user-images.githubusercontent.com/83812658/136645135-46bbe613-0ac7-4688-9deb-4bc28ae627f3.jpg\"\u003e\n \u003ch3\u003e Introduction \u003c/h3\u003e\n\n Highlighting keywords or lines can be useful when analyzing code, reviewing summaries, and quickly comparing spellings.\n This plugin provides easy commands and shortcuts to set and delete highlights, and additional features such as\n Move to Highlight, Save and Load, Find Pattern, and Customize Colors.\n\n### Contents\n\n \u0026nbsp;\u0026nbsp;\n [Installation](#installation) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n [Key Map](#key-map) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n [Jump to Highlight](#jump-to-highlight) \u0026nbsp;\u0026nbsp;\u0026nbsp;\n [One Time Highlight](#one-time-highlight) \u0026nbsp;\u0026nbsp;\u0026nbsp;\n [Following Highlight](#following-highlight) \u0026nbsp;\u0026nbsp; \u0026nbsp;\n [Positional Highlight](#positional-highlight) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n [Save \u0026 Load](#save--load) \u0026nbsp;\u0026nbsp;\u0026nbsp;\n [Sync Mode](#sync-mode) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n [Find in Files](#find-in-files) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n [Customizing Colors](#customizing-colors) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n [Configuration](#configuration-examples) \u003cbr\u003e \u0026nbsp;\u0026nbsp;\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp; What's New \u003c/b\u003e\u0026nbsp;✨\u003c/summary\u003e\n \u003cbr\u003e\n\n | version | feature | key map |\n |:--:|:--|:--:|\n | 1.62 | [Jump to Highlight](#jump-to-highlight)\u0026nbsp; of the same color | O |\n | 1.60 | [Sync Mode](#sync-mode)\u0026nbsp; across all tab-pages | |\n | 1.58 | [Positional Highlight](#positional-highlight)\u0026nbsp; associated with a buffer | O |\n | 1.56 | [One Time Highlight](#one-time-highlight)\u0026nbsp; and **Jump** | |\n | 1.52 | [Find window](#find-window)\u0026nbsp; key \u003ckbd\u003ei\u003c/kbd\u003e for **View** | O |\n | 1.38 | [Input](#input)\u0026nbsp; patterns in the command-line | |\n | 1.35 | [Multifunction keys](#configuration-examples)\u0026nbsp; for **Find** | O |\n\n \u003c/details\u003e\n \u003cbr\u003e\n\n## Installation\n\n You can use your preferred plugin manager using the string `'azabiong/vim-highlighter'`. For example: \u003cbr\u003e\n\n **vim-plug** \u0026nbsp;` .vim  `\n ```vim\n   Plug 'azabiong/vim-highlighter'\n ```\n **lazy.nvim** \u0026nbsp;` .lua  `\n ```lua\n   {\n     \"azabiong/vim-highlighter\",\n     init = function()\n       -- settings\n     end,\n   },\n ```\n \u003cdetails\u003e\n \u003csummary\u003e\u0026nbsp; \u003cb\u003eor\u003c/b\u003e, \u0026nbsp;Vim's built-in package feature: \u003c/summary\u003e\n\n\u003e \u003cbr\u003e\n\u003e\n\u003e |Linux, \u0026nbsp; Mac| Windows \u0026nbsp;|\n\u003e |:--:|--|\n\u003e |~/.vim| ~/vimfiles|\n\u003e\n\u003e in the terminal:\n\u003e ```zsh\n\u003e cd ~/.vim \u0026\u0026 git clone --depth=1 https://github.com/azabiong/vim-highlighter.git pack/azabiong/start/vim-highlighter\n\u003e cd ~/.vim \u0026\u0026 vim -u NONE -c \"helptags pack/azabiong/start/vim-highlighter/doc\" -c q\n\u003e ```\n \u003c/details\u003e\n \u003cbr\u003e\n\n## Key Map\n\n The plugin uses the following default key mapping variables that work in both normal and visual modes,\n and each key can be easily defined in the configuration file.\n\n \u003cdetails open\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp; .vim \u003c/b\u003e\u003c/summary\u003e\n\n ```vim\n   let HiSet   = 'f\u003cCR\u003e'\n   let HiErase = 'f\u003cBS\u003e'\n   let HiClear = 'f\u003cC-L\u003e'\n   let HiFind  = 'f\u003cTab\u003e'\n   let HiSetSL = 't\u003cCR\u003e'\n ```\n \u003c/details\u003e\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp; .lua \u003c/b\u003e\u003c/summary\u003e\n\n ```lua\n  vim.cmd([[\n    let HiSet   = 'f\u003cCR\u003e'\n    let HiErase = 'f\u003cBS\u003e'\n    let HiClear = 'f\u003cC-L\u003e'\n    let HiFind  = 'f\u003cTab\u003e'\n    let HiSetSL = 't\u003cCR\u003e'\n  ]])\n ```\n \u003c/details\u003e\n\n \u003e Default key mappings: `f Enter`, `f Backspace`, `f Ctrl+L`, `f Tab` and `t Enter`\n\n In normal mode, `HiSet` and `HiErase` keys set or erase highlighting of the word under the cursor. `HiClear` key clears all highlights.\n\n \u003cimg width=\"585\" alt=\"key_map\" src=\"https://github.com/azabiong/vim-highlighter/assets/83812658/0bf4d9ac-96d1-4c8c-b1d0-2dffba9ecf95\"\u003e \u003cbr\u003e\n\n### Visual Selection\n\n In visual mode, the highlight is selected as a partial pattern from the selection and applied to other words.\n\n \u003cimg width=\"336\" alt=\"visual\" src=\"https://github.com/azabiong/vim-highlighter/assets/83812658/4c2c82a2-d5f1-4246-85f6-f77468db61e5\"\u003e \u003cbr\u003e\n\n You can also select an entire line and highlight it.\n\n \u003cimg width=\"336\" alt=\"visual_line\" src=\"https://github.com/azabiong/vim-highlighter/assets/83812658/222c3cf8-a44e-41ef-9474-2f96e1ce39f8\"\u003e \u003cbr\u003e\n\n### Input\n\n To set highlighting by entering a pattern:\n ```vim\n  :Hi + pattern\n ```\n \u003cbr\u003e\n\n## Jump to Highlight\n\n The plugin supports jumping to highlights using three sets of commands.\n\n **1. Pattern** \u0026nbsp; \u0026nbsp;\n The `Hi \u003c` and `Hi \u003e` commands move the cursor back and forth to highlights that\n matches the pattern at the cursor position or to the recently set highlight.\n\n **2. Position** \u0026nbsp;\n The `Hi {` and `Hi }` commands move the cursor to the nearest highlight,\n even if the pattern or type differs from the current selection.\n\n **3. Color** \u0026nbsp; \u0026nbsp; \u0026nbsp;\n The `Hi [` and `Hi ]` commands support moving to highlights of the same color with different patterns or types,\n which can be useful when grouping highlights by content.\n\n \u003cimg width=\"420\" alt=\"jump\" src=\"https://github.com/azabiong/vim-highlighter/assets/83812658/a4af37af-f4c1-4bdf-9cfa-04200026af22\"\u003e \u003cbr\u003e\n\n You can easily define key mappings for these commands. For example:\n\n ```vim\n   nn gj \u003cCmd\u003eHi\u003e\u003cCR\u003e\n   nn gk \u003cCmd\u003eHi\u003c\u003cCR\u003e\n ```\n \u003e Alternatively, you can map the \u003ckbd\u003en\u003c/kbd\u003e and \u003ckbd\u003eN\u003c/kbd\u003e keys to `HiSearch()` function, which automatically selects\n \u003e the search type between native search and jump commands. \u0026nbsp;→ \u0026nbsp;[Configuration](#configuration-examples)\n\n \u003cbr\u003e\n\n## One Time Highlight\n\n When you only need quick pattern matching at the cursor position without setting highlighting,\n **One Time Highlight** can be useful.\n\n When the cursor is over a word or visual selection that is not highlighted, pressing `HiErase` key sets **One Time Highlight**.\n The highlight remains on while the cursor is stationary, and automatically turns off after the cursor moves.\n\n \u003cimg width=\"455\" alt=\"onetime\" src=\"https://user-images.githubusercontent.com/83812658/169995537-61725353-15b9-4d33-bccc-d0c471c15306.gif\"\u003e \u003cbr\u003e\n\n **One Time Highlight** displays matches in all windows on the current tab-page, and\n **Jump** commands `Hi\u003c\u003e` and `Hi[]` are also supported.\n\n \u003cbr\u003e\n\n## Following Highlight\n\n When you need automatic matching based on cursor movement, **Following Highlight** mode may be useful.\n\n Pressing `HiSet` key over **One Time Highlight** without moving the cursor sets **Following Highlight** mode.\n The highlight follows the cursor. Pressing `HiEarase` key turns off the mode.\n\n \u003cimg width=\"493\" alt=\"following\" src=\"https://github.com/azabiong/vim-highlighter/assets/83812658/69dbc2ce-2bd9-4a3d-acac-e889cdffdd5e\"\u003e \u003cbr\u003e\n\n **Following Highlight** displays matches in all windows on the current tab-page, and\n **Jump** commands `Hi\u003c\u003e` and `Hi[]` are also supported.\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;cWORD \u0026nbsp;matching \u003c/b\u003e\u003c/summary\u003e \n\n Sometimes, when comparing patterns consisting of letters and symbols, Vim's **`\u003ccWORD\u003e`** matching option can be useful.\n\n \u003cimg width=\"422\" alt=\"cword\" src=\"https://user-images.githubusercontent.com/83812658/125083024-d6829b80-e102-11eb-8725-df0dc9e6915b.gif\"\u003e \u003cbr\u003e\n\n The following command toggles between the default **`\u003ccword\u003e`** and **`\u003ccWORD\u003e`** matching options:\n\n ```vim\n  :Hi \u003c\u003e\n ```\n \u003c/details\u003e\n \u003cbr\u003e\n\n## Positional Highlight\n\n Unlike **pattern-based** highlighting, **Positional Highlight** is set to a specific position in the buffer.\n Thanks to new APIs in Vim and Neovim, it's similar to coloring over text with a highlighter.\n The position is updated when inserting or deleting the line above.\n \n To set a **Positional Highlight** on a specific line, press the `HiSetSL` key in normal or visual mode.  \n Multiline highlighting is now automatically set to positional highlighting.\n\n \u003cimg width=400 alt=\"positional\" src=\"https://github.com/azabiong/vim-highlighter/assets/83812658/25ba37c8-43ce-4eaf-9d43-663108bfb54b\"\u003e \u003cbr\u003e\n\n **Jump** commands `Hi{}` and `Hi[]` are supported after setting.\n\n \u003cbr\u003e\n\n## Save \u0026 Load\n\n Sometimes when you want to save highlights of the current window and reload them next time, you can use:\n ```vim\n  :Hi save\n ```\n and when loading:\n ```vim\n  :Hi load\n ```\n You can name the file when saving, and use tab-completion when loading. For example:\n ```vim\n  :Hi save name\n  :Hi load \u003cTab\u003e\n ```\n Highlight files are stored in a user configurable `HiKeywords` directory.\n To browse and manage files in the directory, you can open **netrw** using the command:\n ```vim\n  :Hi ls\n ```\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp; relative path \u003c/b\u003e\u003c/summary\u003e\n \u003cbr\u003e\n\n You can also use relative paths. For example, to save and load a highlight file in the current directory:\n ```vim\n  :Hi save ./name\n  :Hi load ./\u003cTab\u003e\n ```\n \u003c/details\u003e\n \u003cbr\u003e\n\n## Sync Mode\n\n The plugin supports three highlight sync mode commands.\n \u003cbr\u003e\n\n For each single window highlighting mode:\n ```vim\n  :Hi =\n ```\n\n To synchronize window highlighting on each tab-page:\n ```vim\n  :Hi ==\n ```\n\n When synchronizing window highlighting across all tab-pages:\n ```vim\n  :Hi ===\n ```\n \u003cbr\u003e\n\n\u003e The initial mode can be set using the `HiSyncMode` configuration variable.\n\n \u003cbr\u003e\n\n## Find in Files\n\n If you have installed hi-performance search tools such as **ag**, **rg**, **ack**, **sift**, or **grep**,\n the plugin can run it when looking for patterns based on the current directory. And when the given expression is simple,\n the plugin can highlight patterns to make them easier to find.\n\n `HiFind` key brings up the **Find** command prompt.\n\n \u003cimg width=\"760\" alt=\"find\" src=\"https://user-images.githubusercontent.com/83812658/153761451-1828bbdb-b0ac-4598-a624-b69b94369333.gif\"\u003e \u003cbr\u003e\n\n### Search tool\n\n If one of the tools listed above is in the $PATH, the plugin can run it using default options.\n You can also set your preferred search tool and options in the `HiFindTool` variable. For example:\n\n ```vim\n   let HiFindTool = 'grep -H -EnrI --exclude-dir=.git'\n ```\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Tools\u003c/b\u003e\u003c/summary\u003e\n\n ```vim\n   let HiFindTool = 'ag --nocolor --noheading --column --nobreak'\n\n   let HiFindTool = 'rg -H --color=never --no-heading --column --smart-case'\n\n   let HiFindTool = 'ack -H --nocolor --noheading --column --smart-case'\n\n   let HiFindTool = 'sift --no-color --line-number --column --binary-skip --git --smart-case'\n\n   let HiFindTool = 'ggrep -H -EnrI --exclude-dir=.git'\n\n   let HiFindTool = 'git grep -EnI --no-color --column'\n ```\n \u003c/details\u003e\n\n### Input\n\n You can use general order of passing arguments to search tools:\n\n ```\n  :Hi/Find  [options]  expression  [directories_or_files]\n ```\n\n `Tab` key completion for --long-options, directory and file names is supported.\n\n### Expression\n\n Among various regular expression options in **Vim**, the plugin uses \"very magic\" style syntax\n which uses the standard regex syntax with fewer escape sequences.\n\n#### Examples\n\n\u003e Searching for \"red\" or \"blue\":\n\u003e ```\n\u003e  :Hi/Find  red|blue\n\u003e ```\n\u003e Pattern with spaces:\n\u003e ```\n\u003e  :Hi/Find  \"pattern with spaces\"\n\u003e ```\n\u003e Class types or variables that start with an uppercase letter A or S: \u0026nbsp; Array, Set, String, Symbol...\n\u003e ```\n\u003e  :Hi/Find  \\b[AS]\\w+\n\u003e ```\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp; Fixed string or Literal option \u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u003cbr\u003e\n\u003e\n\u003e This option treats the input as a literal string, which is useful when searching for codes with symbols.\n\u003e ```\n\u003e   ag,  rg,  grep,  git   -F --fixed-strings\n\u003e   ack, sift              -Q --literal\n\u003e ```\n\u003e Example: \u0026nbsp; searching for `item[i+1].size() * 2`\n\u003e ```\n\u003e  :Hi/Find  -F  'item[i+1].size() * 2'\n\u003e ```\n \u003c/details\u003e\n\n### Visual selection\n\n When searching for parts of a string in a file as is, visual selection would be useful.  \n After selecting the part, press `HiFind` key. The plugin will escape the pattern properly.\n\n### Find window\n\n  The following keys and functions are available in the **Find** window.\n\n  |key|function|\n  |:--:|--|\n  |\u003ckbd\u003er\u003c/kbd\u003e                | Resize / Rotate |\n  |\u003ckbd\u003ei\u003c/kbd\u003e                | View |\n  |\u003ckbd\u003es\u003c/kbd\u003e                | Split and View |\n  |\u003ckbd\u003eEnter\u003c/kbd\u003e            | Jump to position |\n  |\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e| Stop searching |\n\n### Navigation\n\n  Additional commands are supported to quickly navigate through search results.\n\n `Hi/next` and `Hi/previous` commands jump directly to the location of the file.\n\n `Hi/older` and `Hi/newer` commands navigate the search history.\n\n It would be convenient to define key mappings for these commands for easy navigation. For example:\n ```vim\n   nn -        \u003cCmd\u003eHi/next\u003cCR\u003e\n   nn _        \u003cCmd\u003eHi/previous\u003cCR\u003e\n   nn f\u003cLeft\u003e  \u003cCmd\u003eHi/older\u003cCR\u003e\n   nn f\u003cRight\u003e \u003cCmd\u003eHi/newer\u003cCR\u003e\n ```\n\n#### 🍏 \u0026nbsp;Tip\n\n\u003e Pressing the number `1` before the `Hi/next` command invokes a special function that jumps to the first item\nin the search results. For example, in the mapping above, entering `1` `-` will jump to the first item.\n\n \u003cbr\u003e\n\n## Customizing Colors\n\n  The plugin provides two default color sets which are automatically loaded based on the current `background` mode.\n  \u003cdiv style=\"display:inline-block\"\u003e\n  \u003cimg width=\"198\" alt=\"default_light\" src=\"https://user-images.githubusercontent.com/83812658/153830890-51960a1b-4a61-4bc6-9c8f-c693a0ee5825.png\"\u003e\n  \u003cimg width=\"198\" alt=\"default_dark\" src=\"https://user-images.githubusercontent.com/83812658/153829910-58e948e4-6657-4b55-8b39-39575e26e858.png\"\u003e\n  \u003c/div\u003e\u003cbr\u003e\n\n  You can use the **`:hi`** command to add, change, rearrange colors, and save them to the configuration file or color scheme.\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Example 1 \u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u003cbr\u003e\n\u003e\n\u003e This example adds two custom colors\n\u003e \u003cspan style=\"inline\"\u003e\n\u003e \u003cimg alt=\"example\" height=18 style=\"vertical-align:middle\" src=\"https://user-images.githubusercontent.com/83812658/117539479-cc321b80-b045-11eb-82f6-f9cdf046a69d.png\"\u003e\n\u003e \u003c/span\u003e\n\u003e in 256 or 24-bit colors mode.\n\u003e\n\u003e If the plugin is installed and working, copy the following lines one by one, and then run it in the Vim's command window.\n\u003e ```vim\n\u003e  :hi HiColor21 ctermfg=20  ctermbg=159 guifg=#0000df guibg=#afffff\n\u003e  :hi HiColor22 ctermfg=228 ctermbg=129 guifg=#ffff87 guibg=#af00ff\n\u003e ```\n\u003e Now, move the cursor to any word, and then input the number `21` and `HiSet` key.\n\u003e Does it work? if you press `HiSet` key again, the next `HiColor22` will be set.\n\u003e You can try different values while seeing the results immediately.\n\n \u003cbr\u003e\n \u003c/details\u003e\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Example 2 \u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u003cbr\u003e\n\u003e\n\u003e The following command changes the color of **Find in Files Highlight**\n\u003e ```vim\n\u003e  :hi HiFind ctermfg=52 ctermbg=182 guifg=#570707 guibg=#e7bfe7\n\u003e ```\n \u003c/details\u003e\n \u003cbr\u003e\n\nMultiline highlight color numbers start at 80, `HiColor80`.\n\n \u003cbr\u003e\n\n## Configuration Examples\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Summary \u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u003cbr\u003e\n\u003e \u003cdetails open\u003e\n\u003e \u003csummary\u003e\u003cb\u003e\u0026nbsp; .vim \u003c/b\u003e\u003c/summary\u003e\n\u003e\n\u003e ```vim\n\u003e \" Unicode\n\u003e \" set encoding=utf-8\n\u003e\n\u003e \" default key mappings\n\u003e \" let HiSet   = 'f\u003cCR\u003e'\n\u003e \" let HiErase = 'f\u003cBS\u003e'\n\u003e \" let HiClear = 'f\u003cC-L\u003e'\n\u003e \" let HiFind  = 'f\u003cTab\u003e'\n\u003e \" let HiSetSL = 't\u003cCR\u003e'\n\u003e\n\u003e \" jump key mappings\n\u003e nn gj    \u003cCmd\u003eHi\u003e\u003cCR\u003e\n\u003e nn gk    \u003cCmd\u003eHi\u003c\u003cCR\u003e\n\u003e nn gl    \u003cCmd\u003eHi}\u003cCR\u003e\n\u003e nn gh    \u003cCmd\u003eHi{\u003cCR\u003e\n\u003e nn g\u003cCR\u003e \u003cCmd\u003eHi]\u003cCR\u003e\n\u003e nn g\u003cBS\u003e \u003cCmd\u003eHi[\u003cCR\u003e\n\u003e\n\u003e \" find key mappings\n\u003e nn -        \u003cCmd\u003eHi/next\u003cCR\u003e\n\u003e nn _        \u003cCmd\u003eHi/previous\u003cCR\u003e\n\u003e nn f\u003cLeft\u003e  \u003cCmd\u003eHi/older\u003cCR\u003e\n\u003e nn f\u003cRight\u003e \u003cCmd\u003eHi/newer\u003cCR\u003e\n\u003e\n\u003e \" sync mode\n\u003e \" let HiSyncMode = 1\n\u003e\n\u003e \" command abbreviations\n\u003e ca HL Hi:load\n\u003e ca HS Hi:save\n\u003e\n\u003e \" directory to store highlight files\n\u003e \" let HiKeywords = '~/.config/keywords'\n\u003e\n\u003e \" additional highlight colors\n\u003e \" hi HiColor21 ctermfg=52  ctermbg=181 guifg=#8f5f5f guibg=#d7cfbf cterm=bold gui=bold\n\u003e \" hi HiColor22 ctermfg=254 ctermbg=246 guifg=#e7efef guibg=#979797 cterm=bold gui=bold\n\u003e ```\n\u003e \u003cbr\u003e\n\u003e \u003c/details\u003e\n\u003e\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\u003cb\u003e\u0026nbsp; .lua \u003c/b\u003e\u003c/summary\u003e\n\u003e\n\u003e ```lua\n\u003e vim.cmd([[\n\u003e   \" default key mappings\n\u003e   \" let HiSet   = 'f\u003cCR\u003e'\n\u003e   \" let HiErase = 'f\u003cBS\u003e'\n\u003e   \" let HiClear = 'f\u003cC-L\u003e'\n\u003e   \" let HiFind  = 'f\u003cTab\u003e'\n\u003e   \" let HiSetSL = 't\u003cCR\u003e'\n\u003e\n\u003e   \" jump key mappings\n\u003e   nn gj    \u003cCmd\u003eHi\u003e\u003cCR\u003e\n\u003e   nn gk    \u003cCmd\u003eHi\u003c\u003cCR\u003e\n\u003e   nn gl    \u003cCmd\u003eHi}\u003cCR\u003e\n\u003e   nn gh    \u003cCmd\u003eHi{\u003cCR\u003e\n\u003e   nn g\u003cCR\u003e \u003cCmd\u003eHi]\u003cCR\u003e\n\u003e   nn g\u003cBS\u003e \u003cCmd\u003eHi[\u003cCR\u003e\n\u003e\n\u003e   \" find key mappings\n\u003e   nn -        \u003cCmd\u003eHi/next\u003cCR\u003e\n\u003e   nn _        \u003cCmd\u003eHi/previous\u003cCR\u003e\n\u003e   nn f\u003cLeft\u003e  \u003cCmd\u003eHi/older\u003cCR\u003e\n\u003e   nn f\u003cRight\u003e \u003cCmd\u003eHi/newer\u003cCR\u003e\n\u003e\n\u003e   \" sync mode\n\u003e   \" let HiSyncMode = 1\n\u003e\n\u003e   \" directory to store highlight files\n\u003e   \" let HiKeywords = '~/.config/keywords'\n\u003e\n\u003e   \" additional highlight colors\n\u003e   \" hi HiColor21 ctermfg=52  ctermbg=181 guifg=#8f5f5f guibg=#d7cfbf cterm=bold gui=bold\n\u003e   \" hi HiColor22 ctermfg=254 ctermbg=246 guifg=#e7efef guibg=#979797 cterm=bold gui=bold\n\u003e ]])\n\u003e ```\n\u003e \u003c/details\u003e\n\n \u003cbr\u003e\n \u003c/details\u003e\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Color scheme\u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u0026nbsp;  \n\u003e Highlight colors can also be included in a unified color scheme theme or saved as a separate file\n\u003e in your **colors** directory. `~/.vim/colors` \u0026nbsp;or\u0026nbsp; `~/vimfiles/colors`  \n\u003e \u0026nbsp;  \n\u003e For example, you can create a '**sample.vim**' file in the **colors** directory, and store some colors:\n\u003e ```vim\n\u003e hi HiColor21 ctermfg=52  ctermbg=181 guifg=#8f5f5f guibg=#d7cfbf cterm=bold gui=bold\n\u003e hi HiColor22 ctermfg=254 ctermbg=246 guifg=#e7efef guibg=#979797 cterm=bold gui=bold\n\u003e ```\n\u003e\n\u003e You can now load colors using the **`colorscheme`** command:\n\u003e ```vim\n\u003e :colorscheme sample\n\u003e ```\n\n \u003cbr\u003e\n \u003c/details\u003e\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Multifunction keys for Find\u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u0026nbsp;  \n\u003e The plugin's `HiFind()` function returns whether the **Find** window is visible.\n\u003e The idea is to define different actions for the keys depending on whether the **Find** window is displayed or not.\n\u003e\n\u003e The following example defines the `-` `_` and `f-` keys to execute the **Hi** command while\n\u003e the **Find** window is visible, otherwise execute the original function.\n\u003e\n\u003e \u003cdetails open\u003e\n\u003e \u003csummary\u003e\u003cb\u003e\u0026nbsp; .vim \u003c/b\u003e\u003c/summary\u003e\n\u003e\n\u003e ```vim\n\u003e \" find key mappings\n\u003e nn -  \u003cCmd\u003ecall \u003cSID\u003eHiOptional('next', '-')\u003cCR\u003e\n\u003e nn _  \u003cCmd\u003ecall \u003cSID\u003eHiOptional('previous', '_')\u003cCR\u003e\n\u003e nn f- \u003cCmd\u003ecall \u003cSID\u003eHiOptional('close', 'f-')\u003cCR\u003e\n\u003e\n\u003e function s:HiOptional(cmd, key)\n\u003e   if HiFind()\n\u003e     exe \"Hi\" a:cmd\n\u003e   else\n\u003e     exe \"normal!\" a:key\n\u003e   endif\n\u003e endfunction\n\u003e ```\n\u003e \u003cbr\u003e\n\u003e \u003c/details\u003e\n\u003e\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\u003cb\u003e\u0026nbsp; .lua \u003c/b\u003e\u003c/summary\u003e\n\u003e\n\u003e ```lua\n\u003e -- find key mappings\n\u003e vim.cmd([[\n\u003e   nn -  \u003cCmd\u003ecall v:lua.hi_optional('next', '-')\u003cCR\u003e\n\u003e   nn _  \u003cCmd\u003ecall v:lua.hi_optional('previous', '_')\u003cCR\u003e\n\u003e   nn f- \u003cCmd\u003ecall v:lua.hi_optional('close', 'f-')\u003cCR\u003e\n\u003e ]])\n\u003e\n\u003e function _G.hi_optional(cmd, key)\n\u003e   if vim.fn.HiFind() == 1 then\n\u003e     vim.cmd('Hi '.. cmd)\n\u003e   else\n\u003e     vim.cmd('normal! '.. key)\n\u003e   end\n\u003e end\n\u003e ```\n\u003e\n\u003e \u003c/details\u003e\n\n \u003cbr\u003e\n \u003c/details\u003e\n\n \u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003e\u0026nbsp;Jump to Highlight with \u003ckbd\u003en\u003c/kbd\u003e and \u003ckbd\u003eN\u003c/kbd\u003e keys\u003c/b\u003e\u003c/summary\u003e\n\n\u003e \u0026nbsp;  \n\u003e You can also define \u003ckbd\u003en\u003c/kbd\u003e and \u003ckbd\u003eN\u003c/kbd\u003e keys for both the native search and the plugin's jump commands.\n\u003e\n\u003e \u003cdetails open\u003e\n\u003e \u003csummary\u003e\u003cb\u003e\u0026nbsp; .vim \u003c/b\u003e\u003c/summary\u003e\n\u003e\n\u003e ```vim\n\u003e \" jump key mappings\n\u003e nn n \u003cCmd\u003ecall HiSearch('n')\u003cCR\u003e\n\u003e nn N \u003cCmd\u003ecall HiSearch('N')\u003cCR\u003e\n\u003e ```\n\u003e While `hlsearch` is displayed, the function executes the native search command assigned to each key,\n\u003e otherwise, it executes the `Hi\u003e` or `Hi\u003c` command. When switching from native search to jump mode, \n\u003e you can simply turn off `hlsearch` using the **`:noh`** command. For example:\n\u003e ```vim\n\u003e nn \u003cEsc\u003en \u003cCmd\u003enoh\u003cCR\u003e\n\u003e ```\n\u003e \u003cbr\u003e\n\u003e \u003c/details\u003e\n\u003e\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\u003cb\u003e\u0026nbsp; .lua \u003c/b\u003e\u003c/summary\u003e\n\u003e\n\u003e ```lua\n\u003e vim.cmd([[\n\u003e   \" jump key mappings\n\u003e   nn n \u003cCmd\u003ecall HiSearch('n')\u003cCR\u003e\n\u003e   nn N \u003cCmd\u003ecall HiSearch('N')\u003cCR\u003e\n\u003e\n\u003e   \" :noh commmand mapping, if there isn't\n\u003e   nn \u003cEsc\u003en \u003cCmd\u003enoh\u003cCR\u003e\n\u003e ]])\n\u003e ```\n\u003e \u003c/details\u003e\n\n \u003c/details\u003e\n \u003cbr\u003e\n\n## Help tags\n\n For more information about commands, configurable options, and functions, please see:\n\n ```vim\n :h Hi\n ```\n ```vim\n :h Hi-Options\n ```\n ```vim\n :h Hi-Functions\n ```\n \u003cbr\u003e\n\n## Issues\n\n If you have any issues that need fixing, comments or new features you would like to add, please feel free to open an issue.\n\n \u003cbr\u003e\n\n## License\n MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazabiong%2Fvim-highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazabiong%2Fvim-highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazabiong%2Fvim-highlighter/lists"}