From 93fa5539ef0299f6c9b4523f32bf6e0334f696d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Tue, 3 Sep 2024 18:50:05 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20enable=20lazyterm=20k?= =?UTF-8?q?eymaps=20if=20floaterm=20or=20toggleterm=20are=20not=20installe?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/config/keymaps.lua | 17 +++++++++++++---- .config/nvim/lua/config/options.lua | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 303737de..3e2dbd96 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -139,10 +139,6 @@ map("n", "cir", "LazyRoot", { desc = "Root" }) -- U for redo map("n", "U", "", { desc = "Redo" }) --- Move to beginning/end of line -map("n", "", "_", { desc = "First Character of Line" }) -map("n", "", "$", { desc = "Last Character of Line" }) - -- Copy whole text to clipboard map("n", "", ":%y+", { desc = "Copy Whole Text to Clipboard", silent = true }) @@ -192,6 +188,19 @@ end, { desc = "Dashboard" }) map("n", "!", "zg", { desc = "Add Word to Dictionary" }) map("n", "@", "zug", { desc = "Remove Word from Dictionary" }) +-- Terminal Stuff +if not LazyVim.has("floaterm.nvim") or not LazyVim.has("toggleterm.nvim") then + local lazyterm = function() + LazyVim.terminal(nil, { backdrop = 90.0, size = { width = 0.8, height = 0.8 }, cwd = LazyVim.root() }) + end + map("n", "ft", lazyterm, { desc = "Terminal (Root Dir)" }) + map("n", "fT", function() + LazyVim.terminal(nil, { backdrop = 90.0, size = { width = 0.8, height = 0.8 }, cwd = vim.fn.getcwd() }) + end, { desc = "Terminal (cwd)" }) + map("n", [[]], lazyterm, { desc = "Terminal (Root Dir)" }) + map("t", [[]], "close", { desc = "Hide Terminal" }) +end + -- Marks map("n", "dm", function() local cur_line = vim.fn.line(".") diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 99f1794e..db874a68 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -7,6 +7,7 @@ vim.loader.enable() -- LazyVim related options vim.g.lazyvim_statuscolumn.folds_open = true vim.g.lazyvim_statuscolumn.folds_githl = true +vim.g.lazygit_config = false -- Define leader key go.mapleader = " "