refactor: bufferline replaced + minor styling improvements WIP
This commit is contained in:
7
init.lua
7
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 = " ",
|
||||
}
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -13,17 +13,17 @@ local map = vim.keymap.set
|
||||
---- Bufferline ----
|
||||
-- Not used but maybe in the future
|
||||
-- map("n", "bg", "<CMD>BufferLinePick<CR>")
|
||||
-- TODO: implement close others
|
||||
-- map("n", "<leader>bpx", "<CMD>BufferLinePickClose<CR>")
|
||||
map("n", "<leader>box", "<CMD>BufferLineCloseOthers<CR>")
|
||||
map("n", "<Tab>", "<CMD>BufferLineCycleNext<CR>")
|
||||
map("n", "<S-Tab>", "<CMD>BufferLineCyclePrev<CR>")
|
||||
map("n", "<leader>bsd", "<CMD>BufferLineSortByDirectory<CR>")
|
||||
map("n", "<leader>bse", "<CMD>BufferLineSortByExtension<CR>")
|
||||
map("n", "<leader>bsr", "<CMD>BufferLineSortByRelativeDirectory<CR>")
|
||||
map("n", "<leader>bst", "<CMD>BufferLineSortByTabs<CR>")
|
||||
-- map("n", "<leader>box", "<CMD>BufferLineCloseOthers<CR>")
|
||||
map("n", "<Tab>", "<CMD>bnext<CR>")
|
||||
map("n", "<S-Tab>", "<CMD>bprevious<CR>")
|
||||
map("n", "<leader>bsd", "<CMD>BufferOrderByDirectory<CR>")
|
||||
map("n", "<leader>bse", "<CMD>BufferOrderByLanguage<CR>")
|
||||
map("n", "<leader>bsb", "<CMD>BufferOrderByBufferNumber<CR>")
|
||||
-- buffers
|
||||
map("n", "<S-h>", "<cmd>BufferLineMovePrev<cr>", { desc = "Move buffer to left" })
|
||||
map("n", "<S-l>", "<cmd>BufferLineMoveNext<cr>", { desc = "Move buffer to right" })
|
||||
map("n", "<S-h>", "<cmd>BufferMovePrevious<cr>", { desc = "Move buffer to left" })
|
||||
map("n", "<S-l>", "<cmd>BufferMoveNext<cr>", { desc = "Move buffer to right" })
|
||||
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
||||
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next Buffer" })
|
||||
map("n", "<leader>bd", function()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user