From d27336e6dff4b6249b8af68f870c83c4d4b4f0f8 Mon Sep 17 00:00:00 2001 From: mace Date: Fri, 27 Dec 2024 13:40:41 +0100 Subject: [PATCH] new session handling --- lua/custom/keymaps.lua | 10 ++-------- lua/custom/plugins/init.lua | 15 ++++++++++----- lua/custom/telescope.lua | 3 ++- lua/kickstart/plugins/debug.lua | 7 +++++++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua index 9b6a791..75f397a 100644 --- a/lua/custom/keymaps.lua +++ b/lua/custom/keymaps.lua @@ -15,7 +15,7 @@ keymap.set('n', 'gn', ':bn', { silent = true }) keymap.set('n', 'gp', ':bp', { silent = true }) keymap.set('n', 'g[', ':b#', { silent = true }) -keymap.set('n', '', ':w') +-- keymap.set('n', '', ':w') keymap.set('n', 'x', ':bd', { silent = true }) -- primeagen @@ -89,11 +89,5 @@ end -- Map v to the custom function keymap.set('n', 'v', [[:lua move_to_vertical_split()]], { noremap = true, silent = true }) --- load the session for the current directory -keymap.set("n", "qs", function() require("persistence").load() end) -- select a session to load -keymap.set("n", "qS", function() require("persistence").select() end) --- load the last session -keymap.set("n", "ql", function() require("persistence").load({ last = true }) end) --- stop Persistence => session won't be saved on exit -keymap.set("n", "qd", function() require("persistence").stop() end) +keymap.set("n", "", 'Telescope persisted', { silent = true }) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 2b6bb04..e390460 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -130,12 +130,17 @@ return { -- Lua sesion manager { - "folke/persistence.nvim", - event = "BufReadPre", -- this will only start session saving when an actual file was opened - opts = { - -- add any custom options here - } + "olimorris/persisted.nvim", + lazy = false, -- make sure the plugin is always loaded at startup + config = true }, + -- { + -- "folke/persistence.nvim", + -- event = "BufReadPre", -- this will only start session saving when an actual file was opened + -- opts = { + -- -- add any custom options here + -- } + -- }, -- lazy.nvim Hardtime -- { -- "m4xshen/hardtime.nvim", diff --git a/lua/custom/telescope.lua b/lua/custom/telescope.lua index a8fff3b..2d5a2e5 100644 --- a/lua/custom/telescope.lua +++ b/lua/custom/telescope.lua @@ -26,7 +26,8 @@ telescope.setup({ telescope.load_extension("fzf") telescope.load_extension("project") -telescope.load_extension('harpoon') +telescope.load_extension("harpoon") +telescope.load_extension("persisted") require('file_history').setup { -- This is the location where it will create your file history repository backup_dir = "~/.file-history-git", diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 9b07c05..eaa6582 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -6,6 +6,7 @@ -- be extended to other languages as well. That's why it's called -- kickstart.nvim and not kitchen-sink.nvim ;) + return { -- NOTE: Yes, you can install new plugins here! 'mfussenegger/nvim-dap', @@ -25,6 +26,12 @@ return { local dap = require 'dap' local dapui = require 'dapui' + require("nvim-dap-virtual-text").setup { + enabled = true, + virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol', + + } + require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations