diff --git a/Justfile b/Justfile index ce99adfe..cdcae182 100644 --- a/Justfile +++ b/Justfile @@ -263,11 +263,11 @@ path: $env.PATH | split row ":" nvim-test: - rm -rf $"($env.HOME)/.config/astronvim/lua/user" - rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/neovim/astronvim_user/ $"($env.HOME)/.config/astronvim/lua/user" + rm -rf $"($env.HOME)/.config/nvim" + rsync -avz --copy-links --chmod=D2755,F744 home/base/tui/editors/neovim/nvim/ $"($env.HOME)/.config/nvim/" nvim-clean: - rm -rf $"($env.HOME)/.config/astronvim/lua/user" + rm -rf $"($env.HOME)/.config/nvim" # ================================================= # Emacs related commands @@ -289,7 +289,7 @@ reload-emacs-cmd := if os() == "macos" { emacs-test: rm -rf $"($env.HOME)/.config/doom" - rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/emacs/doom/ $"($env.HOME)/.config/doom" + rsync -avz --copy-links --chmod=D2755,F744 home/base/tui/editors/emacs/doom/ $"($env.HOME)/.config/doom/" doom clean doom sync diff --git a/home/base/tui/editors/neovim/nvim/lua/community.lua b/home/base/tui/editors/neovim/nvim/lua/community.lua index a80d0491..29cd0aa2 100644 --- a/home/base/tui/editors/neovim/nvim/lua/community.lua +++ b/home/base/tui/editors/neovim/nvim/lua/community.lua @@ -1,5 +1,3 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- AstroCommunity: import any community modules here -- We import this file in `lazy_setup.lua` before the `plugins/` folder. -- This guarantees that the specs are processed before any user plugins. diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/astrocore.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/astrocore.lua index b3b77311..6ed124ca 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/astrocore.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/astrocore.lua @@ -1,14 +1,8 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- AstroCore provides a central place to modify mappings, vim options, autocommands, and more! -- Configuration documentation can be found with `:h astrocore` -- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) -- as this provides autocomplete and documentation while editing -require("telescope").load_extension "refactoring" -require("telescope").load_extension "yank_history" -require("telescope").load_extension "undo" - ---@type LazySpec return { "AstroNvim/astrocore", @@ -48,34 +42,18 @@ return { }, }, -- Mappings can be configured through AstroCore as well. + -- https://docs.astronvim.com/recipes/mappings/ -- NOTE: keycodes follow the casing in the vimdocs. For example, `` must be capitalized mappings = { -- first key is the mode n = { -- second key is the lefthand side of the map - -- navigate buffer tabs with `H` and `L` - L = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, - H = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, - - -- mappings seen under group name "Buffer" - ["bD"] = { - function() - require("astroui.status.heirline").buffer_picker( - function(bufnr) require("astrocore.buffer").close(bufnr) end - ) - end, - desc = "Pick to close", - }, - -- tables with just a `desc` key will be registered with which-key if it's installed - -- this is useful for naming menus - ["b"] = { desc = "Buffers" }, - -- second key is the lefthand side of the map -- mappings seen under group name "Buffer" ["bn"] = { "tabnew", desc = "New tab" }, -- quick save - [""] = { ":w!", desc = "Save File" }, -- change description but the same command + -- [""] = { ":w!", desc = "Save File" }, -- Terminal -- NOTE: https://neovim.io/doc/user/builtin.html#jobstart() @@ -92,33 +70,6 @@ return { desc = "Search on current file", }, - -- refactoring - ["ri"] = { - function() require("refactoring").refactor "Inline Variable" end, - desc = "Inverse of extract variable", - }, - ["rb"] = { function() require("refactoring").refactor "Extract Block" end, desc = "Extract Block" }, - ["rbf"] = { - function() require("refactoring").refactor "Extract Block To File" end, - desc = "Extract Block To File", - }, - ["rr"] = { - function() require("telescope").extensions.refactoring.refactors() end, - desc = "Prompt for a refactor to apply", - }, - ["rp"] = { - function() require("refactoring").debug.printf { below = false } end, - desc = "Insert print statement to mark the calling of a function", - }, - ["rv"] = { - function() require("refactoring").debug.print_var() end, - desc = "Insert print statement to print a variable", - }, - ["rc"] = { - function() require("refactoring").debug.cleanup {} end, - desc = "Cleanup of all generated print statements", - }, - -- yank_history ["yh"] = { function() require("telescope").extensions.yank_history.yank_history() end, @@ -150,30 +101,7 @@ return { -- search and replace globally ["sw"] = { 'lua require("spectre").open_visual()', desc = "Search current word" }, }, - -- visual mode(what's the difference between v and x???) - x = { - -- refactoring - ["ri"] = { - function() require("refactoring").refactor "Inline Variable" end, - desc = "Inverse of extract variable", - }, - ["re"] = { - function() require("refactoring").refactor "Extract Function" end, - desc = "Extracts the selected code to a separate function", - }, - ["rf"] = { - function() require("refactoring").refactor "Extract Function To File" end, - desc = "Extract Function To File", - }, - ["rv"] = { - function() require("refactoring").refactor "Extract Variable" end, - desc = "Extracts occurrences of a selected expression to its own variable", - }, - ["rr"] = { - function() require("telescope").extensions.refactoring.refactors() end, - desc = "Prompt for a refactor to apply", - }, - }, + }, }, } diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/astrolsp.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/astrolsp.lua index ad5efa6d..ad0fa1d8 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/astrolsp.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/astrolsp.lua @@ -1,10 +1,9 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine -- Configuration documentation can be found with `:h astrolsp` -- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) -- as this provides autocomplete and documentation while editing + ---@type LazySpec return { "AstroNvim/astrolsp", @@ -131,6 +130,7 @@ return { mappings = { n = { gl = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, + -- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean -- gD = { -- function() vim.lsp.buf.declaration() end, @@ -142,6 +142,57 @@ return { -- desc = "Toggle LSP semantic highlight (buffer)", -- cond = function(client) return client.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens end, -- }, + + -- refactoring + ["ri"] = { + function() require("refactoring").refactor "Inline Variable" end, + desc = "Inverse of extract variable", + }, + ["rb"] = { function() require("refactoring").refactor "Extract Block" end, desc = "Extract Block" }, + ["rbf"] = { + function() require("refactoring").refactor "Extract Block To File" end, + desc = "Extract Block To File", + }, + ["rr"] = { + function() require("telescope").extensions.refactoring.refactors() end, + desc = "Prompt for a refactor to apply", + }, + ["rp"] = { + function() require("refactoring").debug.printf { below = false } end, + desc = "Insert print statement to mark the calling of a function", + }, + ["rv"] = { + function() require("refactoring").debug.print_var() end, + desc = "Insert print statement to print a variable", + }, + ["rc"] = { + function() require("refactoring").debug.cleanup {} end, + desc = "Cleanup of all generated print statements", + }, + }, + -- visual mode(what's the difference between v and x???) + x = { + -- refactoring + ["ri"] = { + function() require("refactoring").refactor "Inline Variable" end, + desc = "Inverse of extract variable", + }, + ["re"] = { + function() require("refactoring").refactor "Extract Function" end, + desc = "Extracts the selected code to a separate function", + }, + ["rf"] = { + function() require("refactoring").refactor "Extract Function To File" end, + desc = "Extract Function To File", + }, + ["rv"] = { + function() require("refactoring").refactor "Extract Variable" end, + desc = "Extracts occurrences of a selected expression to its own variable", + }, + ["rr"] = { + function() require("telescope").extensions.refactoring.refactors() end, + desc = "Prompt for a refactor to apply", + }, }, }, -- A custom `on_attach` function to be run after the default `on_attach` function diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/astroui.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/astroui.lua index b4129369..d1135454 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/astroui.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/astroui.lua @@ -1,5 +1,3 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- AstroUI provides the basis for configuring the AstroNvim User Interface -- Configuration documentation can be found with `:h astroui` -- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/mason.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/mason.lua index c290d814..12bdb9c5 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/mason.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/mason.lua @@ -1,5 +1,3 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- Customize Mason plugins ---@type LazySpec diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/none-ls.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/none-ls.lua index e1f22323..f30a3f2a 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/none-ls.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/none-ls.lua @@ -1,5 +1,3 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- Customize None-ls sources ---@type LazySpec diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/telescope.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/telescope.lua index 1c53f5f4..f8d00c8e 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/telescope.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/telescope.lua @@ -33,6 +33,11 @@ return { previewers.buffer_previewer_maker(filepath, bufnr, opts) end end) + + -- Load Extensions + require("telescope").load_extension "refactoring" + require("telescope").load_extension "yank_history" + require("telescope").load_extension "undo" end require("telescope").setup { diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/treesitter.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/treesitter.lua index 8519384c..3d597783 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/treesitter.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/treesitter.lua @@ -1,5 +1,3 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- Customize Treesitter ---@type LazySpec diff --git a/home/base/tui/editors/neovim/nvim/lua/plugins/user.lua b/home/base/tui/editors/neovim/nvim/lua/plugins/user.lua index 121089ef..76fd493a 100644 --- a/home/base/tui/editors/neovim/nvim/lua/plugins/user.lua +++ b/home/base/tui/editors/neovim/nvim/lua/plugins/user.lua @@ -1,5 +1,3 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- You can also add or configure plugins by creating files in this `plugins/` folder -- Here are some examples: diff --git a/home/base/tui/editors/neovim/nvim/lua/polish.lua b/home/base/tui/editors/neovim/nvim/lua/polish.lua index 8b32fc1e..1acdac90 100644 --- a/home/base/tui/editors/neovim/nvim/lua/polish.lua +++ b/home/base/tui/editors/neovim/nvim/lua/polish.lua @@ -1,5 +1,3 @@ -if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - -- This will run last in the setup process and is a good place to configure -- things like custom filetypes. This just pure lua so anything that doesn't -- fit in the normal config locations above can go here