From f3c775b33bbf85e024da363696e9f415077951e7 Mon Sep 17 00:00:00 2001 From: Daniel Heras Quesada Date: Fri, 19 Sep 2025 14:35:29 +0200 Subject: [PATCH] feat: new utils + some styling --- lazy-lock.json | 53 ++++---- lua/plugins/code-utils.lua | 7 ++ lua/plugins/opts/bufferline.lua | 206 ++++++++++++++++---------------- lua/plugins/opts/lualine.lua | 78 ++++++------ 4 files changed, 176 insertions(+), 168 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 7dd77ec..3292036 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,35 +1,36 @@ { - "aerial.nvim": { "branch": "master", "commit": "2aeafd99937602fc40609ffffbdd2f99d77343e9" }, - "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, + "aerial.nvim": { "branch": "master", "commit": "c7cbbad40c2065fccfd1f1863bb2c08180c0533d" }, + "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "blueprints": { "branch": "main", "commit": "e5825c30464f98e77e8b5ffb88d59fd98df6c802" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" }, + "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "d8918f06624dd53b9a82bd0e29c31bcfd541b40d" }, - "indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "mini.clue": { "branch": "main", "commit": "2d361459de6a5fd7ea20a14ee4b95c6caec383b9" }, - "mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" }, + "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" }, "monkey-alert": { "branch": "main", "commit": "213a39f8161f80ce43e1a164a54fe796432422b8" }, - "neo-tree.nvim": { "branch": "main", "commit": "521bb4253b1adc2a1ff6c584bc839eba9bc99c0b" }, - "no-neck-pain.nvim": { "branch": "main", "commit": "860462dd8b3d36861a81724a7b473db279f673f2" }, - "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, - "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-treesitter": { "branch": "master", "commit": "d34e62afd3e483fe0fa2f24b6323f3bb1d35ddcc" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, - "nvim-web-devicons": { "branch": "master", "commit": "37334adf4517fecfd97c0b44e1d4718e377e9e52" }, - "nvim-window-picker": { "branch": "main", "commit": "0dfef64eaf063e1cd27983ab11a30e7bc5b74fac" }, + "neo-tree.nvim": { "branch": "main", "commit": "ed057048a281b418d5318dd5153f9486daa517a3" }, + "no-neck-pain.nvim": { "branch": "main", "commit": "0463fbb77bcab4cc9716ba1e87255bbe4d002de7" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "41847d3dafb5004464708a3db06b14f12bde548a" }, + "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, + "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, - "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, - "rose-pine": { "branch": "main", "commit": "72befaffeac38db7bdd49e0549eaa2c4806dd878" }, - "smear-cursor.nvim": { "branch": "main", "commit": "aff844fc1483fd673f721a41affcd7e2fcb885f5" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, - "telescope-git-file-history.nvim": { "branch": "master", "commit": "c27d99ba88ec5f0b6d2b9f9bc67dd3d14c610b25" }, - "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" }, + "smear-cursor.nvim": { "branch": "main", "commit": "4b86df8a0c5f46e708616b21a02493bb0e47ecbd" }, + "snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-git-file-history.nvim": { "branch": "master", "commit": "e7d495319f2a04df96402057a6992ea970f8914d" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "trouble.nvim": { "branch": "main", "commit": "50481f414bd3c1a40122c1d759d7e424d5fafe84" }, - "vim-fugitive": { "branch": "master", "commit": "d74a7cff4cfcf84f83cc7eccfa365488f3bbabc2" } + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" } } diff --git a/lua/plugins/code-utils.lua b/lua/plugins/code-utils.lua index 188848c..b4368f4 100644 --- a/lua/plugins/code-utils.lua +++ b/lua/plugins/code-utils.lua @@ -13,6 +13,13 @@ return { end, }, + { + "nvim-treesitter/nvim-treesitter-context", + opts = function() + return require("plugins.opts.treesitterContext") + end, + }, + -- │ Completion │ { "saghen/blink.cmp", diff --git a/lua/plugins/opts/bufferline.lua b/lua/plugins/opts/bufferline.lua index 3c1e049..096b6c2 100644 --- a/lua/plugins/opts/bufferline.lua +++ b/lua/plugins/opts/bufferline.lua @@ -1,107 +1,107 @@ local config = { - highlights = { - buffer_selected = { bold = true }, - diagnostic_selected = { bold = true }, - info_selected = { bold = true }, - info_diagnostic_selected = { bold = true }, - warning_selected = { bold = true }, - warning_diagnostic_selected = { bold = true }, - error_selected = { bold = true }, - error_diagnostic_selected = { bold = true }, - }, - options = { - themeable = true, - numbers = "none", - diagnostics = "nvim_lsp", -- or "coc" - max_prefix_length = 8, - close_command = "b# | bd#", - right_mouse_command = "b# | bd#", - left_mouse_command = "buffer %d", - buffer_close_icon = "󰅖", - modified_icon = "●", - close_icon = "", - left_trunc_marker = "", - right_trunc_marker = "", - max_name_length = 18, - truncate_names = true, - tab_size = 18, - color_icons = true, - show_buffer_icons = true, - show_buffer_close_icons = true, - show_tab_indicators = true, - duplicates_across_groups = true, -- whether to consider duplicate paths in different groups as duplicates - persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - separator_style = { "▏", "" }, -- { "▏", "" } | "slant" | "slope" | "thick" | "thin" | { 'any', 'any' }, - -- always_show_bufferline = false, - auto_toggle_bufferline = true, - show_close_icon = true, - hover = { - enabled = true, - delay = 200, - reveal = { "close" }, - }, - offsets = { - { - filetype = "neo-tree", - text = "", - highlight = "Directory", - separator = "", -- use a "true" to enable the default, or set your own character - }, - }, - groups = { - options = { - toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible - }, - items = { - { - name = "Tests", - highlight = { underline = true, sp = "blue" }, - priority = 2, - -- icon = " ", - matcher = function(buf) - return buf.path:match("%_test") or buf.path:match("%_spec") - end, - }, - { - name = "Docs", - -- icon = "󰈙 ", - highlight = { undercurl = false, sp = "green" }, - auto_close = false, - matcher = function(buf) - return buf.path:match("%.md") or buf.path:match("%.txt") - end, - separator = { - style = require("bufferline.groups").separator.tab, - }, - }, - { - name = "Shells", - highlight = { undercurl = false, sp = "grey" }, - auto_close = false, - matcher = function(buf) - return buf.path:match("zsh") - end, - separator = { - style = require("bufferline.groups").separator.tab, - }, - }, - { - name = "Docker", - highlight = { undercurl = false, sp = "blue" }, - auto_close = false, - matcher = function(buf) - return buf.path:match("dockerfile") - or buf.path:match("DOCKERFILE") - or buf.path:match("Dockerfile") - or buf.path:match("docker%-compose%.yml") - end, - separator = { - style = require("bufferline.groups").separator.tab, - }, - }, - }, - }, - }, + highlights = { + buffer_selected = { bold = true }, + diagnostic_selected = { bold = true }, + info_selected = { bold = true }, + info_diagnostic_selected = { bold = true }, + warning_selected = { bold = true }, + warning_diagnostic_selected = { bold = true }, + error_selected = { bold = true }, + error_diagnostic_selected = { bold = true }, + }, + options = { + themeable = true, + numbers = "none", + diagnostics = "nvim_lsp", -- or "coc" + max_prefix_length = 8, + close_command = "b# | bd#", + right_mouse_command = "b# | bd#", + left_mouse_command = "buffer %d", + buffer_close_icon = "󰅖", + modified_icon = "●", + close_icon = "", + left_trunc_marker = "", + right_trunc_marker = "", + max_name_length = 18, + truncate_names = true, + tab_size = 18, + color_icons = true, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_tab_indicators = true, + duplicates_across_groups = true, -- whether to consider duplicate paths in different groups as duplicates + persist_buffer_sort = true, -- whether or not custom sorted buffers should persist + separator_style = { "▏", "" }, -- { "▏", "" } | "slant" | "slope" | "thick" | "thin" | { 'any', 'any' }, + -- always_show_bufferline = false, + auto_toggle_bufferline = true, + show_close_icon = true, + hover = { + enabled = true, + delay = 200, + reveal = { "close" }, + }, + offsets = { + { + filetype = "neo-tree", + text = "", + highlight = "Directory", + separator = "", -- use a "true" to enable the default, or set your own character + }, + }, + groups = { + options = { + toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible + }, + items = { + { + name = "Tests", + highlight = { underline = true, sp = "blue" }, + priority = 2, + -- icon = " ", + matcher = function(buf) + return buf.path:match("%_test") or buf.path:match("%_spec") + end, + }, + { + name = "Docs", + -- icon = "󰈙 ", + highlight = { undercurl = false, sp = "green" }, + auto_close = false, + matcher = function(buf) + return buf.path:match("%.md") or buf.path:match("%.txt") + end, + separator = { + style = require("bufferline.groups").separator.tab, + }, + }, + { + name = "Shells", + highlight = { undercurl = false, sp = "grey" }, + auto_close = false, + matcher = function(buf) + return buf.path:match("zsh") + end, + separator = { + style = require("bufferline.groups").separator.tab, + }, + }, + { + name = "Docker", + highlight = { undercurl = false, sp = "blue" }, + auto_close = false, + matcher = function(buf) + return buf.path:match("dockerfile") + or buf.path:match("DOCKERFILE") + or buf.path:match("Dockerfile") + or buf.path:match("docker%-compose%.yml") + end, + separator = { + style = require("bufferline.groups").separator.tab, + }, + }, + }, + }, + }, } return config diff --git a/lua/plugins/opts/lualine.lua b/lua/plugins/opts/lualine.lua index e314ec3..071fd62 100644 --- a/lua/plugins/opts/lualine.lua +++ b/lua/plugins/opts/lualine.lua @@ -1,43 +1,43 @@ local options = { - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "╎", right = "╎" }, - section_separators = { left = "┃", right = "┃" }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = true, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - }, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff" }, - lualine_c = { "filename" }, - lualine_x = { "diagnostics", "filetype", "encoding", "fileformat" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {}, + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "•", right = "•" }, + section_separators = { left = "┃", right = "┃" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = true, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff" }, + lualine_c = { "filename" }, + lualine_x = { "diagnostics", "filetype", "encoding", "fileformat" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, } return options