Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lua/illuminate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,23 @@ end

function M.configure(config)
require('illuminate.config').set(config)

if not require('illuminate.config').disable_keymaps() then
if not require('illuminate.util').has_keymap('n', '<a-n>') then
vim.keymap.set('n', '<a-n>', require('illuminate').goto_next_reference,
{ desc = "Move to next reference" })
end
if not require('illuminate.util').has_keymap('n', '<a-p>') then
vim.keymap.set('n', '<a-p>', require('illuminate').goto_prev_reference,
{ desc = "Move to previous reference" })
end
if not require('illuminate.util').has_keymap('o', '<a-i>') then
vim.keymap.set('o', '<a-i>', require('illuminate').textobj_select)
end
if not require('illuminate.util').has_keymap('x', '<a-i>') then
vim.keymap.set('x', '<a-i>', require('illuminate').textobj_select)
end
end
end

function M.pause()
Expand Down
15 changes: 0 additions & 15 deletions plugin/illuminate.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ lua << EOF
vim.api.nvim_create_user_command('IlluminateResumeBuf', require('illuminate').resume_buf, { bang = true })
vim.api.nvim_create_user_command('IlluminateToggleBuf', require('illuminate').toggle_buf, { bang = true })
vim.api.nvim_create_user_command('IlluminateDebug', require('illuminate').debug, { bang = true })

if not require('illuminate.config').disable_keymaps() then
if not require('illuminate.util').has_keymap('n', '<a-n>') then
vim.keymap.set('n', '<a-n>', require('illuminate').goto_next_reference, { desc = "Move to next reference" })
end
if not require('illuminate.util').has_keymap('n', '<a-p>') then
vim.keymap.set('n', '<a-p>', require('illuminate').goto_prev_reference, { desc = "Move to previous reference" })
end
if not require('illuminate.util').has_keymap('o', '<a-i>') then
vim.keymap.set('o', '<a-i>', require('illuminate').textobj_select)
end
if not require('illuminate.util').has_keymap('x', '<a-i>') then
vim.keymap.set('x', '<a-i>', require('illuminate').textobj_select)
end
end
EOF

lua require('illuminate').set_highlight_defaults()
Expand Down