diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 6579ca3..39b3a97 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -9,7 +9,7 @@ local keymap = vim.api.nvim_set_keymap -- Convenient alias local autocmd = vim.api.nvim_create_autocmd -- Convenient alias local defaultKeybindOptions = { noremap = true, silent = true } -- Default keybind options -LoadPreviousSessionOnLoad = false -- Load previous session or not +LoadPreviousSessionOnLoad = true -- Load previous session or not SessionFile = '~/.config/nvim/.session.nvim' -- File where the previous buffer is stored LeaderKey = ' ' -- The leader key to use. Default is the space key. Theme = 'doom-one' -- Theme to use @@ -37,20 +37,14 @@ Plugins = { -- Plugins to use }, }, -- Fuzzy-finding { 'nvim-treesitter/nvim-treesitter' }, -- Better syntax highlighting + { 'akinsho/bufferline.nvim' }, -- Tabs { 'nvim-lualine/lualine.nvim' }, -- Status line { 'm4xshen/autoclose.nvim' }, -- Autoclose brackets { 'romgrk/doom-one.vim' }, -- Doom-One theme { 'stevearc/conform.nvim' }, -- Formatting { 'tpope/vim-fugitive' }, -- Git integration - { 'romgrk/barbar.nvim', - dependencies = { - 'lewis6991/gitsigns.nvim', - 'nvim-tree/nvim-web-devicons', - }, opts = { - clickable = true, - animation = true, - focus_on_close = 'left', - } }, -- Tabs + { 'lewis6991/gitsigns.nvim' }, -- Provides Git icons + { 'nvim-tree/nvim-web-devicons' }, -- Provides general icons { 'williamboman/mason.nvim', dependencies = { 'williamboman/mason-lspconfig.nvim', @@ -72,6 +66,14 @@ Plugins = { -- Plugins to use }, -- Indentation blankline { 'folke/trouble.nvim' }, -- Display warnings and errors neatly { 'uga-rosa/translate.nvim' }, -- Built in translate + { 'folke/noice.nvim', event = "VeryLazy", + dependencies = { + 'MunifTanjim/nui.nvim', + 'rcarriga/nvim-notify', + }, + opts = { + }, + }, -- Message boxes } require('bootstrap') -- Set up Lazy and plugins. @@ -143,26 +145,22 @@ keymap('n', '', 'NvimTreeToggle', defaultKeyb keymap('n', '', 'TroubleToggle', defaultKeybindOptions) -- Keybinds for handling tabs -keymap('n', '', 'BufferPrevious', defaultKeybindOptions) -keymap('n', '', 'BufferNext', defaultKeybindOptions) -keymap('n', '', 'BufferMovePrevious', defaultKeybindOptions) -keymap('n', '>', 'BufferMoveNext', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 1', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 2', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 3', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 4', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 5', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 6', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 7', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 8', defaultKeybindOptions) -keymap('n', '', 'BufferGoto 9', defaultKeybindOptions) -keymap('n', '', 'BufferLast', defaultKeybindOptions) -keymap('n', '', 'BufferPin', defaultKeybindOptions) -keymap('n', '', 'BufferClose', defaultKeybindOptions) -keymap('n', 'bb', 'BufferOrderByBufferNumber', defaultKeybindOptions) -keymap('n', 'bd', 'BufferOrderByDirectory', defaultKeybindOptions) -keymap('n', 'bl', 'BufferOrderByLanguage', defaultKeybindOptions) -keymap('n', 'bw', 'BufferOrderByWindowNumber', defaultKeybindOptions) +keymap('n', '', 'BufferLineCyclePrev', defaultKeybindOptions) +keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) +keymap('n', '', 'BufferLineMovePrev', defaultKeybindOptions) +keymap('n', '>', 'BufferLineMoveNext', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 1', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 2', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 3', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 4', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 5', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 6', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 7', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 8', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 9', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer -1', defaultKeybindOptions) +keymap('n', '', 'BufferLineTogglePin', defaultKeybindOptions) +keymap('n', '', 'bdelete', defaultKeybindOptions) autocmd('BufWritePre', { -- Remove trailing spaces pattern = { '*' }, @@ -189,6 +187,7 @@ require('autoclose_config') require('lsp_config') require('lualine_config') require('ibl_config') +require('bufferline_config') require('tree_config') require('ts_config') require('theme_config') diff --git a/.config/nvim/lua/bufferline_config.lua b/.config/nvim/lua/bufferline_config.lua new file mode 100644 index 0000000..f67f55d --- /dev/null +++ b/.config/nvim/lua/bufferline_config.lua @@ -0,0 +1,17 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +local bufferline = require("bufferline") +bufferline.setup({ + options = { + style_preset = bufferline.style_preset.no_italic, + diagnostics = "nvim_lsp", + + diagnostics_indicator = function(count, level) + local icon = level:match("error") and " " or "" + return " " .. icon .. count + end + }, +})