-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmappings.lua
More file actions
101 lines (99 loc) · 2.99 KB
/
Copy pathmappings.lua
File metadata and controls
101 lines (99 loc) · 2.99 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
local M = {}
M.general = {
n = {
["<leader>s"] = { ":%s/<C-r><C-w>/<C-r><C-w>/gI<Left><Left><Left>", "replace ocurrencies" },
-- Center cursor with some commands
["J"] = { "mzJ`z", "J maintains cursor position" },
["<C-d>"] = { "<C-d>zz", "centeres <C-d>" },
["<C-u>"] = { "<C-u>zz", "centeres <C-u>" },
["n"] = { "nzzzv", "Centered cursor n" },
["N"] = { "Nzzzv", "Centered cursor N" },
-- Yanking and pasting from a to clipboard
["<leader>y"] = { "\"+y", "yank to clipboard" },
["<leader>p"] = { "\"+p", "paste from clipboard" },
-- Delete to void
["D"] = { "\"_d", "delete" },
-- Evading muscle memory problems
["Q"] = { "<nop>", "" },
["<C-z>"] = { "<nop>", "" },
-- Redo
["U"] = { "<C-r>", "redo" },
},
v = {
-- Yanking and pasting from a to clipboard
["<leader>p"] = { "\"+p", "paste from clipboard" },
["<leader>y"] = { "\"+y", "yank to clipboard" },
-- Delete to void
["D"] = { "\"_d", "delete" },
},
x = {
-- Replacing lines
["c"] = { "\"_dP", "replace with register" },
["C"] = { "\"_d\"+P", "replace with clipboard" },
},
}
M.luasnip = {
n = {
['<Leader>L'] = {
function()
require("luasnip.loaders.from_lua")
.load({ paths = "~/.config/nvim/lua/custom/snippets/" })
end,
"reload snippets"
}
}
}
M.trouble = {
n = {
["q"] = { "<cmd> TroubleToggle<CR>", "toggle trouble" },
},
}
M.undoTree = {
n = {
["<leader>u"] = { "<cmd> UndotreeToggle<CR>", "toggle undo tree" },
},
}
M.tmuxNavigation = {
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" },
},
}
M.debugging = {
n = {
["<leader>b"] = { "<cmd> DapToggleBreakpoint<CR>", "toggle break point" },
["<leader>db"] = {
function()
local widgets = require("dap.ui.widgets")
local sidebar = widgets.sidebar(widgets.scopes)
sidebar.open()
end,
"open debugging sidebar"
}
},
}
M.spectre = {
n = {
['<leader>S'] = {
'<cmd>lua require("spectre").toggle()<CR>',
'Toggle Spectre',
},
['<leader>sw'] = {
'<cmd>lua require("spectre").open_visual({select_word=true})<CR>',
'Search current word'
},
['<leader>sp'] = {
'<cmd>lua require("spectre").open_file_search({select_word=true})<CR>',
'Search on current file'
},
},
v = {
['<leader>sw'] = {
'<esc><cmd>lua require("spectre").open_visual()<CR>',
'Search current word'
}
}
}
return M