Toggle relative numbers and copy to system clipboards mappings

This commit is contained in:
i3cheese 2022-01-30 22:39:47 +07:00 committed by siduck
parent 1f73ef0ec6
commit 195f6f3621
2 changed files with 5 additions and 0 deletions

View File

@ -124,7 +124,9 @@ M.mappings = {
cheatsheet = "<leader>ch",
close_buffer = "<leader>x",
copy_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)
line_number_toggle = "<leader>n", -- toggle line number
relative_line_number_toggle = "<leader>nn",
update_nvchad = "<leader>uu",
new_buffer = "<S-t>",
new_tab = "<C-t>b",

View File

@ -84,9 +84,12 @@ M.misc = function()
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.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_tab, ":tabnew <CR>") -- new tabs
map("n", maps.misc.line_number_toggle, ":set nu! <CR>") -- toggle numbers
map("n", maps.misc.relative_line_number_toggle, ":set rnu! <CR>") -- toggle relative numbers
map("n", maps.misc.save_file, ":w <CR>") -- ctrl + s to save file
-- terminal mappings --