summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-08-28 14:34:53 +0530
committersinanmohd <sinan@firemail.cc>2023-08-28 14:47:20 +0530
commitb98fd0ba461fe4ade915b70f3bb6f9764771231f (patch)
treeca1751186cb00fb2672f4dd2fbcaf98e83033152
parent92c8e0b98f84b6843e84409a2ad2f0980db4f26d (diff)
config/nvim: update keybindings
-rw-r--r--.config/nvim/init.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index e57dd51..804cee3 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -30,6 +30,11 @@ local mapnl = function(lhs, rhs, opts)
end
-- [[ keybindings ]]
+-- close and bd
+map("n", "<C-x>", ":bd<CR>")
+map("t", "<C-x>", "<C-\\><C-n>:bd!<CR>")
+map("n", "<C-s>", ":close<CR>")
+map("t", "<C-s>", "<C-\\><C-n>")
-- splits
map("n", "<C-h>", "<C-w>h")
map("n", "<C-j>", "<C-w>j")
@@ -43,11 +48,15 @@ map("t", "<C-l>", "<C-\\><C-n><C-w>l")
map("n", "<leader>t", ":vsplit<CR>:terminal<CR>i")
map("t", "<leader>t", "<C-\\><C-n>:q<CR>")
-- buffer
-mapnl("h", ":bprevious<CR>")
-mapnl("l", ":bNext<CR>")
+map("t", "<leader>j", "<C-\\><C-n>:bprevious<CR>")
+map("t", "<leader>k", "<C-\\><C-n>:bNext<CR>")
+mapnl("j", ":bprevious<CR>")
+mapnl("k", ":bNext<CR>")
-- tabs
-mapnl("j", ":tabprevious<CR>")
-mapnl("k", ":tabNext<CR>")
+map("t", "<leader>h", "<C-\\><C-n>:tabprevious<CR>")
+map("t", "<leader>l", "<C-\\><C-n>:tabNext<CR>")
+mapnl("h", ":tabprevious<CR>")
+mapnl("l", ":tabNext<CR>")
-- files
mapnl("e", ":Lex<CR>")
-- column hint