Skip to content

Quickly go to words with vim f command (VSCode extension)

Notifications You must be signed in to change notification settings

magdyamr542/vim-find-highlight

Repository files navigation

Vim Find Highlight

showcase

What does it do?

  • For people who use vim with vscode. the find command is pretty useful to go quickly to a specific word by typing f [some character in the word] in normal mode.

  • this becomes a problem when there are multiple words in the line that contain the same characters that you use with the find command.

    • <cursorPos> const name = "tsr" Note that you can only reach the string "tsr" with one jump by using the command f r.
  • The main goal of the extension is to highlight a character in every word such that when using this character with the find command, you reach the word with as minimal jumps as possible.

  • This isn't always possible if the line contains repeated words. the extension can be configured to color the character with another color to indicate that the word cannot be reached with only one jump

    • Example of such case: <cursorPos> test test
    • In this case the extension would highlight the character that enables you to go to the second test as quickly as possible. Here the character e will be highlighted (you need 2 jumps) instead of t (you need 3 jumps).

Configuration

  • The configuration is simple

  • Go to settings.json and set the following

    1. "vimFindHighlight.charPrimaryColor": "green" // the color that will be used if the word can be reached with one jump

    2. "vimFindHighlight.charSecondaryColor": "red" // the color that will be used if the word can not be reached with one jump

    3. "vimFindHighlight.charFontWeight": "600" // font weight of the highlighted character

    4. "vimFindHighlight.enableUnderline": true // underline the highlighted characters

Links

Releases

No releases published

Packages

No packages published