From cb531cd90b6b062f9ece2376c736f31ea23126bd Mon Sep 17 00:00:00 2001 From: siduck Date: Tue, 1 Mar 2022 12:43:34 +0530 Subject: [PATCH] shorten some long mapping vars, fix (#849)| fix (#836) --- lua/core/default_config.lua | 7 +++---- lua/core/mappings.lua | 8 +++----- lua/plugins/init.lua | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 8954fa9..eb17228 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -123,10 +123,9 @@ M.mappings = { misc = { cheatsheet = "ch", close_buffer = "x", - copy_whole_file = "", -- copy all contents of current buffer - copy_to_system_clipboard = "", -- copy selected text (visual mode) or curent line (normal) - line_number_toggle = "n", -- toggle line number - relative_line_number_toggle = "rn", + cp_whole_file = "", -- copy all contents of current buffer + lineNR_toggle = "n", -- toggle line number + lineNR_rel_toggle = "rn", update_nvchad = "uu", new_buffer = "", new_tab = "b", diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 70cf9c7..1c0015b 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -26,7 +26,7 @@ local M = {} M.misc = function() local function non_config_mappings() -- Don't copy the replaced text after pasting in visual mode - map_wrapper("v", "p", 'p:let @+=@0') + map_wrapper("v", "p", "p:let @+=@0") -- Allow moving the cursor through wrapped lines with j, k, and -- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ @@ -84,12 +84,10 @@ M.misc = function() map("n", maps.misc.cheatsheet, ":lua require('nvchad.cheatsheet').show() ") -- show keybinds map("n", maps.misc.close_buffer, ":lua require('core.utils').close_buffer() ") -- close buffer map("n", maps.misc.copy_whole_file, ":%y+ ") -- copy whole file content - map("v", maps.misc.copy_to_system_clipboard, '"+y') - map("n", maps.misc.copy_to_system_clipboard, '"+yy') -- copy curent line in normal mode map("n", maps.misc.new_buffer, ":enew ") -- new buffer map("n", maps.misc.new_tab, ":tabnew ") -- new tabs - map("n", maps.misc.line_number_toggle, ":set nu! ") -- toggle numbers - map("n", maps.misc.relative_line_number_toggle, ":set rnu! ") -- toggle relative numbers + map("n", maps.misc.lineNR_toggle, ":set nu! ") + map("n", maps.misc.lineNR_rel_toggle, ":set rnu! ") -- relative line numbers map("n", maps.misc.save_file, ":w ") -- ctrl + s to save file -- terminal mappings -- diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 622af9b..2e83bdd 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -65,7 +65,7 @@ local plugins = { { "nvim-treesitter/nvim-treesitter", - event = {"BufRead", "BufNewFile"}, + event = { "BufRead", "BufNewFile" }, config = override_req("nvim_treesitter", "plugins.configs.treesitter", "setup"), run = ":TSUpdate", }, @@ -126,7 +126,7 @@ local plugins = { "rafamadriz/friendly-snippets", module = "cmp_nvim_lsp", disable = not plugin_settings.status.cmp, - event = "InsertCharPre", + event = "InsertEnter", }, {