shorten some long mapping vars, fix (#849)| fix (#836)

This commit is contained in:
siduck 2022-03-01 12:43:34 +05:30
parent 1777be0064
commit cb531cd90b
3 changed files with 8 additions and 11 deletions

View File

@ -123,10 +123,9 @@ M.mappings = {
misc = { misc = {
cheatsheet = "<leader>ch", cheatsheet = "<leader>ch",
close_buffer = "<leader>x", close_buffer = "<leader>x",
copy_whole_file = "<C-a>", -- copy all contents of current buffer cp_whole_file = "<C-a>", -- copy all contents of current buffer
copy_to_system_clipboard = "<C-c>", -- copy selected text (visual mode) or curent line (normal) lineNR_toggle = "<leader>n", -- toggle line number
line_number_toggle = "<leader>n", -- toggle line number lineNR_rel_toggle = "<leader>rn",
relative_line_number_toggle = "<leader>rn",
update_nvchad = "<leader>uu", update_nvchad = "<leader>uu",
new_buffer = "<S-t>", new_buffer = "<S-t>",
new_tab = "<C-t>b", new_tab = "<C-t>b",

View File

@ -26,7 +26,7 @@ local M = {}
M.misc = function() M.misc = function()
local function non_config_mappings() local function non_config_mappings()
-- Don't copy the replaced text after pasting in visual mode -- Don't copy the replaced text after pasting in visual mode
map_wrapper("v", "p", 'p:let @+=@0<CR>') map_wrapper("v", "p", "p:let @+=@0<CR>")
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down> -- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ -- 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() <CR>") -- show keybinds map("n", maps.misc.cheatsheet, ":lua require('nvchad.cheatsheet').show() <CR>") -- show keybinds
map("n", maps.misc.close_buffer, ":lua require('core.utils').close_buffer() <CR>") -- close buffer map("n", maps.misc.close_buffer, ":lua require('core.utils').close_buffer() <CR>") -- close buffer
map("n", maps.misc.copy_whole_file, ":%y+ <CR>") -- copy whole file content map("n", maps.misc.copy_whole_file, ":%y+ <CR>") -- 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 <CR>") -- new buffer map("n", maps.misc.new_buffer, ":enew <CR>") -- new buffer
map("n", maps.misc.new_tab, ":tabnew <CR>") -- new tabs map("n", maps.misc.new_tab, ":tabnew <CR>") -- new tabs
map("n", maps.misc.line_number_toggle, ":set nu! <CR>") -- toggle numbers map("n", maps.misc.lineNR_toggle, ":set nu! <CR>")
map("n", maps.misc.relative_line_number_toggle, ":set rnu! <CR>") -- toggle relative numbers map("n", maps.misc.lineNR_rel_toggle, ":set rnu! <CR>") -- relative line numbers
map("n", maps.misc.save_file, ":w <CR>") -- ctrl + s to save file map("n", maps.misc.save_file, ":w <CR>") -- ctrl + s to save file
-- terminal mappings -- -- terminal mappings --

View File

@ -126,7 +126,7 @@ local plugins = {
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
module = "cmp_nvim_lsp", module = "cmp_nvim_lsp",
disable = not plugin_settings.status.cmp, disable = not plugin_settings.status.cmp,
event = "InsertCharPre", event = "InsertEnter",
}, },
{ {