change plugin that dispaly open buffers to barbar
This commit is contained in:
parent
c4d5d71820
commit
b6ca00b2ae
3 changed files with 66 additions and 15 deletions
2
init.lua
2
init.lua
|
|
@ -46,7 +46,7 @@ opt.breakindent = true
|
||||||
opt.foldmethod = "expr"
|
opt.foldmethod = "expr"
|
||||||
opt.foldlevelstart = 99
|
opt.foldlevelstart = 99
|
||||||
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
opt.sessionoptions = 'blank,buffers,curdir,help,tabpages,winsize,terminal'
|
opt.sessionoptions = 'blank,buffers,curdir,help,tabpages,winsize,terminal,globals'
|
||||||
|
|
||||||
require("bootstrap")
|
require("bootstrap")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,17 @@ s("i", "<C-l>", "<Right>", { desc = "Move right" })
|
||||||
s("i", "<C-j>", "<Down>", { desc = "Move down" })
|
s("i", "<C-j>", "<Down>", { desc = "Move down" })
|
||||||
s("i", "<C-k>", "<Up>", { desc = "Move up" })
|
s("i", "<C-k>", "<Up>", { desc = "Move up" })
|
||||||
s("n", "<Esc>", ":noh<CR>", { desc = "Clear highlights" })
|
s("n", "<Esc>", ":noh<CR>", { desc = "Clear highlights" })
|
||||||
s("n", "<leader>b", "<cmd> enew <CR>", { desc = "New buffer" })
|
|
||||||
s("n", "<leader>x", "<cmd> bdelete <CR>", { desc = "Delete buffer" })
|
|
||||||
s("n", "<leader>!x", "<cmd> bdelete! <CR>", { desc = "Delete buffer !" })
|
s("n", "<leader>!x", "<cmd> bdelete! <CR>", { desc = "Delete buffer !" })
|
||||||
s("n", "<a-c-j>", "<cmd> bn <CR>", { desc = "Next buffer" })
|
|
||||||
s("n", "<a-c-k>", "<cmd> bp <CR>", { desc = "Previous buffer" })
|
s("n", "<leader>x", "<cmd> BufferClose <CR>", { desc = "Delete buffer" })
|
||||||
|
s("n", "<leader>X", "<cmd> BufferCloseAllButPinned <CR>", { desc = "Delete all buffers except pinned" })
|
||||||
|
s("n", "<a-c-j>", "<cmd> BufferMoveNext <CR>", { desc = "Move buffer forward" })
|
||||||
|
s("n", "<a-c-k>", "<cmd> BufferMovePrevious <CR>", { desc = "Move buffer backward" })
|
||||||
|
s("n", "<a-j>", "<cmd> BufferNext <CR>", { desc = "Next buffer" })
|
||||||
|
s("n", "<a-k>", "<cmd> BufferPrevious <CR>", { desc = "Previous buffer" })
|
||||||
|
s('n', '<leader>p', "<cmd> BufferPin <cr>", { desc = "Pin/Unpin buffer" })
|
||||||
|
|
||||||
|
|
||||||
s("n", "ZZ", "<cmd> q! <CR>", { desc = "Quit without saving" })
|
s("n", "ZZ", "<cmd> q! <CR>", { desc = "Quit without saving" })
|
||||||
s("n", "q:", "<nop>")
|
s("n", "q:", "<nop>")
|
||||||
s('n', 'H', require('treesj').toggle)
|
s('n', 'H', require('treesj').toggle)
|
||||||
|
|
@ -115,8 +121,8 @@ s('n', '<f7>', dap.step_over, { desc = "Step over" })
|
||||||
s('n', '<f8>', dap.step_out, { desc = "Step out" })
|
s('n', '<f8>', dap.step_out, { desc = "Step out" })
|
||||||
s('n', '<f9>', dap.run_to_cursor, { desc = "Run to cursor" })
|
s('n', '<f9>', dap.run_to_cursor, { desc = "Run to cursor" })
|
||||||
s('n', '<f10>', dap.step_back, { desc = "Step back" })
|
s('n', '<f10>', dap.step_back, { desc = "Step back" })
|
||||||
s('n', '<A-j>', dap.up, { desc = "Up" })
|
s('n', '<A-u>', dap.up, { desc = "Up" })
|
||||||
s('n', '<A-k>', dap.down, { desc = "Down" })
|
s('n', '<A-d>', dap.down, { desc = "Down" })
|
||||||
-- s('n', '<rightmouse>', dapui.eval, { desc = "Eval" })
|
-- s('n', '<rightmouse>', dapui.eval, { desc = "Eval" })
|
||||||
-- s('n', '<rightmouse>', '<LeftMouse> :lua require("dapui").eval()<cr>', { desc = "Eval" })
|
-- s('n', '<rightmouse>', '<LeftMouse> :lua require("dapui").eval()<cr>', { desc = "Eval" })
|
||||||
s('n', '<f12>', function()
|
s('n', '<f12>', function()
|
||||||
|
|
|
||||||
|
|
@ -161,14 +161,58 @@ local plugins = {
|
||||||
opts = require("configs.lualine")
|
opts = require("configs.lualine")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'akinsho/bufferline.nvim',
|
'romgrk/barbar.nvim',
|
||||||
version = "*",
|
dependencies = {
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons', 'catppuccin' },
|
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||||
config = function()
|
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||||
require("bufferline").setup({
|
},
|
||||||
highlights = require("catppuccin.groups.integrations.bufferline").get()
|
init = function()
|
||||||
})
|
vim.g.barbar_auto_setup = false
|
||||||
end
|
end,
|
||||||
|
opts = {
|
||||||
|
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||||
|
-- animation = true,
|
||||||
|
icons = {
|
||||||
|
-- Configure the base icons on the bufferline.
|
||||||
|
-- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript'
|
||||||
|
buffer_index = false,
|
||||||
|
buffer_number = false,
|
||||||
|
gitsigns = {
|
||||||
|
added = { enabled = false, icon = '+' },
|
||||||
|
changed = { enabled = false, icon = '~' },
|
||||||
|
deleted = { enabled = false, icon = '-' },
|
||||||
|
},
|
||||||
|
filetype = {
|
||||||
|
-- Sets the icon's highlight group.
|
||||||
|
-- If false, will use nvim-web-devicons colors
|
||||||
|
custom_colors = false,
|
||||||
|
|
||||||
|
-- Requires `nvim-web-devicons` if `true`
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
separator = { left = '▎', right = '' },
|
||||||
|
|
||||||
|
-- If true, add an additional separator at the end of the buffer list
|
||||||
|
separator_at_end = true,
|
||||||
|
|
||||||
|
-- Configure the icons on the bufferline when modified or pinned.
|
||||||
|
-- Supports all the base icon options.
|
||||||
|
modified = { button = '●' },
|
||||||
|
pinned = { button = '', filename = true },
|
||||||
|
|
||||||
|
-- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted'
|
||||||
|
preset = 'default',
|
||||||
|
|
||||||
|
-- Configure the icons on the bufferline based on the visibility of a buffer.
|
||||||
|
-- Supports all the base icon options, plus `modified` and `pinned`.
|
||||||
|
alternate = { filetype = { enabled = false } },
|
||||||
|
current = { buffer_index = false },
|
||||||
|
inactive = { button = '×' },
|
||||||
|
visible = { modified = { buffer_number = false } },
|
||||||
|
},
|
||||||
|
-- …etc.
|
||||||
|
},
|
||||||
|
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'numToStr/Comment.nvim',
|
'numToStr/Comment.nvim',
|
||||||
|
|
@ -200,6 +244,7 @@ local plugins = {
|
||||||
pre_save_cmds = {
|
pre_save_cmds = {
|
||||||
function()
|
function()
|
||||||
require("dap-utils").store_breakpoints("./.breakpoints")
|
require("dap-utils").store_breakpoints("./.breakpoints")
|
||||||
|
vim.api.nvim_exec_autocmds('User', {pattern = 'SessionSavePre'})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
post_restore_cmds = {
|
post_restore_cmds = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue