install simple session manager, remove project functionality

This commit is contained in:
andrzej 2024-05-06 23:34:26 +02:00
parent 8d2b8a5765
commit 4ecc34c716
4 changed files with 34 additions and 100 deletions

View File

@ -18,58 +18,33 @@ return { -- Collection of various small independent plugins/modules
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
-- require("mini.files").setup(
-- -- No need to copy this inside `setup()`. Will be used automatically.
-- {
-- -- Customization of shown content
-- content = {
-- -- Predicate for which file system entries to show
-- filter = nil,
-- -- What prefix to show to the left of file system entry
-- prefix = nil,
-- -- In which order to show file system entries
-- sort = nil,
-- },
--
-- -- Module mappings created only inside explorer.
-- -- Use `''` (empty string) to not create one.
-- mappings = {
-- close = "q",
-- go_in = "l",
-- go_in_plus = "L",
-- go_out = "h",
-- go_out_plus = "H",
-- reset = "<BS>",
-- reveal_cwd = "@",
-- show_help = "g?",
-- synchronize = "=",
-- trim_left = "<",
-- trim_right = ">",
-- },
--
-- -- General options
-- options = {
-- -- Whether to delete permanently or move into module-specific trash
-- permanent_delete = false,
-- -- Whether to use for editing directories
-- use_as_default_explorer = true,
-- },
--
-- -- Customization of explorer windows
-- windows = {
-- -- Maximum number of windows to show side by side
-- max_number = math.huge,
-- -- Whether to show preview of file/directory under cursor
-- preview = true,
-- -- Width of focused window
-- width_focus = 50,
-- -- Width of non-focused window
-- width_nofocus = 15,
-- -- Width of preview window
-- width_preview = 25,
-- },
-- }
-- )
require("mini.move").setup()
-- require("mini.sessions").setup({
-- -- Whether to read latest session if Neovim opened without file arguments
-- autoread = true,
--
-- -- Whether to write current session before quitting Neovim
-- autowrite = true,
--
-- -- Directory where global sessions are stored (use `''` to disable)
-- -- directory = --<"session" subdir of user data directory from |stdpath()|>,
--
-- -- File for local session (use `''` to disable)
-- -- file = "Session.vim",
--
-- -- Whether to force possibly harmful actions (meaning depends on function)
-- force = { read = false, write = true, delete = false },
--
-- -- Hook functions for actions. Default `nil` means 'do nothing'.
-- hooks = {
-- -- Before successful action
-- pre = { read = nil, write = nil, delete = nil },
-- -- After successful action
-- post = { read = nil, write = nil, delete = nil },
-- },
--
-- -- Whether to print session path after action
-- verbose = { read = false, write = true, delete = true },
-- })
end,
}

View File

@ -1,21 +0,0 @@
return {
"coffebar/neovim-project",
opts = {
projects = { -- define project roots
"~/projects/*",
"~/.config/*",
"~/dev/*",
},
},
init = function()
-- enable saving the state of plugins in the session
vim.opt.sessionoptions:append("globals") -- save global variables that start with an uppercase letter and contain at least one lowercase letter.
end,
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope.nvim", tag = "0.1.4" },
{ "Shatur/neovim-session-manager" },
},
lazy = false,
priority = 100,
}

View File

@ -0,0 +1 @@
return { "Shatur/neovim-session-manager" }

View File

@ -7,7 +7,6 @@ return { -- Fuzzy Finder (files, lsp, etc)
"nvim-telescope/telescope-symbols.nvim",
"jvgrootveld/telescope-zoxide",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-project.nvim",
"ThePrimeagen/harpoon",
{ -- If encountering errors, see telescope-fzf-native README for install instructions
"nvim-telescope/telescope-fzf-native.nvim",
@ -28,7 +27,6 @@ return { -- Fuzzy Finder (files, lsp, etc)
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
},
config = function()
local project_actions = require("telescope._extensions.project.actions")
require("telescope").setup({
-- You can put your default mappings / updates / etc. in here
-- All the info you're looking for is in `:help telescope.setup()`
@ -51,24 +49,6 @@ return { -- Fuzzy Finder (files, lsp, etc)
},
-- pickers = {},
extensions = {
project = {
base_dirs = {
-- "~/dev/src",
-- { "~/dev/src2" },
-- { "~/dev/src3", max_depth = 4 },
-- { path = "~/dev/src4" },
-- { path = "~/dev/src5", max_depth = 2 },
},
hidden_files = true, -- default: false
theme = "dropdown",
order_by = "asc",
search_by = "title",
-- default for on_project_selected = find project files
-- on_project_selected = function(prompt_bufnr)
-- -- Do anything you want in here. For example:
-- project_actions.change_working_directory(prompt_bufnr, false)
-- end,
},
zoxide = {
prompt_title = "[ Zoxide list ]",
mappings = {
@ -124,7 +104,6 @@ return { -- Fuzzy Finder (files, lsp, etc)
pcall(require("telescope").load_extension, "ui-select")
pcall(require("telescope").load_extension, "file_browser")
pcall(require("telescope").load_extension, "zoxide")
pcall(require("telescope").load_extension, "project")
pcall(require("telescope").load_extension, "harpoon")
pcall(require("telescope").load_extension, "harpoon")
-- See `:help telescope.builtin`
@ -148,12 +127,12 @@ return { -- Fuzzy Finder (files, lsp, etc)
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
vim.keymap.set("n", "<leader>sc", builtin.colorscheme, { desc = "[S]earch [C]olorscheme" })
vim.keymap.set(
"n",
"<leader>sp",
"<cmd>:Telescope neovim-project discover<CR>",
{ desc = "[S]earch [P]rojects", noremap = true, silent = true }
)
-- vim.keymap.set(
-- "n",
-- "<leader>sp",
-- "<cmd>:Telescope neovim-project discover<CR>",
-- { desc = "[S]earch [P]rojects", noremap = true, silent = true }
-- )
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set("n", "<leader>/", function()
-- You can pass additional configuration to telescope to change theme, layout, etc.