mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
chore(vim): add bufferline.nvim and configuration
This commit is contained in:
@@ -4,3 +4,4 @@ source ~/.config/nvim/plugins/autopairs.lua
|
||||
source ~/.config/nvim/plugins/base16.vim
|
||||
source ~/.config/nvim/plugins/blamer.vim
|
||||
source ~/.config/nvim/plugins/bookmarks.vim
|
||||
source ~/.config/nvim/plugins/bufferline.lua
|
||||
|
||||
@@ -14,6 +14,7 @@ call plug#begin(data_dir . '/plugins')
|
||||
Plug 'chriskempson/base16-vim'
|
||||
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||
Plug 'akinsho/bufferline.nvim'
|
||||
|
||||
" Tpope
|
||||
Plug 'tpope/vim-abolish'
|
||||
|
||||
55
nvim/plugins/bufferline.lua
Normal file
55
nvim/plugins/bufferline.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
-- bufferline.nvim
|
||||
-- https://github.com/akinsho/bufferline.nvim
|
||||
|
||||
local status, bufferline = pcall(require, 'bufferline')
|
||||
if (not status) then return end
|
||||
|
||||
bufferline.setup({
|
||||
highlights = {
|
||||
fill = {
|
||||
guibg = "#282828"
|
||||
},
|
||||
separator_selected = {
|
||||
guifg = "#282828"
|
||||
},
|
||||
separator_visible = {
|
||||
guifg = "#282828"
|
||||
},
|
||||
separator = {
|
||||
guifg = "#282828"
|
||||
}
|
||||
},
|
||||
options = {
|
||||
modified_icon = "●",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
max_name_length = 25,
|
||||
max_prefix_length = 25,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
separator_style = "slant",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
return "("..count..")"
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "left"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Leader>tp', [[<Cmd>:BufferLinePick<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>tx', [[<Cmd>:BufferLinePickClose<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>H', [[<Cmd>:BufferLineCyclePrev<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>L', [[<Cmd>:BufferLineCycleNext<CR>]], opts)
|
||||
Reference in New Issue
Block a user