-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmappings.lua
167 lines (143 loc) · 4.14 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
local mappings = {}
local function cmd(str) ---@param str string
return '<cmd> ' .. str .. '<CR>'
end
mappings.disabled = { n = { ['<leader>pt'] = '', ['<leader>ph'] = '' } }
mappings.general = {
n = {
['<leader>sa'] = { ':w <CR>', 'Save' },
['<BS>'] = { cmd 'e #', 'Previous Buffer' },
['g>'] = { '<C-a>', 'Increment' },
['g<'] = { '<C-x>', 'Decrement' },
['<leader>ra'] = { ':IncRename ', 'Rename' },
},
}
mappings.flash = {
n = {
['s'] = {
function()
require('flash').jump()
end,
'Flash',
},
},
}
mappings.trouble = {
n = {
['<leader>q'] = { cmd 'Trouble', 'Open Trouble' },
['gr'] = { cmd 'Trouble lsp_references', 'Lsp References' },
['gd'] = { cmd 'Trouble lsp_definitions', 'Lsp Definitions' },
},
}
mappings.traverse = {
n = { ['<CR>'] = { cmd 'Traverse', 'Traverse Links' } },
}
local function nav(id)
return function()
require('harpoon.ui').nav_file(id)
end
end
mappings.harpoon = {
n = {
['<tab>'] = { cmd 'HarpoonNext', 'Next Mark' },
['<S-tab>'] = { cmd 'HarpoonPrev', 'Previous Mark' },
['<leader>a'] = { cmd 'HarpoonAdd', 'Add Mark' },
['<leader>A'] = { cmd 'HarpoonToggle', 'Harpoon Menu' },
['<F1>'] = { nav(1), 'Go to file 1' },
['<F2>'] = { nav(2), 'Go to file 2' },
['<F3>'] = { nav(4), 'Go to file 3' },
['<F4>'] = { nav(5), 'Go to file 4' },
},
}
mappings.zen_mode = {
n = { ['<leader>zn'] = { cmd 'ZenMode', 'Zen Mode' } },
}
mappings.code_runner = {
n = { ['<leader>ru'] = { cmd 'RunCode', 'Run file' } },
}
mappings.undotree = {
n = { ['<leader>u'] = { cmd 'UndotreeToggle', 'Undo Tree' } },
}
mappings.conform = {
n = {
['<leader>fm'] = {
function()
require('conform').format()
end,
'Format code',
},
},
}
mappings.icon_picker = {
n = {
['<leader>ei'] = { cmd 'IconPickerNormal', 'Insert Emoji' },
['<leader>ey'] = { cmd 'IconPickerYank', 'Insert Emoji' },
},
}
mappings.oil = {
n = {
['-'] = {
function()
require('oil').open_float()
end,
'Open Oil',
},
},
}
mappings.lazygit = {
n = { ['<leader>lz'] = { cmd 'LazyGit', 'Open Lazygit' } },
}
mappings.primeagen = {
n = {
['x'] = { '"_x' },
['<leader>d'] = { '"_d', 'Delete without yanking' },
['<leader>c'] = { '"_c', 'Change without yanking' },
['d'] = { '""d' },
['c'] = { '""c' },
['p'] = { '""p' },
['P'] = { '""P' },
['y'] = { '""y' },
['<leader>p'] = { '"+p', 'Clipboard paste' },
['<leader>P'] = { '"+P', 'Clipboard paste' },
['<leader>y'] = { '"+y', 'Clipboard yank' },
['J'] = { 'mzJ`z', 'Append the following line to the current line' },
['Q'] = { '<nop>', 'Disable the horrors of Q' },
},
x = {
['<leader>y'] = { '"+y', 'Clipboard yank' },
['y'] = { '""y' },
['<leader>p'] = { '"_dP', 'Paste over a highlighted word' },
},
v = {
['d'] = { '""d' },
['c'] = { '""c' },
['p'] = { '""p' },
['P'] = { '""P' },
['y'] = { '""y' },
['<leader>p'] = { '"+p', 'Clipboard paste' },
['<leader>y'] = { '"+y', 'Clipboard yank' },
['<leader>d'] = { '"_d', 'Delete without yanking' },
['<leader>c'] = { '"_c', 'Change without yanking' },
['J'] = { ":m '>+1<CR>gv=gv", 'Move selected lines down' },
['K'] = { ":m '<-2<CR>gv=gv", 'Move selected lines up' },
},
}
mappings.crates = {
n = {
['<leader>rcu'] = {
function()
require('crates').upgrade_all_crates()
end,
'Update crates',
},
},
}
mappings.tmux = {
n = {
['<C-h>'] = { cmd 'TmuxNavigateLeft', 'Tmux left' },
['<C-j>'] = { cmd 'TmuxNavigateUp', 'Tmux up' },
['<C-k>'] = { cmd 'TmuxNavigateDown', 'Tmux down' },
['<C-l>'] = { cmd 'TmuxNavigateRight', 'Tmux right' },
},
}
return mappings