Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/core/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ local function load_options()
relativenumber = true,
ruler = true,
scrolloff = 2,
sessionoptions = "buffers,curdir,help,tabpages,winsize",
sessionoptions = "buffers,curdir,folds,globals,help,tabpages,winpos,winsize",
shada = "!,'500,<50,@100,s10,h",
shiftround = true,
shiftwidth = 4,
Expand Down
4 changes: 2 additions & 2 deletions lua/keymap/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ local plug_map = {
return et("<Plug>(accelerated_jk_gk)")
end):with_expr(),

-- Plugin: auto_session
-- Plugin persisted.nvim
["n|<leader>ss"] = map_cu("SessionSave"):with_noremap():with_silent():with_desc("session: Save"),
["n|<leader>sr"] = map_cu("SessionRestore"):with_noremap():with_silent():with_desc("session: Restore"),
["n|<leader>sl"] = map_cu("SessionLoad"):with_noremap():with_silent():with_desc("session: Load current"),
["n|<leader>sd"] = map_cu("SessionDelete"):with_noremap():with_silent():with_desc("session: Delete"),

-- Plugin: nvim-bufdel
Expand Down
1 change: 1 addition & 0 deletions lua/keymap/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ local plug_map = {
:with_desc("edit: Change current direrctory by zoxide"),
["n|<leader>fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"),
["n|<leader>fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"),
["n|<leader>fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"),

-- Plugin: dap
["n|<F6>"] = map_callback(function()
Expand Down
24 changes: 0 additions & 24 deletions lua/modules/configs/editor/auto-session.lua

This file was deleted.

23 changes: 23 additions & 0 deletions lua/modules/configs/editor/persisted.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
return function()
require("persisted").setup({
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- directory where session files are saved
silent = false, -- silent nvim message when sourcing session file
use_git_branch = true, -- create session files based on the branch of the git enabled repository
autosave = true, -- automatically save session files when exiting Neovim
should_autosave = function()
if vim.bo.filetype == "alpha" then
return false
end
return true
end, -- function to determine if a session should be autosaved
-- Set `lazy = false` in `plugins/editor.lua` to enable this
autoload = false, -- automatically load the session for the cwd on Neovim startup
on_autoload_no_session = nil, -- function to run when `autoload = true` but there is no session to load
follow_cwd = true, -- change session file name to match current working directory if it changes
allowed_dirs = nil, -- table of dirs that the plugin will auto-save and auto-load from
ignored_dirs = nil, -- table of dirs that are ignored when auto-saving and auto-loading
telescope = { -- options for the telescope extension
reset_prompt_after_deletion = true, -- whether to reset prompt after session deleted
},
})
end
1 change: 1 addition & 0 deletions lua/modules/configs/tool/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ return function()
require("telescope").load_extension("projects")
require("telescope").load_extension("undo")
require("telescope").load_extension("zoxide")
require("telescope").load_extension("persisted")
end
15 changes: 12 additions & 3 deletions lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ editor["rainbowhxch/accelerated-jk.nvim"] = {
event = "VeryLazy",
config = require("editor.accelerated-jk"),
}
editor["rmagatti/auto-session"] = {
editor["olimorris/persisted.nvim"] = {
lazy = true,
cmd = { "SessionSave", "SessionRestore", "SessionDelete" },
config = require("editor.auto-session"),
cmd = {
"SessionToggle",
"SessionStart",
"SessionStop",
"SessionSave",
"SessionLoad",
"SessionLoadLast",
"SessionLoadFromFile",
"SessionDelete",
},
config = require("editor.persisted"),
}
editor["m4xshen/autoclose.nvim"] = {
lazy = true,
Expand Down