From a75d4659bfac04a1f5cad4166cc68f873768c653 Mon Sep 17 00:00:00 2001 From: talha Date: Sun, 19 Nov 2023 13:47:03 +0500 Subject: Adding files for upload --- lua/linux/remap.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lua/linux/remap.lua (limited to 'lua/linux/remap.lua') diff --git a/lua/linux/remap.lua b/lua/linux/remap.lua new file mode 100644 index 0000000..dfc7aca --- /dev/null +++ b/lua/linux/remap.lua @@ -0,0 +1,35 @@ +vim.g.mapleader = " " + +-- open project view with netrw +vim.keymap.set("n", "pv", vim.cmd.Ex) + +-- file splitting +vim.keymap.set("n", "vs", vim.cmd.vsplit) +vim.keymap.set("n", "hs", vim.cmd.split) + +-- moving selected lines across lines +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- not moving cursor when bringing files up +vim.keymap.set("n", "J", "mzJ`z") + +-- keep cursor in screen center when moving up and down +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") + +-- keep cursor in screen center when traversing in find +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- copying to system clipboard +vim.keymap.set("n", "y", [["+y]]) +vim.keymap.set("v", "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +-- deleting without polluting vim clipboard +vim.keymap.set("n", "d", [["_d]]) +vim.keymap.set("v", "d", [["_d]]) + +-- global substitute the word cursor is on in current file +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) -- cgit v1.2.3