Highlight the chars and words searched by f
and F
.
fFHighlight-demo.mp4
- Highlight the chars searched by
f
andF
- Highlight the words including the searched chars
- Overlap the chars as numbers to jump faster
- Neovim 0.6.1
Install nvim-fFHighlight with Packer.nvim:
use {'kevinhwang91/nvim-fFHighlight'}
require('fFHighlight').setup()
After using Minimal configuration:
The built-in f
and F
have been improved, enjoy!
{
disable_keymap = {
description = [[Disable keymaps, users should map them manually]],
default = false
},
disable_words_hl = {
description = [[Disable the feature of highlighting words]],
default = false
},
number_hint_threshold = {
description = [[If the count of repeating latest `f` or `F` to the char is equal or greater
than this value, use number to overlap char. minimal value is 2]],
default = 3
},
prompt_sign_define = {
description = [[The optional dict argument for sign_define(), `:h sign_define()` for
more details. If this value is `{}`, will disable sign for prompt]],
default = {text = '->', text_hl = 'fFPromptSign', culhl = 'fFPromptSign'}
}
}
hi default fFHintChar ctermfg=yellow cterm=bold guifg=yellow gui=bold
hi default fFHintNumber ctermfg=yellow cterm=bold guifg=yellow gui=bold
hi default fFHintWords cterm=underline gui=underline
hi default link fFHintCurrentWord fFHintWords
hi default fFPromptSign ctermfg=yellow cterm=bold guifg=yellow gui=bold
- fFHintChar: highlight the hint of chars
- fFHintNumber: highlight the hint of number
- fFHintWords: highlight the hint of words
- fFHintCurrentWord: highlight the hint of current word
- fFPromptSign: highlight the prompt sign before searching a char
-- All API under this module
local m = require('fFHighlight')
--- Find the character to be typed on the current line
---@param backward? boolean the direction of finding character. true is backward, otherwise is forward
m.findChar(backward)
use {
'kevinhwang91/nvim-fFHighlight',
config = function()
vim.cmd([[
hi fFHintChar ctermfg=yellow cterm=bold,undercurl guifg=yellow gui=bold,undercurl
hi fFHintWords cterm=undercurl gui=undercurl guisp=yellow
hi fFPromptSign ctermfg=yellow cterm=bold guifg=yellow gui=bold
]])
require('fFHighlight').setup({
disable_keymap = false,
disable_words_hl = false,
number_hint_threshold = 3,
prompt_sign_define = {text = '✹'}
})
end,
keys = {{'n', 'f'}, {'x', 'f'}, {'n', 'F'}, {'x', 'F'}}
}
- If you get an issue or come up with an awesome idea, don't hesitate to open an issue in github.
- If you think this plugin is useful or cool, consider rewarding it a star.
The project is licensed under a BSD-3-clause license. See LICENSE file for details.