From 3719efd378ffbbd54bbedd1be7b351bd13031875 Mon Sep 17 00:00:00 2001 From: Daniel Heras Quesada Date: Sun, 10 May 2026 18:38:52 +0200 Subject: [PATCH] feat: minor styling adjustments + tab buffer division --- lazy-lock.json | 3 +- lua/config/autocmds.lua | 21 +++--- lua/config/remap.lua | 4 -- lua/plugins/context.lua | 3 + lua/plugins/floatingterminal.lua | 57 --------------- lua/plugins/opts/bufferline.lua | 12 +++- lua/plugins/opts/lualine.lua | 13 ++++ lua/plugins/opts/telescope.lua | 116 +++++++++++++++---------------- lua/plugins/style.lua | 9 +-- 9 files changed, 97 insertions(+), 141 deletions(-) delete mode 100644 lua/plugins/floatingterminal.lua diff --git a/lazy-lock.json b/lazy-lock.json index 33879e3..892012a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -15,8 +15,6 @@ "grug-far.nvim": { "branch": "main", "commit": "21790e59dd0109a92a70cb874dd002af186314f5" }, "gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, - "koda.nvim": { "branch": "main", "commit": "4668e307f2f3a1e38bd627b14d13368ebf5b8d9f" }, - "komau.vim": { "branch": "master", "commit": "800bd5c9ace33f9cab2dd7f4004369cee18bebde" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" }, "mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" }, @@ -36,6 +34,7 @@ "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, "overseer.nvim": { "branch": "master", "commit": "f818eefff81f4b12fb7cf236f1b6c16768a2fcbc" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "scope.nvim": { "branch": "main", "commit": "228aabdb1b9cc74f0c0ccec88e79873857236e49" }, "smear-cursor.nvim": { "branch": "main", "commit": "9e9378d6ee34bb3782e0e8c63d9ec8ca618b479b" }, "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 53838b8..07644f2 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -1,12 +1,13 @@ local autocmd = vim.api.nvim_create_autocmd -autocmd("ModeChanged", { - callback = function(opts) - require("lualine").refresh() - end, -}) -autocmd("CursorMoved", { - callback = function(opts) - require("lualine").refresh() - end, -}) +-- Replaced with config field, kept in case of issues +-- autocmd("ModeChanged", { +-- callback = function(opts) +-- require("lualine").refresh() +-- end, +-- }) +-- autocmd("CursorMoved", { +-- callback = function(opts) +-- require("lualine").refresh() +-- end, +-- }) diff --git a/lua/config/remap.lua b/lua/config/remap.lua index 13554e6..4b82288 100644 --- a/lua/config/remap.lua +++ b/lua/config/remap.lua @@ -274,10 +274,6 @@ map("n", "ua", "AerialToggle", { desc = "Toggle aerial view" }) map("n", "ui", vim.show_pos, { desc = "Inspect Pos" }) map("n", "uI", "InspectTree", { desc = "Inspect Tree" }) ----- Terminal ---- - -map({ "n", "t" }, "tt", "Floaterminal", { desc = "Toggle terminal" }) - -- Terminal Mappings map("t", "", "", { desc = "Enter Normal Mode" }) map("t", "", "wincmd h", { desc = "Go to Left Window" }) diff --git a/lua/plugins/context.lua b/lua/plugins/context.lua index 81e5735..3fb1260 100644 --- a/lua/plugins/context.lua +++ b/lua/plugins/context.lua @@ -11,6 +11,9 @@ return { end, }, + -- Have buffers by tab + { "tiagovla/scope.nvim", config = true }, + { "nvim-lualine/lualine.nvim", event = "VeryLazy", diff --git a/lua/plugins/floatingterminal.lua b/lua/plugins/floatingterminal.lua deleted file mode 100644 index 6933767..0000000 --- a/lua/plugins/floatingterminal.lua +++ /dev/null @@ -1,57 +0,0 @@ -vim.keymap.set("t", "", "") - -local state = { - floating = { - buf = -1, - win = -1, - }, -} - -local function create_floating_window(opts) - opts = opts or {} - local width = opts.width or math.floor(vim.o.columns * 0.8) - local height = opts.height or math.floor(vim.o.lines * 0.8) - - -- Calculate the position to center the window - local col = math.floor((vim.o.columns - width) / 2) - local row = math.floor((vim.o.lines - height) / 2) - - -- Create a buffer - local buf = nil - if vim.api.nvim_buf_is_valid(opts.buf) then - buf = opts.buf - else - buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer - end - - -- Define window configuration - local win_config = { - relative = "editor", - width = width, - height = height, - col = col, - row = row, - style = "minimal", -- No borders or extra UI elements - border = "rounded", - } - - -- Create the floating window - local win = vim.api.nvim_open_win(buf, true, win_config) - - return { buf = buf, win = win } -end - -local toggle_terminal = function() - if not vim.api.nvim_win_is_valid(state.floating.win) then - state.floating = create_floating_window({ buf = state.floating.buf }) - if vim.bo[state.floating.buf].buftype ~= "terminal" then - vim.cmd.terminal() - end - else - vim.api.nvim_win_hide(state.floating.win) - end -end - --- Example usage: --- Create a floating window with default dimensions -vim.api.nvim_create_user_command("Floaterminal", toggle_terminal, {}) diff --git a/lua/plugins/opts/bufferline.lua b/lua/plugins/opts/bufferline.lua index 83131c2..54f1af4 100644 --- a/lua/plugins/opts/bufferline.lua +++ b/lua/plugins/opts/bufferline.lua @@ -43,9 +43,15 @@ local config = { offsets = { { filetype = "neo-tree", - text = "", - highlight = "Directory", - separator = " ", -- use a "true" to enable the default, or set your own character + text = "", --  , ,  + highlight = "Filler", + + -- text = function() + -- return vim.fn.getcwd() + -- end, + -- highlight = "Directory", + -- text_align = "left", + separator = "", -- use a "true" to enable the default, or set your own character }, }, groups = { diff --git a/lua/plugins/opts/lualine.lua b/lua/plugins/opts/lualine.lua index 071fd62..bbec906 100644 --- a/lua/plugins/opts/lualine.lua +++ b/lua/plugins/opts/lualine.lua @@ -16,6 +16,19 @@ local options = { statusline = 1000, tabline = 1000, winbar = 1000, + refresh_time = 16, -- ~60fps + events = { + "WinEnter", + "BufEnter", + "BufWritePost", + "SessionLoadPost", + "FileChangedShellPost", + "VimResized", + "Filetype", + "CursorMoved", + "CursorMovedI", + "ModeChanged", + }, }, }, sections = { diff --git a/lua/plugins/opts/telescope.lua b/lua/plugins/opts/telescope.lua index ed90e68..2d84dba 100644 --- a/lua/plugins/opts/telescope.lua +++ b/lua/plugins/opts/telescope.lua @@ -1,63 +1,63 @@ local options = { - defaults = { - vimgrep_arguments = { - "rg", - "-L", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - file_ignore_patterns = { "node_modules" }, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, - mappings = { - n = { ["q"] = require("telescope.actions").close }, - }, - }, + defaults = { + vimgrep_arguments = { + "rg", + "-L", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + }, + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "ascending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8, + }, + vertical = { + mirror = false, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + file_sorter = require("telescope.sorters").get_fuzzy_file, + file_ignore_patterns = { "node_modules" }, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + path_display = { "truncate" }, + winblend = 0, -- transparency + border = {}, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, + file_previewer = require("telescope.previewers").vim_buffer_cat.new, + grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, + qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, + -- Developer configurations: Not meant for general override + buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, + mappings = { + n = { ["q"] = require("telescope.actions").close }, + }, + }, - extensions_list = { "fzf" }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, + extensions_list = { "fzf" }, + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + }, + }, } return options diff --git a/lua/plugins/style.lua b/lua/plugins/style.lua index 46ec8a8..470441c 100644 --- a/lua/plugins/style.lua +++ b/lua/plugins/style.lua @@ -11,13 +11,8 @@ return { -- }, -- }, { - "oskarnurm/koda.nvim", - lazy = false, - priority = 1000, - }, - { - "dqnid/komau.vim", - -- dir = "~/Documents/Code/komau.vim", + -- "dqnid/komau.vim", + dir = "~/Documents/Code/komau.vim", opts = { style = "auto", -- "dark" | "light" | "auto" (uses &background) transparent = false,