From 0a8097295b3586c64de6c5f51797319b94ad2197 Mon Sep 17 00:00:00 2001 From: Ward Truyen Date: Mon, 20 Apr 2026 14:18:25 +0200 Subject: [PATCH] feat: config update April --- lua/ward/init.lua | 1 + lua/ward/plugins/bufferline.lua | 64 ++++++++++++++---------- lua/ward/plugins/nvim-tree.lua | 88 +++++++++++++++++++-------------- lua/ward/plugins/statusline.lua | 27 +++++----- lua/ward/remap.lua | 2 +- 5 files changed, 105 insertions(+), 77 deletions(-) diff --git a/lua/ward/init.lua b/lua/ward/init.lua index a7576db..f8b2361 100644 --- a/lua/ward/init.lua +++ b/lua/ward/init.lua @@ -12,6 +12,7 @@ require("ward.lazy") if vim.g.neovide then vim.g.neovide_opacity = 0.75 vim.g.neovide_window_blurred = true + -- vim.o.guifont = "Source Code Pro:h12" -- Increase/Decrease scale factor local change_scale_factor = function(delta) diff --git a/lua/ward/plugins/bufferline.lua b/lua/ward/plugins/bufferline.lua index b5d6844..abbf646 100644 --- a/lua/ward/plugins/bufferline.lua +++ b/lua/ward/plugins/bufferline.lua @@ -2,31 +2,43 @@ --$ URL: https://github.com/akinsho/bufferline.nvim --$ :help bufferline return { - 'akinsho/bufferline.nvim', - version = "*", - dependencies = 'nvim-tree/nvim-web-devicons', + "akinsho/bufferline.nvim", + version = "*", + dependencies = "nvim-tree/nvim-web-devicons", - config = function() - require("bufferline").setup({ - options = { - buffer_close_icon = '󰅖', - offsets = { - { - filetype = "NvimTree", - text = "File Explorer", - separator = true, - }, - }, - diagnostics = "nvim_lsp", - diagnostics_indicator = function(count, level, diagnostics_dict, context) - local s = " " - for e, n in pairs(diagnostics_dict) do - local sym = e == "error" and " " or (e == "warning" and " " or "") - s = s .. n .. sym - end - return s - end, - } - }) - end, + config = function() + require("bufferline").setup({ + options = { + right_mouse_command = "BufferLineTogglePin", + buffer_close_icon = "󰅖", + offsets = { + { + filetype = "NvimTree", + text = "File Explorer", + highlight = "Directory", + separator = true, + }, + }, + diagnostics = "nvim_lsp", + diagnostics_indicator = function(count, level, diagnostics_dict, context) + local s = " " + for e, n in pairs(diagnostics_dict) do + local sym = e == "error" and " " or (e == "warning" and " " or "") + s = s .. n .. sym + end + return s + end, + }, + }) + local wk = require("which-key") + wk.add({ + { "bs", group = "Sort buffers" }, -- Group + { "bsp", "BufferLineTogglePin", desc = "pin" }, + { "bse", "BufferLineSortByExtension", desc = "Sort by extension" }, + { "bsd", "BufferLineSortByDirectory", desc = "Sort by directory" }, + { "bst", "BufferLineSortByTabs", desc = "Sort by tabs" }, + { "bsh", "BufferLineMovePrev", desc = "Sort by tabs" }, + { "bsl", "BufferLineMoveNext", desc = "Sort by tabs" }, + }) + end, } diff --git a/lua/ward/plugins/nvim-tree.lua b/lua/ward/plugins/nvim-tree.lua index 4a9d7c2..e32db23 100644 --- a/lua/ward/plugins/nvim-tree.lua +++ b/lua/ward/plugins/nvim-tree.lua @@ -2,47 +2,61 @@ --$ URL: https://github.com/nvim-tree/nvim-tree.lua --$ :help nvim-tree return { - "nvim-tree/nvim-tree.lua", - version = "*", - lazy = false, - dependencies = { - "nvim-tree/nvim-web-devicons", - }, + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, - config = function() - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - require("nvim-tree").setup({ - view = { - width = 42, - relativenumber = true, - }, - filters = { - git_ignored = false, - }, - actions = { - open_file = { - quit_on_open = true, + config = function() + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + require("nvim-tree").setup({ + view = { + width = 42, + relativenumber = true, + }, + renderer = { + indent_markers = { + enable = true, + }, + icons = { + show = { + folder_arrow = false, + } }, - }, - on_attach = function(bufnr) - local api = require "nvim-tree.api" + }, + filters = { + git_ignored = false, + }, + actions = { + open_file = { + quit_on_open = true, + }, + }, + on_attach = function(bufnr) + local api = require("nvim-tree.api") - local function opts(desc) - return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } - end + local function opts(desc) + return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } + end - -- default mappings - api.config.mappings.default_on_attach(bufnr) + -- default mappings + api.config.mappings.default_on_attach(bufnr) - -- custom mappings - vim.keymap.set('n', '', vim.cmd.NvimTreeClose, opts('Close Explorer')) - -- vim.keymap.set('n', '', api.tree.change_root_to_parent, opts('Up')) - vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help')) - end, - }) + -- custom mappings + vim.keymap.set("n", "", vim.cmd.NvimTreeClose, opts("Close Explorer")) + -- vim.keymap.set('n', '', api.tree.change_root_to_parent, opts('Up')) + vim.keymap.set("n", "?", api.tree.toggle_help, opts("Help")) + end, + }) - vim.keymap.set("n", "e", vim.cmd.NvimTreeToggle, { desc = "Explorer" }) - vim.api.nvim_create_autocmd({ "QuitPre" }, { callback = function() vim.cmd("NvimTreeClose") end, }) - end, + vim.keymap.set("n", "e", vim.cmd.NvimTreeToggle, { desc = "Explorer" }) + vim.api.nvim_create_autocmd({ "QuitPre" }, { + callback = function() + vim.cmd("NvimTreeClose") + end, + }) + end, } diff --git a/lua/ward/plugins/statusline.lua b/lua/ward/plugins/statusline.lua index fe002a1..e4c762e 100644 --- a/lua/ward/plugins/statusline.lua +++ b/lua/ward/plugins/statusline.lua @@ -1,16 +1,17 @@ return { - -- The bar at the bottom - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, + -- The bar at the bottom + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("lualine").setup({ - options = { - globalstatus = true, -- enable global statusline (have a single statusline - }, - sections = { - lualine_x = { "filetype" }, - }, - }) - end, + config = function() + require("lualine").setup({ + options = { + globalstatus = true, -- enable global statusline (have a single statusline + }, + sections = { + lualine_x = { "filetype" }, + }, + extensions = { "nvim-tree" }, + }) + end, } diff --git a/lua/ward/remap.lua b/lua/ward/remap.lua index f22db23..67c6b94 100644 --- a/lua/ward/remap.lua +++ b/lua/ward/remap.lua @@ -1,4 +1,4 @@ ---$ My default keymap settings, some plugins can add and overwrite these keymap settings +--$ I'll have all my standard remappings here, some plugins will add and overwrite --$ Leaders go first vim.g.mapleader = " " vim.g.maplocalleader = "\\"