Chris преди 4 години
родител
ревизия
0b76e8f7b4
променени са 4 файла, в които са добавени 123 реда и са изтрити 15 реда
  1. 2 1
      init.lua
  2. 119 0
      lua/nv-barbar/init.lua
  3. 0 13
      lua/nv-bufferline/init.lua
  4. 2 1
      lua/plugins.lua

+ 2 - 1
init.lua

@@ -10,7 +10,7 @@ require('nv-colorizer')
 require('nv-nvimtree')
 require('nv-treesitter')
 require('nv-galaxyline')
-require('nv-bufferline')
+require('nv-barbar')
 require('nv-gitsigns')
 require('nv-nvim-autopairs')
 require('nv-kommentary')
@@ -20,6 +20,7 @@ require('nv-startify')
 require('nv-telescope')
 require('nv-floaterm')
 require('nv-vim-rooter')
+require('nv-lspkind')
 
 -- Which Key (Hope to replace with Lua plugin someday)
 vim.cmd('source ~/.config/nvim/lua/nv-whichkey/init.vim')

+ 119 - 0
lua/nv-barbar/init.lua

@@ -0,0 +1,119 @@
+vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
+vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
+--[[ nnoremap <silent>    <A-,> :BufferPrevious<CR>
+nnoremap <silent>    <A-.> :BufferNext<CR> ]]
+
+
+--" These commands will sort buffers by directory, language, or a custom criteria
+--nnoremap <silent>be :BufferLineSortByExtension<CR>
+--nnoremap <silent>bd :BufferLineSortByDirectory<CR>
+--nnoremap <silent><mymap> :lua require'bufferline'.sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end)<CR>
+-- colors for active , inactive buffer tabs 
+--[[ require "bufferline".setup {
+    options = {
+        -- buffer_close_icon = "",
+        -- modified_icon = "●",
+        -- close_icon = "",
+        -- left_trunc_marker = "",
+        -- right_trunc_marker = "",
+        -- max_name_length = 14,
+        -- max_prefix_length = 13,
+        -- tab_size = 18,
+        -- enforce_regular_tabs = true,
+        -- view = "multiwindow",
+        -- show_buffer_close_icons = true,
+        -- separator_style = 'slant'
+        separator_style = "thin"
+    },
+    highlights = {
+        background = {
+            guifg = "#abb2bf",
+            guibg = "#282c34"
+        },
+
+        fill = {
+            guifg = "#282c34",
+            guibg = "#1e1e1e"
+        },
+        buffer_selected = {
+            guifg = "#abb2bf",
+            guibg = "#3A3E44",
+            gui = "bold"
+        },
+        buffer_selected = {
+            guifg = "#abb2bf",
+            guibg = "#3A3E44",
+            gui = "bold"
+        },
+        separator_visible = {
+            guifg = "#1e1e1e",
+            guibg = "#1e1e1e"
+        },
+        separator_selected = {
+            guifg = "#1e1e1e",
+            guibg = "#1e1e1e"
+        },
+        separator = {
+            guifg = "#1e1e1e",
+            guibg = "#1e1e1e"
+        },
+        indicator_selected = {
+            guifg = "#abb2bf",
+            guibg = "#3a3e44"
+        },
+        modified_selected = {
+            guifg = "#abb2bf",
+            guibg = "#3a3e44"
+        },
+        modified = {
+            guifg = "#abb2bf",
+            guibg = "#282c34"
+        },
+        modified_visible = {
+            guifg = "#abb2bf",
+            guibg = "#282c34"
+        },
+        duplicate_selected = {
+            guifg = "#abb3bf",
+            guibg = "#3a3e44",
+            -- gui = "italic"
+        },
+        duplicate_visible = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+            -- gui = "italic"
+        },
+        duplicate = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+            -- gui = "italic"
+        },
+        tab = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+        },
+        tab_selected = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+        },
+        tab_close = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+        },
+        pick_selected = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+            gui = "bold,italic"
+        },
+        pick_visible = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+            gui = "bold,italic"
+        },
+        pick = {
+            guifg = "#abb3bf",
+            guibg = "#282c34",
+            gui = "bold,italic"
+        }
+    }
+} ]]

+ 0 - 13
lua/nv-bufferline/init.lua

@@ -1,13 +0,0 @@
-require'bufferline'.setup{}
-vim.api.nvim_set_keymap('n', '<TAB>', ':BufferLineCycleNext<CR>', { noremap = true, silent = true })
-vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferLineCyclePrev<CR>', { noremap = true, silent = true })
-
-
---" These commands will move the current buffer backwards or forwards in the bufferline
---nnoremap <silent><mymap> :BufferLineMoveNext<CR>
---nnoremap <silent><mymap> :BufferLineMovePrev<CR>
-
---" These commands will sort buffers by directory, language, or a custom criteria
---nnoremap <silent>be :BufferLineSortByExtension<CR>
---nnoremap <silent>bd :BufferLineSortByDirectory<CR>
---nnoremap <silent><mymap> :lua require'bufferline'.sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end)<CR>

+ 2 - 1
lua/plugins.lua

@@ -44,7 +44,8 @@ return require('packer').startup(function()
 
   -- Status Line and Bufferline
   use 'glepnir/galaxyline.nvim'
-  use {'akinsho/nvim-bufferline.lua', requires = 'kyazdani42/nvim-web-devicons'}
+  -- use {'akinsho/nvim-bufferline.lua', requires = 'kyazdani42/nvim-web-devicons'}
+  use 'romgrk/barbar.nvim'
 
   -- Telescope
   use 'nvim-lua/popup.nvim'