Move faster with unique f
/F
indicators for each word on the line. Like quick-scope, but in Lua.
eyeliner-demo.mov
The orange letters indicate the unique letter in the word that you can jump to with f
/F
right away.
Blue letters indicate that there is no unique letter in the word, but you can get to it with f
/F
and then a repeat with ;
.
Requirement: Neovim >= 0.7.0
Using vim-plug:
Plug 'jinh0/eyeliner.nvim'
Using packer.nvim:
use 'jinh0/eyeliner.nvim'
Default values (in packer.nvim):
use {
'jinh0/eyeliner.nvim',
config = function()
require'eyeliner'.setup {
highlight_on_key = true, -- show highlights only after keypress
dim = false -- dim all other characters if set to true (recommended!)
}
end
}
If you prefer to have eyeliner's highlights shown only after you press f
/F
/t
/T
, set highlight_on_key
to true
in the setup function.
In Lua:
use {
'jinh0/eyeliner.nvim',
config = function()
require'eyeliner'.setup {
highlight_on_key = true
}
end
}
Demo
eyeliner-demo-keypress.mov
When using highlight_on_key
, you may want to dim the rest of the characters since they are unimportant. You can do this with the dim
option:
require'eyeliner'.setup {
highlight_on_key = true, -- this must be set to true for dimming to work!
dim = true,
}
dim-demo.mov
You can customize the highlight colors and styles with the EyelinerPrimary
and EyelinerSecondary
highlight groups.
For instance, if you wanted to make eyeliner.nvim more subtle by only using bold and underline, with no color,
In Vimscript:
highlight EyelinerPrimary gui=underline,bold
highlight EyelinerSecondary gui=underline
In Lua:
vim.api.nvim_set_hl(0, 'EyelinerPrimary', { bold = true, underline = true })
vim.api.nvim_set_hl(0, 'EyelinerSecondary', { underline = true })
If you want to set a custom color:
In Vimscript:
highlight EyelinerPrimary guifg=#000000 gui=underline,bold
highlight EyelinerSecondary guifg=#ffffff gui=underline
In Lua:
vim.api.nvim_set_hl(0, 'EyelinerPrimary', { fg='#000000', bold = true, underline = true })
vim.api.nvim_set_hl(0, 'EyelinerSecondary', { fg='#ffffff', underline = true })
In Vimscript:
autocmd ColorScheme * :highlight EyelinerPrimary ...
In Lua:
vim.api.nvim_create_autocmd('ColorScheme', {
pattern = '*',
callback = function()
vim.api.nvim_set_hl(0, 'EyelinerPrimary', { bold = true, underline = true })
end,
})
Enable/disable/toggle:
:EyelinerEnable
:EyelinerDisable
:EyelinerToggle