diff --git a/init.lua b/init.lua index af776f6..e084d70 100644 --- a/init.lua +++ b/init.lua @@ -19,14 +19,15 @@ vim.cmd("set tabstop=4") vim.cmd("set shiftwidth=4") vim.cmd("set noexpandtab") -- expandtab to use spaces instead of tabs vim.cmd("set wrap") +vim.cmd("set cmdheight=0") -- HACK: hide command line while is not being used, no idea why this works without logic vim.lsp.inlay_hint.enable(false) vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" -- ╭─────────────╮ -- │ Colorscheme │ -- ╰─────────────╯ -vim.cmd("colorscheme komau") -- rose-pine, gruvbox, koda-{dark/light/moss/glade}, komau -vim.o.background = "dark" -- "dark" or "light" +vim.cmd("colorscheme gruvbox") -- rose-pine, gruvbox, koda-{dark/light/moss/glade}, komau +vim.o.background = "light" -- "dark" or "light" -- ╭───────────────────╮ -- │ Default clipboard │ @@ -38,7 +39,7 @@ vim.cmd("set clipboard=unnamedplus") -- ╰───────╯ vim.opt.fillchars = { -- horiz = "-", - -- vert = "▏", -- │ ▎▍▌▋▊▉█ + -- vert = "▏", -- ▏│ ▎▍▌▋▊▉█ stl = " ", eob = " ", } diff --git a/lazy-lock.json b/lazy-lock.json index 6edb065..7298d1f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,9 +2,9 @@ "aerial.nvim": { "branch": "master", "commit": "28fe6e822ae344544c379d60fcb13c9519a1f08a" }, "auto-session": { "branch": "main", "commit": "6cde3874a9283c2db55627acca5f28e4fa402320" }, "autoclose.nvim": { "branch": "main", "commit": "27063904b2238ce7867e430885b6abcfb08357ea" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "blueprints": { "branch": "main", "commit": "e5825c30464f98e77e8b5ffb88d59fd98df6c802" }, - "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, "flash.nvim": { "branch": "main", "commit": "b6346946d10d07998efee029fb0f7a593806d0cd" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 07644f2..c8c98c6 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -11,3 +11,8 @@ local autocmd = vim.api.nvim_create_autocmd -- require("lualine").refresh() -- end, -- }) +vim.api.nvim_create_autocmd("BufWritePost", { + callback = function(event) + vim.notify(("Saved: %s"):format(vim.fn.fnamemodify(event.file, ":t")), vim.log.levels.INFO) + end, +}) diff --git a/lua/config/remap.lua b/lua/config/remap.lua index cab5a6b..2d03fa6 100644 --- a/lua/config/remap.lua +++ b/lua/config/remap.lua @@ -13,17 +13,17 @@ local map = vim.keymap.set ---- Bufferline ---- -- Not used but maybe in the future -- map("n", "bg", "BufferLinePick") +-- TODO: implement close others -- map("n", "bpx", "BufferLinePickClose") -map("n", "box", "BufferLineCloseOthers") -map("n", "", "BufferLineCycleNext") -map("n", "", "BufferLineCyclePrev") -map("n", "bsd", "BufferLineSortByDirectory") -map("n", "bse", "BufferLineSortByExtension") -map("n", "bsr", "BufferLineSortByRelativeDirectory") -map("n", "bst", "BufferLineSortByTabs") +-- map("n", "box", "BufferLineCloseOthers") +map("n", "", "bnext") +map("n", "", "bprevious") +map("n", "bsd", "BufferOrderByDirectory") +map("n", "bse", "BufferOrderByLanguage") +map("n", "bsb", "BufferOrderByBufferNumber") -- buffers -map("n", "", "BufferLineMovePrev", { desc = "Move buffer to left" }) -map("n", "", "BufferLineMoveNext", { desc = "Move buffer to right" }) +map("n", "", "BufferMovePrevious", { desc = "Move buffer to left" }) +map("n", "", "BufferMoveNext", { desc = "Move buffer to right" }) map("n", "[b", "bprevious", { desc = "Prev Buffer" }) map("n", "]b", "bnext", { desc = "Next Buffer" }) map("n", "bd", function() diff --git a/lua/plugins/context.lua b/lua/plugins/context.lua index debbaca..88b561b 100644 --- a/lua/plugins/context.lua +++ b/lua/plugins/context.lua @@ -3,12 +3,21 @@ -- ╰─────────╯ return { { - "akinsho/bufferline.nvim", - version = "*", - dependencies = "nvim-tree/nvim-web-devicons", - opts = function() - return require("plugins.opts.bufferline") + "romgrk/barbar.nvim", + dependencies = { + "lewis6991/gitsigns.nvim", -- OPTIONAL: for git status + "nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons + }, + init = function() + vim.g.barbar_auto_setup = false end, + config = function(_, opts) + require("barbar").setup(opts) + end, + opts = { + animation = false, + }, + version = "^1.0.0", -- optional: only update when a new 1.x version is released }, -- Have buffers by tab diff --git a/lua/plugins/opts/bufferline.lua b/lua/plugins/opts/bufferline.lua deleted file mode 100644 index 6143856..0000000 --- a/lua/plugins/opts/bufferline.lua +++ /dev/null @@ -1,118 +0,0 @@ -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 = false, -- or "nvim_lsp", "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 = "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 = { - 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", - -- -- icon = "󰙨 ", - -- highlight = { underline = false }, - -- priority = 2, - -- matcher = function(buf) - -- return buf.path:match("%.test") or buf.path:match("%_test") or buf.path:match("%_spec") - -- end, - -- }, - -- { - -- name = "Docs", - -- -- icon = "󰈙 ", - -- priority = 3, - -- -- highlight = { undercurl = false, sp = "grey" }, - -- highlight = { undercurl = false }, - -- 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 = "Sh", - -- icon = " ", - highlight = { undercurl = false }, - auto_close = false, - priority = 4, - matcher = function(buf) - return buf.path:match("zsh") - end, - separator = { - style = require("bufferline.groups").separator.tab, - }, - }, - { - name = "Container", - highlight = { undercurl = false }, - auto_close = false, - -- icon = " ", - 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/style.lua b/lua/plugins/style.lua index f7486d8..1a8f0a1 100644 --- a/lua/plugins/style.lua +++ b/lua/plugins/style.lua @@ -57,7 +57,7 @@ return { invert_signs = false, invert_tabline = false, inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "", -- can be "hard", "soft" or empty string + contrast = "soft", -- can be "hard", "soft" or empty string palette_overrides = {}, overrides = {}, dim_inactive = false,