A readme explaining how to make neovim work fast
added auto-session and fixed neotree for wsl
4 files changed, +22 -21
+1-0lazy-lock.json
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, |
| 5 | 5 | "Toggleterm": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, |
| 6 | 6 | "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, |
| 7 | + "auto-session": { "branch": "main", "commit": "71c8af9a99e96b9d2533cf4bac4dfed1eafab923" }, | |
| 7 | 8 | "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, |
| 8 | 9 | "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, |
| 9 | 10 | "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, |
+0-18lua/config/autocmds.lua
| @@ -62,21 +62,3 @@ vim.api.nvim_create_autocmd("TermLeave", { | ||
| 62 | 62 | end, |
| 63 | 63 | }) |
| 64 | 64 | |
| 65 | --- open in the specified root and open session if available | |
| 66 | -vim.api.nvim_create_autocmd("VimEnter", { | |
| 67 | - callback = function() | |
| 68 | - if arg and vim.fn.isdirectory(vim.fn.argv()[0]) == 1 then | |
| 69 | - vim.cmd("cd " .. vim.fn.argv(0)) | |
| 70 | - end | |
| 71 | - local cwd = vim.fn.getcwd() | |
| 72 | - local persistence_root = vim.fn.expand("~/.local/state/nvim/sessions/") | |
| 73 | - local persistence_filename = string.gsub(cwd, "/", "%%") .. ".vim" | |
| 74 | - local potential_session = persistence_root .. persistence_filename | |
| 75 | - for _, value in ipairs(require("persistence").list()) do | |
| 76 | - if value == potential_session then | |
| 77 | - vim.cmd("source " .. vim.fn.fnameescape(value)) | |
| 78 | - vim.notify("Loading session for " .. cwd) | |
| 79 | - end | |
| 80 | - end | |
| 81 | - end, | |
| 82 | -}) |
+6-0lua/plugins/auto-session.lua
| @@ -0,0 +1,6 @@ | ||
| 1 | +return { | |
| 2 | + "rmagatti/auto-session", | |
| 3 | + config = function() | |
| 4 | + require("auto-session").setup() | |
| 5 | + end, | |
| 6 | +} |
+15-3lua/plugins/neotree.lua
| @@ -1,10 +1,22 @@ | ||
| 1 | 1 | return { |
| 2 | 2 | { |
| 3 | + -- https://github.com/nvim-neo-tree/neo-tree.nvim/wiki/Recipes#open-with-system-viewer | |
| 3 | 4 | "nvim-neo-tree/neo-tree.nvim", |
| 4 | 5 | opts = { |
| 5 | - hijack_netrw_behavior = "disabled", | |
| 6 | - follow_current_file = { | |
| 7 | - enabled = true, | |
| 6 | + filesystem = { | |
| 7 | + hijack_netrw_behavior = "disabled", | |
| 8 | + window = { | |
| 9 | + mappings = { | |
| 10 | + ["O"] = "system_open", | |
| 11 | + }, | |
| 12 | + }, | |
| 13 | + }, | |
| 14 | + commands = { | |
| 15 | + system_open = function(state) | |
| 16 | + local node = state.tree:get_node() | |
| 17 | + local path = node:get_id() | |
| 18 | + vim.fn.jobstart({ "wslview", path }, { detach = true }) | |
| 19 | + end, | |
| 8 | 20 | }, |
| 9 | 21 | }, |
| 10 | 22 | }, |