Skip to content

Commit

Permalink
feat(keymaps): remove useless keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
BBboy01 committed Dec 7, 2023
1 parent 359d790 commit 8a1cbee
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 43 deletions.
12 changes: 6 additions & 6 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"LuaSnip": { "branch": "master", "commit": "954c81b53989097faaff0fabc11c29575288c3e1" },
"bufferline.nvim": { "branch": "main", "commit": "1a3397556d194bb1f2cc530b07124ccc512c5501" },
"bufferline.nvim": { "branch": "main", "commit": "6c456b888823d9e4832aa91c482bccd19445c009" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
Expand All @@ -19,13 +19,13 @@
"mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" },
"mini.pairs": { "branch": "main", "commit": "71f117fd57f930da6ef4126b24f594dd398bac26" },
"mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" },
"neodev.nvim": { "branch": "main", "commit": "1676d2c24186fc30005317e0306d20c639b2351b" },
"neodev.nvim": { "branch": "main", "commit": "7d4e7ecede7f43b5d62b2a8bb82ffec34f1265d4" },
"neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
"none-ls.nvim": { "branch": "main", "commit": "7bf88cd3b37a411fdacfdca1745408a77a420493" },
"nui.nvim": { "branch": "main", "commit": "1d044afde83e73c56de8e176615a4a6e7c8cf0e3" },
"none-ls.nvim": { "branch": "main", "commit": "101848ce09fccc8cdc420a6d58dee57fb988329e" },
"nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
"nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
"nvim-lspconfig": { "branch": "master", "commit": "cf3dd4a290084a868fac0e2e876039321d57111c" },
"nvim-lspconfig": { "branch": "master", "commit": "6c797ff9324094e333e2ace9526ca4a62ad9d1ca" },
"nvim-tree.lua": { "branch": "master", "commit": "7d1760f892951dd6a118dae1d7a1d8df5f029edf" },
"nvim-treesitter": { "branch": "master", "commit": "c203884c80ef31b6a3993398734fbe008addcb27" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" },
Expand All @@ -41,7 +41,7 @@
"schemastore.nvim": { "branch": "main", "commit": "46891f2f5b3b4380a1d021dd3940a08f5de582f8" },
"solarized-osaka.nvim": { "branch": "main", "commit": "a823d09b062852194ae15365392bc16274e38fc8" },
"statuscol.nvim": { "branch": "main", "commit": "98d02fc90ebd7c4674ec935074d1d09443d49318" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "98101b22402cd6d1c7e9a7e0c4718bfc98cb1625" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "8e0543365fe5781c9babea7db89ef06bcff3716d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" },
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }
Expand Down
2 changes: 1 addition & 1 deletion lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ vim.api.nvim_create_autocmd('FileType', {
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set('n', 'q', '<cmd>close<cr>', { buffer = event.buf, silent = true })
vim.keymap.set('n', 'q', '<Cmd>close<CR>', { buffer = event.buf, silent = true })
end,
})

Expand Down
21 changes: 8 additions & 13 deletions lua/config/keymaps.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
local keymap = vim.keymap

-- Do not yank
keymap.set('n', 'x', '"_x')

keymap.set('x', 'p', '"_dP')

keymap.set('n', '<leader>l', ':set hlsearch!<CR>', {
noremap = true,
silent = true,
Expand All @@ -18,24 +15,22 @@ keymap.set('n', '-', '<C-x>')
-- Delete a word backwards
keymap.set('n', 'dw', 'vb"_d')

keymap.set('n', 'si', ':split<Return><C-w>w', { silent = true, desc = 'Horizontally split current buffer' })
keymap.set('n', 'sv', ':vsplit<Return><C-w>w', { silent = true, desc = 'Vertically split current buffer' })
-- Split window
keymap.set('n', 'si', '<Cmd>split<Return><C-w>w', { desc = 'Horizontally split current buffer' })
keymap.set('n', 'sv', '<Cmd>vsplit<Return><C-w>w', { desc = 'Vertically split current buffer' })

-- Move window
keymap.set('', 'sh', '<C-w>h', { desc = 'Move focus to left window' })
keymap.set('', 'sk', '<C-w>k', { desc = 'Move focus to upper window' })
keymap.set('', 'sj', '<C-w>j', { desc = 'Move focus to lower window' })
keymap.set('', 'sl', '<C-w>l', { desc = 'Move focus to right window' })

keymap.set('n', 'sw', ':q<CR>', { desc = 'Save and Close current buffer' })
keymap.set('n', '<C-s>', ':w<CR>', { desc = 'Save current buffer' })

-- Resize window
keymap.set('n', 's<right>', '<C-w><', { desc = 'Decrease window width' })
keymap.set('n', 's<left>', '<C-w>>', { desc = 'Increase window width' })
keymap.set('n', 's<up>', '<C-w>+', { desc = 'Increase window height' })
keymap.set('n', 's<down>', '<C-w>-', { desc = 'Decrease window height' })

keymap.set('v', '>', '>gv', { noremap = true, silent = true, desc = 'Indent selected text' })
keymap.set('v', '<', '<gv', { noremap = true, silent = true, desc = 'Unindent selected text' })

keymap.set('x', 'K', ":move '<-2<CR>gv-gv", { noremap = true, silent = true, desc = 'Move selected text up' })
keymap.set('x', 'J', ":move '>+1<CR>gv-gv", { noremap = true, silent = true, desc = 'Move selected text down' })
-- Save & Close buffer
keymap.set('n', 'sw', '<Cmd>:q<CR>', { desc = 'Save and Close current buffer' })
keymap.set('n', '<C-s>', '<Cmd>w<CR>', { desc = 'Save current buffer' })
9 changes: 2 additions & 7 deletions lua/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,16 @@ return {
-- your custom normal mode mappings
['N'] = fb_actions.create,
['h'] = fb_actions.goto_parent_dir,
['/'] = function()
vim.cmd('startinsert')
end,
['<C-u>'] = function(prompt_bufnr)
for i = 1, 10 do
for _ = 1, 10 do
actions.move_selection_previous(prompt_bufnr)
end
end,
['<C-d>'] = function(prompt_bufnr)
for i = 1, 10 do
for _ = 1, 10 do
actions.move_selection_next(prompt_bufnr)
end
end,
['<PageUp>'] = actions.preview_scrolling_up,
['<PageDown>'] = actions.preview_scrolling_down,
},
},
},
Expand Down
28 changes: 14 additions & 14 deletions lua/plugins/lspsaga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ return {
'nvimdev/lspsaga.nvim',
event = 'LspAttach',
keys = {
{ '<leader>dc', '<Cmd>Lspsaga show_line_diagnostics<cr>', desc = 'Show current line diagnostic' },
{ '<leader>dp', '<Cmd>Lspsaga diagnostic_jump_next<cr>', desc = 'Next diagnostic at current buffer' },
{ '<leader>dn', '<Cmd>Lspsaga diagnostic_jump_prev<cr>', desc = 'Prev diagnostic at current buffer' },
{ '<leader>o', '<Cmd>Lspsaga outline<cr>', desc = 'Show outline of current buffer' },
{ '<Leader>ci', '<cmd>Lspsaga incoming_calls<CR>', desc = 'Show incoming calls' },
{ '<Leader>co', '<cmd>Lspsaga outgoing_calls<CR>', desc = 'Show outgoing calls' },
{ '<leader>dc', '<Cmd>Lspsaga show_line_diagnostics<CR>', desc = 'Show current line diagnostic' },
{ '<leader>dp', '<Cmd>Lspsaga diagnostic_jump_next<CR>', desc = 'Next diagnostic at current buffer' },
{ '<leader>dn', '<Cmd>Lspsaga diagnostic_jump_prev<CR>', desc = 'Prev diagnostic at current buffer' },
{ '<leader>o', '<Cmd>Lspsaga outline<CR>', desc = 'Show outline of current buffer' },
{ '<Leader>ci', '<Cmd>Lspsaga incoming_calls<CR>', desc = 'Show incoming calls' },
{ '<Leader>co', '<Cmd>Lspsaga outgoing_calls<CR>', desc = 'Show outgoing calls' },
{
'<C-j>',
'<cmd>Lspsaga term_toggle<CR>',
'<Cmd>Lspsaga term_toggle<CR>',
desc = 'Toggle float term',
mode = { 'n', 't', 'i' },
},
{ 'gd', '<Cmd>Lspsaga goto_definition<cr>', desc = 'Goto cursorword definition' },
{ 'gt', '<Cmd>Lspsaga goto_type_definition<cr>', desc = 'Goto cursorword type definition' },
{ 'gh', '<Cmd>Lspsaga hover_doc<cr>', desc = 'Show cursorword doc' },
{ 'gr', '<cmd>Lspsaga finder<CR>', desc = 'Show cursorword finder' },
{ 'gp', '<Cmd>Lspsaga peek_definition<cr>', desc = 'Peek cursorword definition' },
{ 'ga', '<Cmd>Lspsaga code_action<cr>', desc = 'Show code action' },
{ '<Leader>n', '<Cmd>Lspsaga rename<cr>', desc = 'Rename cursorword' },
{ 'gd', '<Cmd>Lspsaga goto_definition<CR>', desc = 'Goto cursorword definition' },
{ 'gt', '<Cmd>Lspsaga goto_type_definition<CR>', desc = 'Goto cursorword type definition' },
{ 'gh', '<Cmd>Lspsaga hover_doc<CR>', desc = 'Show cursorword doc' },
{ 'gr', '<Cmd>Lspsaga finder<CR>', desc = 'Show cursorword finder' },
{ 'gp', '<Cmd>Lspsaga peek_definition<CR>', desc = 'Peek cursorword definition' },
{ 'ga', '<Cmd>Lspsaga code_action<CR>', desc = 'Show code action' },
{ '<Leader>n', '<Cmd>Lspsaga rename<CR>', desc = 'Rename cursorword' },
},
opts = {
outline = {
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ return {
},
},
keys = {
{ ' e', '<Cmd>NvimTreeToggle<cr>', 'Toggle file struct tree' },
{ '<Space>e', '<Cmd>NvimTreeToggle<CR>', 'Toggle file struct tree' },
},
}
2 changes: 1 addition & 1 deletion lua/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ return {
focus_language = 'f',
unfocus_language = 'F',
update = 'R',
goto_node = '<cr>',
goto_node = '<CR>',
show_help = '?',
},
},
Expand Down

0 comments on commit 8a1cbee

Please sign in to comment.