add keymap of Hop for nvim(non-vscode mode)
This commit is contained in:
@@ -99,4 +99,29 @@ else
|
|||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = true },
|
checker = { enabled = true },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local hop = require('hop')
|
||||||
|
local directions = require('hop.hint').HintDirection
|
||||||
|
vim.keymap.set('n', '<leader>f', function()
|
||||||
|
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
||||||
|
end, {remap=true})
|
||||||
|
vim.keymap.set('n', '<leader>F', function()
|
||||||
|
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
||||||
|
end, {remap=true})
|
||||||
|
vim.keymap.set('n', '<leader>t', function()
|
||||||
|
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
|
||||||
|
end, {remap=true})
|
||||||
|
vim.keymap.set('n', '<leader>T', function()
|
||||||
|
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
|
||||||
|
end, {remap=true})
|
||||||
|
vim.keymap.set('n', '<leader>s', function()
|
||||||
|
hop.hint_char1()
|
||||||
|
end, {remap=true})
|
||||||
|
vim.keymap.set('n', '<leader>S', function()
|
||||||
|
hop.hint_char2()
|
||||||
|
end, {remap=true})
|
||||||
|
vim.keymap.set('n', '<leader>sw', function()
|
||||||
|
hop.hint_words()
|
||||||
|
end, {remap=true})
|
||||||
|
|
||||||
end
|
end
|
||||||
|
9
lua/plugins/hop.lua
Normal file
9
lua/plugins/hop.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return{
|
||||||
|
{
|
||||||
|
'smoka7/hop.nvim',
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
keys = 'etovxqpdygfblzhckisuran'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user