-
Notifications
You must be signed in to change notification settings - Fork 0
/
mappings.lua
42 lines (40 loc) · 1.67 KB
/
mappings.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local M = {}
M.general = {
n = {
["<C-h>"] = { "<cmd> TmuxNavigateLeft<CR>", "window left" },
["<C-l>"] = { "<cmd> TmuxNavigateRight<CR>", "window right" },
["<C-j>"] = { "<cmd> TmuxNavigateDown<CR>", "window down" },
["<C-k>"] = { "<cmd> TmuxNavigateUp<CR>", "window up" },
["<C-d>"] = { "<C-d>zz", "scroll half page down and center" },
["<C-u>"] = { "<C-u>zz", "scroll half page up and center" },
["<n>"] = { "nzzzv", "search next and center" },
["<N>"] = { "Nzzzv", "search previous and center" },
["<leader>ca"] = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "code action" },
["zR"] = { function() require('ufo').openAllFolds() end, "open all folds" },
["zM"] = { function() require('ufo').closeAllFolds() end, "close all folds" },
["K"] = {
function()
local winid = require('ufo').peekFoldedLinesUnderCursor()
if not winid then
vim.lsp.buf.hover()
end
end,
"hover"
},
["H"] = { "^", "move to first non-blank character" },
["L"] = { "$", "move to end of line" },
},
v = {
["J"] = { ":m '>+1<CR>gv=gv", "move line down" },
["K"] = { ":m '<-2<CR>gv=gv", "move line up" },
["H"] = { "^", "move to first non-blank character" },
["L"] = { "$", "move to end of line" },
},
t = {
["<C-h>"] = { "<C-\\><C-N><C-w>h", "window left" },
["<C-l>"] = { "<C-\\><C-N><C-w>l", "window right" },
["<C-j>"] = { "<C-\\><C-N><C-w>j", "window down" },
["<C-k>"] = { "<C-\\><C-N><C-w>k", "window up" },
}
}
return M