• Stars
    star
    361
  • Rank 115,186 (Top 3 %)
  • Language
    Lua
  • Created almost 2 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

👀 Move faster with unique f/F indicators.

👀 eyeliner.nvim

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 ;.

📦 Installation

Requirement: Neovim >= 0.7.0

Using vim-plug:

Plug 'jinh0/eyeliner.nvim'

Using packer.nvim:

use 'jinh0/eyeliner.nvim'

⚙️ Configuration

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
}

✨ Show highlights only after keypress

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

Highlight + Dim

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

🖌 Customize highlight colors

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 })

Update highlights when the colorscheme is changed

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,
})

Commands

Enable/disable/toggle:

:EyelinerEnable
:EyelinerDisable
:EyelinerToggle