diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 53b670e7..9fd3b604 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -59,6 +59,7 @@ vim.api.nvim_create_autocmd("FileType", { "neo-tree-popup", "TelescopePrompt", "notify", + "floaterm", }, callback = function(event) vim.keymap.set("n", "", "", { buffer = event.buf, desc = "" }) @@ -66,6 +67,7 @@ vim.api.nvim_create_autocmd("FileType", { end, }) +-- Delete number column on terminals vim.api.nvim_create_autocmd("TermOpen", { callback = function() vim.cmd("setlocal listchars= nonumber norelativenumber") diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index cb6b7bb3..12d606bd 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -26,7 +26,6 @@ map("x", "?", function() google(vim.fn.getreg("g"), false) end, { desc = "Google" }) -map("n", "ft", "") map("n", "fT", "") map("n", "", "zz") diff --git a/.config/nvim/lua/plugins/extras/coding/ai/gpt.lua b/.config/nvim/lua/plugins/extras/coding/ai/gpt.lua index 71ea64fc..67f5bd9f 100644 --- a/.config/nvim/lua/plugins/extras/coding/ai/gpt.lua +++ b/.config/nvim/lua/plugins/extras/coding/ai/gpt.lua @@ -93,6 +93,7 @@ return { }, { "voldikss/vim-floaterm", + optional = true, keys = { { "CT", diff --git a/.config/nvim/lua/plugins/extras/editor/package-info.lua b/.config/nvim/lua/plugins/extras/editor/package-info.lua index 1455cf50..d53a3526 100644 --- a/.config/nvim/lua/plugins/extras/editor/package-info.lua +++ b/.config/nvim/lua/plugins/extras/editor/package-info.lua @@ -36,6 +36,7 @@ return { }, { "voldikss/vim-floaterm", + optional = true, keys = { { "pp", diff --git a/.config/nvim/lua/plugins/floaterm.lua b/.config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua similarity index 84% rename from .config/nvim/lua/plugins/floaterm.lua rename to .config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua index e8d69eb5..3d35769a 100644 --- a/.config/nvim/lua/plugins/floaterm.lua +++ b/.config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua @@ -26,7 +26,6 @@ return { { "", "FloatermPrev", mode = { "t" }, desc = "Prev Terminal" }, { "", "FloatermLast", mode = { "t" }, desc = "Last Terminal" }, { "", "FloatermFirst", mode = { "t" }, desc = "First Terminal" }, - { "st", "Telescope floaterm", desc = "Terminals" }, { [[]], "FloatermToggle", mode = { "n", "t" }, desc = "Toggle Terminal" }, { "ftf", "FloatermNew --name=floatroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", desc = "Floating (root dir)" }, { "ftF", "FloatermNew --name=floatbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", desc = "Floating (cwd)" }, @@ -43,6 +42,9 @@ return { require("telescope").load_extension("floaterm") end) end, + keys = { + { "st", "Telescope floaterm", desc = "Terminals" }, + }, }, { "folke/which-key.nvim", @@ -54,4 +56,29 @@ return { }, }, }, + { + "folke/edgy.nvim", + optional = true, + opts = function(_, opts) + table.insert(opts.bottom, { + ft = "floaterm", + title = "Floaterm", + size = { height = 0.4 }, + filter = function(buf, win) + return vim.api.nvim_win_get_config(win).relative == "" + end, + }) + end, + }, + { + "goolord/alpha-nvim", + opts = function(_, dashboard) + -- stylua: ignore + local button = dashboard.button("G", "󰊢 " .. " Git", "FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit") + button.opts.hl = "AlphaButtons" + button.opts.hl_shortcut = "AlphaShortcut" + table.insert(dashboard.section.buttons.val, 7, button) + return dashboard + end, + }, } diff --git a/.config/nvim/lua/plugins/extras/ui/alpha.lua b/.config/nvim/lua/plugins/extras/ui/alpha.lua index ebd6d85d..4b90f3cc 100644 --- a/.config/nvim/lua/plugins/extras/ui/alpha.lua +++ b/.config/nvim/lua/plugins/extras/ui/alpha.lua @@ -16,11 +16,6 @@ return { ]] dashboard.section.header.val = vim.split(logo, "\n") - -- stylua: ignore - local button = dashboard.button("G", "󰊢 " .. " Git", "FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit") - button.opts.hl = "AlphaButtons" - button.opts.hl_shortcut = "AlphaShortcut" - table.insert(dashboard.section.buttons.val, 7, button) return dashboard end, } diff --git a/.config/nvim/lua/plugins/extras/ui/edgy.lua b/.config/nvim/lua/plugins/extras/ui/edgy.lua deleted file mode 100644 index b258058e..00000000 --- a/.config/nvim/lua/plugins/extras/ui/edgy.lua +++ /dev/null @@ -1,168 +0,0 @@ -return { - -- edgy - { - "folke/edgy.nvim", - event = "VeryLazy", - keys = { - { - "uE", - function() - require("edgy").select() - end, - desc = "Edgy Select Window", - }, - }, - opts = function() - local opts = { - bottom = { - { - ft = "floaterm", - title = "Floaterm", - size = { height = 0.4 }, - filter = function(buf, win) - return vim.api.nvim_win_get_config(win).relative == "" - end, - }, - { - ft = "noice", - size = { height = 0.4 }, - filter = function(buf, win) - return vim.api.nvim_win_get_config(win).relative == "" - end, - }, - "Trouble", - { - ft = "trouble", - filter = function(buf, win) - return vim.api.nvim_win_get_config(win).relative == "" - end, - }, - { ft = "qf", title = "QuickFix" }, - { - ft = "help", - size = { height = 20 }, - -- don't open help files in edgy that we're editing - filter = function(buf) - return vim.bo[buf].buftype == "help" - end, - }, - { title = "Spectre", ft = "spectre_panel", size = { height = 0.4 } }, - { title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } }, - }, - left = { - { - title = "Neo-Tree", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "filesystem" - end, - pinned = true, - open = function() - vim.api.nvim_input("e") - end, - size = { height = 0.5 }, - }, - { title = "Neotest Summary", ft = "neotest-summary" }, - { - title = "Neo-Tree Git", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "git_status" - end, - pinned = true, - open = "Neotree position=right git_status", - }, - { - title = "Neo-Tree Buffers", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "buffers" - end, - pinned = true, - open = "Neotree position=top buffers", - }, - "neo-tree", - }, - animate = { - enabled = false, - }, - keys = { - -- increase width - [""] = function(win) - win:resize("width", 2) - end, - -- decrease width - [""] = function(win) - win:resize("width", -2) - end, - -- increase height - [""] = function(win) - win:resize("height", 2) - end, - -- decrease height - [""] = function(win) - win:resize("height", -2) - end, - }, - } - return opts - end, - }, - - -- use edgy's selection window - { - "nvim-telescope/telescope.nvim", - optional = true, - opts = { - defaults = { - get_selection_window = function() - require("edgy").goto_main() - return 0 - end, - }, - }, - }, - - -- prevent neo-tree from opening files in edgy windows - { - "nvim-neo-tree/neo-tree.nvim", - optional = true, - opts = function(_, opts) - opts.open_files_do_not_replace_types = opts.open_files_do_not_replace_types - or { "terminal", "Trouble", "qf", "Outline", "trouble" } - table.insert(opts.open_files_do_not_replace_types, "edgy") - end, - }, - - -- Fix bufferline offsets when edgy is loaded - { - "akinsho/bufferline.nvim", - optional = true, - opts = function() - local Offset = require("bufferline.offset") - if not Offset.edgy then - local get = Offset.get - Offset.get = function() - if package.loaded.edgy then - local layout = require("edgy.config").layout - local ret = { left = "", left_size = 0, right = "", right_size = 0 } - for _, pos in ipairs({ "left", "right" }) do - local sb = layout[pos] - if sb and #sb.wins > 0 then - local title = " Sidebar" .. string.rep(" ", sb.bounds.width - 8) - ret[pos] = "%#EdgyTitle#" .. title .. "%*" .. "%#WinSeparator#│%*" - ret[pos .. "_size"] = sb.bounds.width - end - end - ret.total_size = ret.left_size + ret.right_size - if ret.total_size > 0 then - return ret - end - end - return get() - end - Offset.edgy = true - end - end, - }, -}