Skip to content

Commit

Permalink
ref(plugins): optimize key mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
liubang committed Jan 16, 2023
1 parent 9d7f94e commit cd64fc6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
1 change: 1 addition & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"mini.cursorword": { "branch": "main", "commit": "21af5679b39cf1a6bc6bf4eeaabc35e1b5ee7110" },
"mini.surround": { "branch": "main", "commit": "aeeb1c4ce4d1c66211bdc74b131c11b8fcbae65e" },
"neodev.nvim": { "branch": "main", "commit": "0e3f5e763639951f96f9acbdc9f52a9fedf91b46" },
"neogen": { "branch": "main", "commit": "0958aeffcddf46e57785c3026be934816b4f39d2" },
"null-ls.nvim": { "branch": "main", "commit": "915558963709ea17c5aa246ca1c9786bfee6ddb4" },
"nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" },
"nvim-cmp": { "branch": "main", "commit": "11a95792a5be0f5a40bab5fc5b670e5b1399a939" },
Expand Down
24 changes: 0 additions & 24 deletions lua/lb/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,6 @@ vim.keymap.set('n', '<Leader>8', '<cmd>BufferLineGoToBuffer 8<CR>')
vim.keymap.set('n', '<Leader>9', '<cmd>BufferLineGoToBuffer 9<CR>')
-- }}}

-- hop {{{
vim.keymap.set('n', '<Leader>kk', function() require('hop').hint_lines() end)
vim.keymap.set('n', '<Leader>jj', function() require('hop').hint_lines() end)
vim.keymap.set('n', '<Leader>ss', function() require('hop').hint_patterns() end)
vim.keymap.set(
'n',
'<Leader>ll',
function()
require('hop').hint_words {
direction = require('hop.hint').HintDirection.AFTER_CURSOR,
current_line_only = true,
}
end
)
vim.keymap.set('n', '<Leader>hh',
function()
require('hop').hint_words {
direction = require('hop.hint').HintDirection.BEFORE_CURSOR,
current_line_only = true,
}
end
)
-- }}}

-- git {{{
vim.keymap.set('n', '<Leader>hb', function() require('gitsigns').blame_line {full = true} end)
vim.keymap.set('n', '<Leader>hd', function() require('gitsigns').diffthis() end)
Expand Down
1 change: 0 additions & 1 deletion lua/plugins/accelerated-jk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
--=====================================================================
return {
"rainbowhxch/accelerated-jk.nvim",
-- enabled = false,
keys = {
{ "j", "<Plug>(accelerated_jk_gj)", mode = { "n" } },
{ "k", "<Plug>(accelerated_jk_gk)", mode = { "n" } },
Expand Down
31 changes: 30 additions & 1 deletion lua/plugins/hop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,40 @@
-- Last Modified: 2022/12/30 22:18
--
--=====================================================================

-- stylua: ignore start

return {
"phaazon/hop.nvim",
branch = "v2",
event = { "BufReadPost" },
config = true,
keys = {
{ "<Leader>kk", function() require("hop").hint_lines() end, mode = { "n" } },
{ "<Leader>jj", function() require("hop").hint_lines() end, mode = { "n" } },
{ "<Leader>ss", function() require("hop").hint_patterns() end, mode = { "n" } },
{
"<Leader>ll",
function()
require("hop").hint_words {
direction = require('hop.hint').HintDirection.AFTER_CURSOR,
current_line_only = true,
}
end,
mode = { "n" }
},
{
"<Leader>hh",
function()
require("hop").hint_words {
direction = require('hop.hint').HintDirection.BEFORE_CURSOR,
current_line_only = true,
}
end,
mode = { "n" }
},
},
}

-- stylua: ignore end

-- vim: fdm=marker fdl=0

0 comments on commit cd64fc6

Please sign in to comment.