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
|
vim.keymap.set('n', '<M-x>', ':', { noremap = true, silent = false })
vim.keymap.set('n', '<M-k>', ':bprevious<CR>', { noremap = true, silent = true })
-- vim.keymap.set('n', '<C-u>', '<C-u>zz', { noremap = true, silent = true })
-- vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true, silent = true })
-- vim.keymap.set('n', '<C-b>', '<C-b>zz', { noremap = true, silent = true })
-- vim.keymap.set('n', '<C-f>', '<C-f>zz', { noremap = true, silent = true })
vim.keymap.set('n', '<M-j>', ':bnext<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<C-h>', '<C-w>h', { noremap = true, silent = false })
vim.keymap.set('n', '<C-j>', '<C-w>j', { noremap = true, silent = false })
vim.keymap.set('n', '<C-k>', '<C-w>k', { noremap = true, silent = false })
vim.keymap.set('n', '<C-l>', '<C-w>l', { noremap = true, silent = false })
vim.keymap.set('n', '<C-o>', '<C-w>o', { noremap = true, silent = false })
vim.keymap.set('n', '<C-q>', '<C-w>q', { noremap = true, silent = false })
vim.keymap.set('n', '*', '*zz', { noremap = true, silent = false })
vim.keymap.set('i', '<C-j>', 'pumvisible() ? "<C-n>" : "<C-j>"', { expr = true })
vim.keymap.set('i', '<C-k>', 'pumvisible() ? "<C-p>" : "<C-k>"', { expr = true })
vim.keymap.set('i', '<CR>', 'pumvisible() ? asyncomplete#close_popup() : "\\<cr>"', { expr = true })
vim.keymap.set('n', '<F2>', vim.cmd.NvimTreeToggle, { noremap = true, silent = true })
vim.keymap.set('n', '<F4>', ':make<space>-j5<space>', { noremap = true, silent = false })
vim.keymap.set('n', '<F3>', ':Trouble diagnostics toggle focus=true<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<F5>', vim.cmd.UndotreeToggle, { noremap = true, silent = true })
vim.g.floaterm_keymap_toggle = '<F1>'
vim.g.floaterm_keymap_prev = '<F11>'
vim.g.floaterm_keymap_next = '<F12>'
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
vim.keymap.set('x', '<leader>p', "\"_dP")
vim.keymap.set('n', 'Q', '<nop>')
vim.keymap.set('n', '<leader><space>', vim.cmd.nohlsearch, { noremap = true, silent = true })
local ts = require('telescope.builtin')
require('telescope').load_extension('harpoon')
local harpoon = require('harpoon')
harpoon:setup()
vim.keymap.set('n', '<M-1>', function() harpoon:list():select(1) end)
vim.keymap.set('n', '<M-2>', function() harpoon:list():select(2) end)
vim.keymap.set('n', '<M-3>', function() harpoon:list():select(3) end)
vim.keymap.set('n', '<M-4>', function() harpoon:list():select(4) end)
-- normal
vim.keymap.set('n', '<leader>d', ':bn|:bd#<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>D', '"-ddk:put = strftime(\' * %a %b %d %T %Y\')<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>k', ':w<CR>:bp<CR>:bd #<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>u', ':w<CR>', { noremap = true, silent = true })
-- harpoon
vim.keymap.set('n', '<leader>aa', function() harpoon:list():add() end, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>ae', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>af', ':Telescope harpoon marks<CR>', { noremap = true, silent = true })
-- trouble
vim.keymap.set('n', '<leader>xx', ':Trouble diagnostics toggle focus=true<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>xw', ':Trouble diagnostics toggle focus=true<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>xd', ':Trouble diagnostics toggle focus=true filter.buf=0<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>xl', ':Trouble loclist toggle focus=true<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>xq', ':Trouble qflist toggle focus=true<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>xs', ':Trouble lsp toggle focus=true win.position=right<CR>', { noremap = true, silent = true })
-- telescope
vim.keymap.set('n', '<leader>fb', ts.buffers, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>fd', ts.diagnostics, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>fe', ':Telescope harpoon marks<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>ff', ts.find_files, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>fs', ts.live_grep, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>fg', function() ts.grep_string({ search = vim.fn.input("Grep > ") }) end, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>ft', ':TodoTelescope keywords=TODO,HACK,WARN,PERF,NOTE,TEST,FIX<CR>', { noremap = true, silent = true })
-- neovim
vim.keymap.set('n', '<leader>vu', vim.cmd.PackerSync, { noremap = true, silent = true })
vim.keymap.set('n', '<leader>vv', vim.cmd.Ex, { noremap = true, silent = true })
|