Change keybinds for tabs

This commit is contained in:
Arkaprabha Chakraborty
2023-03-05 13:50:58 +05:30
parent d3432b7ffc
commit 692e0d0b6c

View File

@@ -1,10 +1,10 @@
local opts = { noremap = true, silent = true }
--local term_opts = { silent = true }
--Local term_opts = { silent = true }
local bind = vim.api.nvim_set_keymap
local set = vim.keymap.set
-- bind a leader key
-- Bind a leader key
bind("", ";", "<Nop>", opts) -- undo any previous bind
vim.g.mapleader = ";"
vim.g.maplocalleader = ";"
@@ -29,17 +29,17 @@ bind("n", "<C-f>", ":NvimTreeToggle<CR>", opts)
-- Fuzzy finder
local telescope_status_ok, telescope = pcall(require, "telescope.builtin")
if telescope_status_ok then
set("n", "<Leader>ff", telescope.find_files, {})
set("n", "<Leader>fg", telescope.live_grep, {})
set("n", "<Leader>fb", telescope.buffers, {})
set("n", "<Leader>fh", telescope.help_tags, {})
set("n", "<Leader>ff", telescope.find_files, {})
set("n", "<Leader>fg", telescope.live_grep, {})
set("n", "<Leader>fb", telescope.buffers, {})
set("n", "<Leader>fh", telescope.help_tags, {})
end
-- Better tabs
--bind("n", "<Leader>n", ":tabnew<CR>", opts)
--bind("n", "<Leader>c", ":tabclose<CR>", opts)
--bind("n", "<Leader>l", ":tabnext<CR>", opts)
--bind("n", "<Leader>h", ":tabprev<CR>", opts)
bind("n", "<Leader>t", ":tabnew<CR>", opts)
bind("n", "<Leader>c", ":tabclose<CR>", opts)
bind("n", "<S-k>", ":tabnext<CR>", opts)
bind("n", "<S-j>", ":tabprev<CR>", opts)
-- Better window navigation
bind("n", "<C-Left>", "<C-w>h", opts)
@@ -54,10 +54,8 @@ bind("n", "<C-l>", ":vertical resize -2<CR>", opts)
bind("n", "<C-h>", ":vertical resize +2<CR>", opts)
-- Navigate tabs
bind("n", "<S-t>", ":tabnew<CR>", opts)
bind("n", "<S-c>", ":tabclose<CR>", opts)
bind("n", "<S-n>", ":tabp<CR>", opts)
bind("n", "<S-m>", ":tabn<CR>", opts)
bind("n", "<S-h>", ":tabp<CR>", opts)
bind("n", "<S-l>", ":tabn<CR>", opts)
-- Visual --
-- Stay in indent mode