From c2a74cff5802695bf7d6ac82b6bd8050f2c26588 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Mon, 4 Dec 2023 08:31:19 +1030 Subject: [PATCH] added new files --- .config/nvim/lua/lazyvim/plugins/aerial.lua | 10 +++ .config/nvim/lua/lazyvim/plugins/copilot.lua | 24 +++++++ .config/nvim/lua/lazyvim/plugins/flash.lua | 15 ++++ .config/nvim/lua/lazyvim/plugins/neotree.lua | 76 ++++++++++++++++++++ .config/nvim/lua/lazyvim/plugins/project.lua | 12 ++++ 5 files changed, 137 insertions(+) create mode 100644 .config/nvim/lua/lazyvim/plugins/aerial.lua create mode 100644 .config/nvim/lua/lazyvim/plugins/copilot.lua create mode 100644 .config/nvim/lua/lazyvim/plugins/flash.lua create mode 100644 .config/nvim/lua/lazyvim/plugins/neotree.lua create mode 100644 .config/nvim/lua/lazyvim/plugins/project.lua diff --git a/.config/nvim/lua/lazyvim/plugins/aerial.lua b/.config/nvim/lua/lazyvim/plugins/aerial.lua new file mode 100644 index 0000000..0bfeaa7 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/aerial.lua @@ -0,0 +1,10 @@ +return { + { + "stevearc/aerial.nvim", + opts = {}, + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/copilot.lua b/.config/nvim/lua/lazyvim/plugins/copilot.lua new file mode 100644 index 0000000..b237a39 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/copilot.lua @@ -0,0 +1,24 @@ +return { + { + "zbirenbaum/copilot.lua", + event = "VeryLazy", + build = ":Copilot auth", + opts = { + suggestion = { + enabled = true, + auto_trigger = true, + keymap = { + accept = "l", + next = "]", + prev = "[", + dismiss = "x", + }, + }, + panel = { enabled = true }, + filetypes = { + markdown = true, + help = true, + }, + }, + } +} diff --git a/.config/nvim/lua/lazyvim/plugins/flash.lua b/.config/nvim/lua/lazyvim/plugins/flash.lua new file mode 100644 index 0000000..ae23f31 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/flash.lua @@ -0,0 +1,15 @@ +return { + { + "folke/flash.nvim", + event = "VeryLazy", + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "oS", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/neotree.lua b/.config/nvim/lua/lazyvim/plugins/neotree.lua new file mode 100644 index 0000000..45ff6df --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/neotree.lua @@ -0,0 +1,76 @@ +local util = require("lazyvim.utils") + +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + cmd = "Neotree", + keys = { + { + "fe", + function() + require("neo-tree.command").execute({ toggle = true, dir = util.get_root() }) + end, + desc = "Explorer NeoTree (root dir)", + }, + { + "fE", + function() + require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) + end, + desc = "Explorer NeoTree (cwd)", + }, + { "e", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, + { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, + { + "ge", + function() + require("neo-tree.command").execute({ source = "git_status", toggle = true }) + end, + desc = "Git explorer", + }, + { + "be", + function() + require("neo-tree.command").execute({ source = "buffers", toggle = true }) + end, + desc = "Buffer explorer", + }, + }, + opts = { + sources = { "filesystem", "buffers", "git_status", "document_symbols" }, + open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" }, + filesystem = { + bind_to_cwd = false, + follow_current_file = { enabled = true }, + use_libuv_file_watcher = true, + }, + window = { + mappings = { + [""] = "none", + }, + }, + default_component_configs = { + indent = { + with_expanders = true, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + }, + }, + config = function(_, opts) + local function on_move(data) + util.lsp.on_rename(data.source, data.destination) + end + + local events = require("neo-tree.events") + opts.event_handlers = opts.event_handlers or {} + vim.list_extend(opts.event_handlers, { + { event = events.FILE_MOVED, handler = on_move }, + { event = events.FILE_RENAMED, handler = on_move }, + }) + require("neo-tree").setup(opts) + end, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/project.lua b/.config/nvim/lua/lazyvim/plugins/project.lua new file mode 100644 index 0000000..15c8bdc --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/project.lua @@ -0,0 +1,12 @@ +return { + -- { + -- "ahmedkhalf/project.nvim", + -- lazy = false, + -- opts = { + -- manual_mode = true, + -- }, + -- config = function(opts) + -- require("project_nvim").setup(opts) + -- end, + -- }, +}