mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-10 17:34:34 +02:00
feat: added persistence
This commit is contained in:
parent
e7c5d8a470
commit
ece9533206
4 changed files with 35 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" },
|
||||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" },
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
|
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "5da6ddd077a63c4ba3b6d7c7ba53b7c7e6530715" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" },
|
"plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "b79cd6c88b3d96b0f49cb7d240807cd59b610cd8" },
|
"telescope.nvim": { "branch": "master", "commit": "b79cd6c88b3d96b0f49cb7d240807cd59b610cd8" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "63879369ac45e1dfe14c541d630e59240a6f2d4a" },
|
"tokyonight.nvim": { "branch": "main", "commit": "63879369ac45e1dfe14c541d630e59240a6f2d4a" },
|
||||||
|
|
|
@ -65,5 +65,8 @@ vim.keymap.set("n", "<leader>gG", function()
|
||||||
util.float_term({ "lazygit" }, { cwd = util.get_root() })
|
util.float_term({ "lazygit" }, { cwd = util.get_root() })
|
||||||
end, { desc = "Lazygit for root dir" })
|
end, { desc = "Lazygit for root dir" })
|
||||||
|
|
||||||
|
-- quit
|
||||||
|
vim.keymap.set("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||||
|
|
||||||
-- highlights under cursor
|
-- highlights under cursor
|
||||||
vim.keymap.set("n", "<leader>hl", vim.show_pos, { desc = "Highlight Groups at cursor" })
|
vim.keymap.set("n", "<leader>hl", vim.show_pos, { desc = "Highlight Groups at cursor" })
|
||||||
|
|
|
@ -147,6 +147,7 @@ return {
|
||||||
["<leader>g"] = { name = "+git" },
|
["<leader>g"] = { name = "+git" },
|
||||||
["<leader>h"] = { name = "+help" },
|
["<leader>h"] = { name = "+help" },
|
||||||
["<leader>n"] = { name = "+noice" },
|
["<leader>n"] = { name = "+noice" },
|
||||||
|
["<leader>q"] = { name = "+quit/session" },
|
||||||
["<leader>s"] = { name = "+search" },
|
["<leader>s"] = { name = "+search" },
|
||||||
["<leader>x"] = { name = "+diagnostics" },
|
["<leader>x"] = { name = "+diagnostics" },
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,6 +9,36 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- session management
|
||||||
|
{
|
||||||
|
"folke/persistence.nvim",
|
||||||
|
event = "BufReadPre",
|
||||||
|
config = { options = { "buffers", "curdir", "tabpages", "winsize", "help" } },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>qs",
|
||||||
|
function()
|
||||||
|
require("persistence").load()
|
||||||
|
end,
|
||||||
|
desc = "Restore Session",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ql",
|
||||||
|
function()
|
||||||
|
require("persistence").load({ last = true })
|
||||||
|
end,
|
||||||
|
desc = "Restore Last Session",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>qd",
|
||||||
|
function()
|
||||||
|
require("persistence").stop()
|
||||||
|
end,
|
||||||
|
desc = "Delete Current Session",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- library used by other plugins
|
-- library used by other plugins
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue