From 3e4ce0d7db1a308a8e0d6051e8020211bd84ea94 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Wed, 19 Jul 2023 02:17:18 +0530 Subject: nvim: Adding toggleterm plugin + whickey spacebinds w term,lazygit and packer --- .config/nvim/lua/justsaumit/which-key-config.lua | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to '.config/nvim/lua/justsaumit/which-key-config.lua') diff --git a/.config/nvim/lua/justsaumit/which-key-config.lua b/.config/nvim/lua/justsaumit/which-key-config.lua index 25ec150..16ffedd 100644 --- a/.config/nvim/lua/justsaumit/which-key-config.lua +++ b/.config/nvim/lua/justsaumit/which-key-config.lua @@ -1,13 +1,38 @@ local wk = require("which-key") +local Terminal = require('toggleterm.terminal').Terminal +local toggle_float = function() + local float = Terminal:new({ direction = "float" }) + return float:toggle() +end +local toggle_lazygit = function() + local lazygit = Terminal:new({ cmd = "lazygit", direction = "float" }) + return lazygit:toggle() +end local mappings = { q = {":q", "Quit"}, Z = {":wq", "Save and Quit"}, w = {":w", "Save"}, x ={":bdelete", "Close"}, + E = { ":e ~/.config/nvim/init.lua", "Edit config" }, f = { ":Telescope find_files", "Telescope Find Files" }, h = { ":Telescope find_files hidden=true", "Telescope Find Files" }, g = { ":Telescope live_grep", "Telescope Live Grep" }, - r = { ":Telescope oldfiles", "Recent files" } + r = { ":Telescope oldfiles", "Recent files" }, + t = { + t = { ":ToggleTerm", "Split Below" }, + f = { toggle_float, "Floating Terminal" }, + l = { toggle_lazygit, "Lazygit" }, + }, + p = { + name = "Packer", + s = { ":PackerSync", "Sync Plugins" }, + r = { ":PackerClean", "Remove Unused Plugins" }, + c = { ":PackerCompile profile=true", "Recompile Plugins" }, + i = { ":PackerInstall", "Install Plugins" }, + p = { ":PackerProfile", "Packer Profile" }, + S = { ":PackerStatus", "Packer Status" }, + u = { ":PackerUpdate", "Update Plugins" } + }, } local opts = {prefix = ''} wk.register(mappings, opts) -- cgit v1.2.3