diff --git a/lua/install-plugins.lua b/lua/install-plugins.lua index c5b89d3..d8fb28d 100644 --- a/lua/install-plugins.lua +++ b/lua/install-plugins.lua @@ -355,6 +355,19 @@ return require('packer').startup(function(use) requires = { "nvim-lua/plenary.nvim" }, } use 'dhruvasagar/vim-zoom' + use { + 'rmagatti/auto-session', + config = function() + require('plugins.auto-session') + end + } + use { + 'rmagatti/session-lens', + requires = {'rmagatti/auto-session', 'nvim-telescope/telescope.nvim'}, + config = function() + require('plugins.session-lens') + end + } -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins diff --git a/lua/plugins/auto-session.lua b/lua/plugins/auto-session.lua new file mode 100644 index 0000000..2845729 --- /dev/null +++ b/lua/plugins/auto-session.lua @@ -0,0 +1,7 @@ +vim.o.sessionoptions='blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal' + +require('auto-session').setup({ + log_level = 'error', + auto_session_suppress_dirs = { '~/', '~/workspace', '~/Downloads', '/'}, + auto_session_enable_last_session = true, +}) diff --git a/lua/plugins/lualine-nvim.lua b/lua/plugins/lualine-nvim.lua index 90e6db2..5f255d6 100644 --- a/lua/plugins/lualine-nvim.lua +++ b/lua/plugins/lualine-nvim.lua @@ -1 +1,7 @@ -require('lualine').setup() +require('lualine').setup({ + sections = { + lualine_c = { + require('auto-session-library').current_session_name + } + } +}) diff --git a/lua/plugins/session-lens.lua b/lua/plugins/session-lens.lua new file mode 100644 index 0000000..104a4e7 --- /dev/null +++ b/lua/plugins/session-lens.lua @@ -0,0 +1 @@ +require('session-lens').setup() diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index ac54267..a01a839 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -27,6 +27,7 @@ require('telescope').load_extension('env') require('telescope').load_extension('emoji') require('telescope').load_extension('ui-select') require('telescope').load_extension('project') +require('telescope').load_extension('session-lens') vim.keymap.set( 'n', @@ -154,3 +155,9 @@ vim.keymap.set( [[lua require('telescope').extensions.project.project({ display_type = 'full' })]], { noremap = true, silent = true } ) +vim.keymap.set( + 'n', + '`', + [[lua require('session-lens').search_session()]], + { noremap = true, silent = true } +) diff --git a/lua/user/settings.lua b/lua/user/settings.lua index fbba20a..3fe0e28 100644 --- a/lua/user/settings.lua +++ b/lua/user/settings.lua @@ -31,6 +31,7 @@ vim.opt.mouse = 'a' -- Window decorations vim.opt.title = true +vim.opt.titlestring="%{substitute(getcwd(),$HOME,'~','')} - Neovide" -- Leader vim.g.mapleader = ' '