Move key-bonding of Hop into hop.lua
This commit is contained in:
@@ -63,30 +63,6 @@ if vim.g.vscode then
|
|||||||
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})
|
|
||||||
|
|
||||||
else
|
else
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
@@ -100,28 +76,4 @@ else
|
|||||||
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
|
||||||
|
@@ -1,9 +1,60 @@
|
|||||||
return{
|
return{
|
||||||
{
|
{
|
||||||
'smoka7/hop.nvim',
|
'smoka7/hop.nvim',
|
||||||
version = "*",
|
version = "*",
|
||||||
opts = {
|
opts = {
|
||||||
keys = 'etovxqpdygfblzhckisuran'
|
keys = 'etovxqpdygfblzhckisuran'
|
||||||
}
|
},
|
||||||
}
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>f',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true })
|
||||||
|
end,
|
||||||
|
desc = 'Hop forward',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>F',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true })
|
||||||
|
end,
|
||||||
|
desc = 'Hop backward',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>t',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
|
||||||
|
end,
|
||||||
|
desc = 'Hop forward (offset)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>T',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
|
||||||
|
end,
|
||||||
|
desc = 'Hop backward (offset)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>s',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1()
|
||||||
|
end,
|
||||||
|
desc = 'Hop anywhere',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>S',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char2()
|
||||||
|
end,
|
||||||
|
desc = 'Hop anywhere (2 chars)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>sw',
|
||||||
|
function()
|
||||||
|
require('hop').hint_words()
|
||||||
|
end,
|
||||||
|
desc = 'Hop words',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,60 @@
|
|||||||
return{
|
return{
|
||||||
{
|
{
|
||||||
'smoka7/hop.nvim',
|
'smoka7/hop.nvim',
|
||||||
version = "*",
|
version = "*",
|
||||||
opts = {
|
opts = {
|
||||||
keys = 'etovxqpdygfblzhckisuran'
|
keys = 'etovxqpdygfblzhckisuran'
|
||||||
}
|
},
|
||||||
}
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>f',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true })
|
||||||
|
end,
|
||||||
|
desc = 'Hop forward',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>F',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true })
|
||||||
|
end,
|
||||||
|
desc = 'Hop backward',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>t',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
|
||||||
|
end,
|
||||||
|
desc = 'Hop forward (offset)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>T',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
|
||||||
|
end,
|
||||||
|
desc = 'Hop backward (offset)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>s',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char1()
|
||||||
|
end,
|
||||||
|
desc = 'Hop anywhere',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>S',
|
||||||
|
function()
|
||||||
|
require('hop').hint_char2()
|
||||||
|
end,
|
||||||
|
desc = 'Hop anywhere (2 chars)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>sw',
|
||||||
|
function()
|
||||||
|
require('hop').hint_words()
|
||||||
|
end,
|
||||||
|
desc = 'Hop words',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user