diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua index 021c1e5..a7845e6 100644 --- a/.config/nvim/lua/keybindings.lua +++ b/.config/nvim/lua/keybindings.lua @@ -9,6 +9,11 @@ local e_opts = { expr = true, } +-- cmd string +local function cmd(command) + return "" .. command .. "" +end + -- map("", "", "", opts) @@ -21,20 +26,26 @@ map("n", "k", "v:count == 0 ? 'gk' : 'k'", e_opts) -- -map("n", "", ":BufferLineCycleNext", opts) -map("n", "", ":BufferLineCyclePrev", opts) +map("n", "", cmd("BufferLineCycleNext"), opts) +map("n", "", cmd("BufferLineCyclePrev"), opts) -map("n", "", ":Neotree", opts) +map("n", "", cmd("Neotree"), opts) -- Telescope -map("n", "", "lua require('plugins.telescope').custom_find_files()", opts) -map("n", "", "lua require('plugins.telescope').custom_find_hidden_files()", opts) -map("n", "", "lua require('telescope.builtin').current_buffer_fuzzy_find()", opts) +map("n", "", cmd("lua require('plugins.telescope').custom_find_files()"), opts) +map("n", "", cmd("lua require('plugins.telescope').custom_find_hidden_files()"), opts) +map("n", "", cmd("lua require('telescope.builtin').current_buffer_fuzzy_find()"), opts) -- -map("n", "s", "lua require('telescope.builtin').lsp_document_symbols()", opts) -map("n", "f", "lua require('telescope.builtin').live_grep()", opts) -map("n", "d", "lua require('telescope.builtin').lsp_definitions()", opts) -map("n", "r", "lua require('telescope.builtin').lsp_references()", opts) +map("n", "f", cmd("lua require('telescope.builtin').live_grep()"), opts) +map("n", "s", cmd("lua require('telescope.builtin').lsp_document_symbols()"), opts) +map("n", "d", cmd("lua require('telescope.builtin').lsp_definitions()"), opts) +map("n", "r", cmd("lua require('telescope.builtin').lsp_references()"), opts) + +-- LSP +map("n", "h", cmd("lua vim.lsp.buf.hover()"), opts) + +-- Focus +vim.api.nvim_set_keymap("n", "", cmd("lua require('focus').split_cycle()"), opts) -- hlslens map("n", "n", [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], opts) @@ -48,6 +59,3 @@ map("x", "*", [[*lua require('hlslens').start()]], opts) map("x", "#", [[#lua require('hlslens').start()]], opts) map("x", "g*", [[g*lua require('hlslens').start()]], opts) map("x", "g#", [[g#lua require('hlslens').start()]], opts) - --- Focus -vim.api.nvim_set_keymap("n", "", ":lua require('focus').split_cycle()", opts)