From 4ecc34c7168ddb99eb0adc6b07e5a463d23ac51e Mon Sep 17 00:00:00 2001 From: andrzej Date: Mon, 6 May 2024 23:34:26 +0200 Subject: [PATCH] install simple session manager, remove project functionality --- nvim/.config/nvim/lua/plugins/mini.lua | 79 +++++++------------ nvim/.config/nvim/lua/plugins/project.lua | 21 ----- .../nvim/lua/plugins/session-manager.lua | 1 + nvim/.config/nvim/lua/plugins/telescope.lua | 33 ++------ 4 files changed, 34 insertions(+), 100 deletions(-) delete mode 100644 nvim/.config/nvim/lua/plugins/project.lua create mode 100644 nvim/.config/nvim/lua/plugins/session-manager.lua diff --git a/nvim/.config/nvim/lua/plugins/mini.lua b/nvim/.config/nvim/lua/plugins/mini.lua index 741c89b..d84aa23 100644 --- a/nvim/.config/nvim/lua/plugins/mini.lua +++ b/nvim/.config/nvim/lua/plugins/mini.lua @@ -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 = "", - -- 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, } diff --git a/nvim/.config/nvim/lua/plugins/project.lua b/nvim/.config/nvim/lua/plugins/project.lua deleted file mode 100644 index 49cf47b..0000000 --- a/nvim/.config/nvim/lua/plugins/project.lua +++ /dev/null @@ -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, -} diff --git a/nvim/.config/nvim/lua/plugins/session-manager.lua b/nvim/.config/nvim/lua/plugins/session-manager.lua new file mode 100644 index 0000000..4f998a0 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/session-manager.lua @@ -0,0 +1 @@ +return { "Shatur/neovim-session-manager" } diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index a1aa081..adff8ae 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -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", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) vim.keymap.set("n", "sc", builtin.colorscheme, { desc = "[S]earch [C]olorscheme" }) - vim.keymap.set( - "n", - "sp", - ":Telescope neovim-project discover", - { desc = "[S]earch [P]rojects", noremap = true, silent = true } - ) + -- vim.keymap.set( + -- "n", + -- "sp", + -- ":Telescope neovim-project discover", + -- { desc = "[S]earch [P]rojects", noremap = true, silent = true } + -- ) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set("n", "/", function() -- You can pass additional configuration to telescope to change theme, layout, etc.