feat!: change bufferline and session manager
This commit is contained in:
		
							parent
							
								
									5b5520e603
								
							
						
					
					
						commit
						cc922851c7
					
				@ -1,8 +1,65 @@
 | 
				
			|||||||
return {
 | 
					return {
 | 
				
			||||||
	{ 'jghauser/mkdir.nvim', lazy = false },
 | 
						{ 'jghauser/mkdir.nvim', lazy = false },
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		'glepnir/dbsession.nvim',
 | 
							"willothy/nvim-cokeline",
 | 
				
			||||||
		cmd = { 'SessionSave', 'SessionDelete', 'SessionLoad' },
 | 
							dependencies = {
 | 
				
			||||||
		opts = {},
 | 
								"nvim-lua/plenary.nvim", -- Required for v0.4.0+
 | 
				
			||||||
	},
 | 
								"nvim-tree/nvim-web-devicons", -- If you want devicons
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"stevearc/resession.nvim",
 | 
				
			||||||
 | 
									config = function()
 | 
				
			||||||
 | 
										local resession = require("resession")
 | 
				
			||||||
 | 
										resession.setup()
 | 
				
			||||||
 | 
										-- Resession does NOTHING automagically, so we have to set up some keymaps
 | 
				
			||||||
 | 
										vim.keymap.set("n", "<leader>ss", resession.save)
 | 
				
			||||||
 | 
										vim.keymap.set("n", "<leader>sl", resession.load)
 | 
				
			||||||
 | 
										vim.keymap.set("n", "<leader>sd", resession.delete)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								} -- Optional, for persistent history
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							event = "VeryLazy",
 | 
				
			||||||
 | 
							keys = {
 | 
				
			||||||
 | 
								{ 'gp', "<Plug>(cokeline-focus-prev)", desc = 'next buffer' },
 | 
				
			||||||
 | 
								{ 'gn', "<Plug>(cokeline-focus-next)", desc = 'next buffer' },
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							-- opts = {},
 | 
				
			||||||
 | 
							config = function()
 | 
				
			||||||
 | 
								local get_hex = require('cokeline.hlgroups').get_hl_attr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								require('cokeline').setup({
 | 
				
			||||||
 | 
									default_hl = {
 | 
				
			||||||
 | 
										fg = function(buffer)
 | 
				
			||||||
 | 
											return
 | 
				
			||||||
 | 
											    buffer.is_focused
 | 
				
			||||||
 | 
											    and get_hex('Normal', 'fg')
 | 
				
			||||||
 | 
											    or get_hex('Comment', 'fg')
 | 
				
			||||||
 | 
										end,
 | 
				
			||||||
 | 
										bg = 'NONE',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									components = {
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											text = function(buffer) return (buffer.index ~= 1) and '▏' or '' end,
 | 
				
			||||||
 | 
											fg = function() return get_hex('Normal', 'fg') end
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											text = function(buffer) return '    ' .. buffer.devicon.icon end,
 | 
				
			||||||
 | 
											fg = function(buffer) return buffer.devicon.color end,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											text = function(buffer) return buffer.filename .. '    ' end,
 | 
				
			||||||
 | 
											bold = function(buffer) return buffer.is_focused end
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											text = '',
 | 
				
			||||||
 | 
											on_click = function(_, _, _, _, buffer)
 | 
				
			||||||
 | 
												buffer:delete()
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											text = '  ',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@ return {
 | 
				
			|||||||
	-- dependencies = 'windwp/nvim-ts-autotag',
 | 
						-- dependencies = 'windwp/nvim-ts-autotag',
 | 
				
			||||||
	event = 'VeryLazy',
 | 
						event = 'VeryLazy',
 | 
				
			||||||
	keys = {
 | 
						keys = {
 | 
				
			||||||
		{ '<leader>s', desc = 'start incremental selection' },
 | 
							{ '<leader>v', desc = 'start incremental selection' },
 | 
				
			||||||
		{ '<leader>h', '<cmd>TSBufToggle highlight<cr>', desc = 'toggle TS highlight' },
 | 
							{ '<leader>h', '<cmd>TSBufToggle highlight<cr>', desc = 'toggle TS highlight' },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	-- init = function(plugin)
 | 
						-- init = function(plugin)
 | 
				
			||||||
 | 
				
			|||||||
@ -149,20 +149,4 @@ return {
 | 
				
			|||||||
			hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
 | 
								hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		'akinsho/bufferline.nvim',
 | 
					 | 
				
			||||||
		version = "*",
 | 
					 | 
				
			||||||
		dependencies = 'nvim-tree/nvim-web-devicons',
 | 
					 | 
				
			||||||
		event = "VeryLazy",
 | 
					 | 
				
			||||||
		opts = {
 | 
					 | 
				
			||||||
			options = {
 | 
					 | 
				
			||||||
				hover = {
 | 
					 | 
				
			||||||
					enabled = true,
 | 
					 | 
				
			||||||
					delay = 10,
 | 
					 | 
				
			||||||
					reveal = { 'close' }
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user