summaryrefslogtreecommitdiff
path: root/lua/talha/remap.lua
diff options
context:
space:
mode:
authortalha <talha@talhaamir.xyz>2024-04-23 00:43:02 +0500
committertalha <talha@talhaamir.xyz>2024-04-23 00:43:02 +0500
commitf4431f6d75baa71aa23318ea50bea3848f946ab1 (patch)
treeb68fdc45b210d7c8adf2db39a2e7d499ccc1ba6f /lua/talha/remap.lua
parent721ef14cf3906992d8615456493de439ada8e1b8 (diff)
Migrated to lazy.nvim, added neomake, a few remaps
Diffstat (limited to 'lua/talha/remap.lua')
-rw-r--r--lua/talha/remap.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/lua/talha/remap.lua b/lua/talha/remap.lua
index 882d651..cfd6624 100644
--- a/lua/talha/remap.lua
+++ b/lua/talha/remap.lua
@@ -1,5 +1,3 @@
-vim.g.mapleader = " "
-
-- open project view with netrw
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
@@ -24,10 +22,16 @@ vim.keymap.set("n", "N", "Nzzzv")
vim.keymap.set("x", "<leader>p", "\"_dP")
--- copying to system clipboard
+---- system clipboard
+-- copying
vim.keymap.set("n", "<leader>y", [["+y]])
vim.keymap.set("v", "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
+-- pasting
+-- @note: for posting in insert mode use: <C-r>+
+vim.keymap.set("n", "<leader>p", [["+p]])
+vim.keymap.set("n", "<leader>P", [["+P]])
+vim.keymap.set("v", "<leader>p", [["+p]])
-- deleting without polluting vim clipboard
vim.keymap.set({"n", "x"}, "x", [["_x]])
@@ -36,6 +40,13 @@ vim.keymap.set({"n", "x"}, "X", [["_d]])
-- global substitute the word cursor is on in current file
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
--- remapping quickfix list navigation
-vim.keymap.set("n", "<C-f>l", vim.cmd.cnext)
-vim.keymap.set("n", "<C-f>h", vim.cmd.cprev)
+---- remapping quickfix list navigation
+-- go to next error
+vim.keymap.set("n", "<A-n>", function() SafeCListNav(1) end)
+-- go to prev error
+vim.keymap.set("n", "<A-p>", function() SafeCListNav(-1) end)
+-- open error list when there are errors
+vim.keymap.set("n", "<A-e>", vim.cmd.cw)
+
+-- building
+-- vim.keymap.set("n", "<F5>", vim.cmd.Neomake{bang=true})