diff options
-rw-r--r-- | .config/nvim/init.lua | 1 | ||||
-rw-r--r-- | .config/nvim/lua/justsaumit/keymaps.lua | 8 | ||||
-rw-r--r-- | .config/nvim/lua/justsaumit/plugins.lua | 2 | ||||
-rw-r--r-- | .config/nvim/lua/justsaumit/which-key-config.lua | 9 | ||||
-rw-r--r-- | .config/nvim/plugin/packer_compiled.lua | 5 |
5 files changed, 21 insertions, 4 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index fdd446d..e6343da 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -8,4 +8,5 @@ require("justsaumit.bufferline-config") require("justsaumit.nvim-tree-config") require("justsaumit.lastplace-config") require("justsaumit.autopairs") +require("justsaumit.which-key-config") print ("while(!(succeed = try() ) );") diff --git a/.config/nvim/lua/justsaumit/keymaps.lua b/.config/nvim/lua/justsaumit/keymaps.lua index 8d9b31b..2a29f46 100644 --- a/.config/nvim/lua/justsaumit/keymaps.lua +++ b/.config/nvim/lua/justsaumit/keymaps.lua @@ -28,10 +28,10 @@ keymap("n", "<C-k>", "<C-w>k", opts) keymap("n", "<C-l>", "<C-w>l", opts) -- Resize with arrows -keymap("n", "<C-Up>", ":resize -2<CR>", opts) -keymap("n", "<C-Down>", ":resize +2<CR>", opts) -keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts) -keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts) +keymap("n", "<C-Up>", ":resize +2<CR>", opts) +keymap("n", "<C-Down>", ":resize -2<CR>", opts) +keymap("n", "<C-Left>", ":vertical resize +2<CR>", opts) +keymap("n", "<C-Right>", ":vertical resize -2<CR>", opts) -- Move text up and down keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts) diff --git a/.config/nvim/lua/justsaumit/plugins.lua b/.config/nvim/lua/justsaumit/plugins.lua index b1d73fc..8c075ec 100644 --- a/.config/nvim/lua/justsaumit/plugins.lua +++ b/.config/nvim/lua/justsaumit/plugins.lua @@ -60,6 +60,8 @@ return packer.startup(function(use) use {'akinsho/bufferline.nvim', tag = "v2.*", requires = 'kyazdani42/nvim-web-devicons'} --Nvim-tree File explorer for nvim use {'kyazdani42/nvim-tree.lua', requires = { 'kyazdani42/nvim-web-devicons'}} +--Whick-key - displays a popup with possible key bindings + use {'folke/which-key.nvim'} --HTML use 'windwp/nvim-ts-autotag' --cmp diff --git a/.config/nvim/lua/justsaumit/which-key-config.lua b/.config/nvim/lua/justsaumit/which-key-config.lua new file mode 100644 index 0000000..11bb49c --- /dev/null +++ b/.config/nvim/lua/justsaumit/which-key-config.lua @@ -0,0 +1,9 @@ +local wk = require("which-key") +local mappings = { + q = {":q<CR>", "Quit"}, + Z = {":wq<CR>", "Save and Quit"}, + w = {":w<CR>", "Save"}, + x ={":bdelete<CR>", "Close"} +} +local opts = {prefix = '<leader>'} +wk.register(mappings, opts) diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index adb17a6..2c4489e 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -138,6 +138,11 @@ _G.packer_plugins = { loaded = true, path = "/home/saumit/.local/share/nvim/site/pack/packer/start/tokyonight.nvim", url = "https://github.com/folke/tokyonight.nvim" + }, + ["which-key.nvim"] = { + loaded = true, + path = "/home/saumit/.local/share/nvim/site/pack/packer/start/which-key.nvim", + url = "https://github.com/folke/which-key.nvim" } } |