From 2204a1f0cf955517a3c6cdbed7d66d2c6b2cdf1e Mon Sep 17 00:00:00 2001 From: Andrzej Stepien Date: Fri, 15 Mar 2024 12:40:59 +0100 Subject: [PATCH] remap escape --- lua/keymaps.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 9985f8b..4c75eb9 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -1,22 +1,21 @@ function map(mode, lhs, rhs, opts) - local options = { noremap = true, silent = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.keymap.set(mode, lhs, rhs, options) + local options = { noremap = true, silent = true } + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.keymap.set(mode, lhs, rhs, options) end --This code just maps vim.keymap.set() to something easier to type. Also, typing { noremap = true, silent = true } won’t be needed, because that is also implemented in the function. vim.g.mapleader = " " +map("i", "jk", "") -- remap escape + map("n", "+", ":bNext") --switch tabs map("n", "n", ":Neotree toggle") --open Nerdtree map("n", "z", ":ZenMode") --open ZenMode (distraction-free) map("n", "d", ":ToggleDiag") -- toggle all diagnostics - - - -- vim.api.nvim_create_autocmd('LspAttach', { -- desc = 'LSP actions', -- callback = function() @@ -40,7 +39,7 @@ map("n", "d", ":ToggleDiag") -- toggle all diagnostics -- -- Jumps to the definition of the type symbol -- bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') -- --- -- Lists all the references +-- -- Lists all the references -- bufmap('n', 'gr', 'lua vim.lsp.buf.references()') -- -- -- Displays a function's signature information