refactor
This commit is contained in:
parent
497a49f55d
commit
b04e688eaa
8 changed files with 1699 additions and 1810 deletions
|
|
@ -1,73 +1,61 @@
|
||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "6a001360cea89df50f7c5cc8c7a75e6a21f1ef5c" },
|
"LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
|
||||||
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
||||||
"cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" },
|
"cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" },
|
||||||
"cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" },
|
"cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
|
||||||
"copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" },
|
"copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" },
|
||||||
"distant.nvim": { "branch": "v0.3", "commit": "998724f62386c8022a4e6c885f4509cf9477451a" },
|
"distant.nvim": { "branch": "v0.3", "commit": "998724f62386c8022a4e6c885f4509cf9477451a" },
|
||||||
"focus.nvim": { "branch": "master", "commit": "c83be53de558f6f0824c8cefcad61719c87ce157" },
|
"focus.nvim": { "branch": "master", "commit": "c83be53de558f6f0824c8cefcad61719c87ce157" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" },
|
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
|
"gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
|
||||||
"glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
|
"glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
|
||||||
"harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" },
|
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
|
||||||
"image.nvim": { "branch": "master", "commit": "41f0f2643a09631bc0d8e2837b514667d423e440" },
|
"image.nvim": { "branch": "master", "commit": "2090055394d5c8efb5f23143cc2f3d9fac68a61e" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "3c8a185da4b8ab7aef487219f5e001b11d4b6aaf" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "ffebf6f7b0649f1eb81b37c37b75552f8ff96337" },
|
"lsp-zero.nvim": { "branch": "v3.x", "commit": "2def059b9d7c45fddc9c072835710ca9a498657c" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
|
||||||
"mason-lspconfig": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" },
|
"mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" },
|
||||||
"mason-null-ls.nvim": { "branch": "main", "commit": "d1f7258f80867f718d643d88eee66959671a4bef" },
|
|
||||||
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
|
|
||||||
"meh": { "branch": "master", "commit": "e2962284bbd53db5cbe2db39efaa3ea74ade0fb1" },
|
"meh": { "branch": "master", "commit": "e2962284bbd53db5cbe2db39efaa3ea74ade0fb1" },
|
||||||
"mini.bufremove": { "branch": "main", "commit": "f53c7f27e36009fe61563c11cde154b94a0e5b94" },
|
"mini.bufremove": { "branch": "main", "commit": "020243bfed8c8b941f2c20626faf3ea39c0c0e1b" },
|
||||||
"mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" },
|
"mini.comment": { "branch": "main", "commit": "67f00d3ebbeae15e84584d971d0c32aad4f4f3a4" },
|
||||||
"nabla.nvim": { "branch": "master", "commit": "f5aff14fa3d60f4be568c444be84400812823648" },
|
"nabla.nvim": { "branch": "master", "commit": "27a6ea9ed7452bb9e0b19eb0942b5bcf7d051b2f" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "230ff118613fa07138ba579b89d13ec2201530b9" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" },
|
||||||
"neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
|
"neorg": { "branch": "main", "commit": "a489e7c4f9d7edb3caa04250d07bb6c6a5b9b890" },
|
||||||
"neodev.nvim": { "branch": "main", "commit": "ef351fae5df2559956398923c5d38c9b64e7d898" },
|
|
||||||
"neorg": { "branch": "main", "commit": "baaf13a3145534144b795ad37db22bfffd2ad343" },
|
|
||||||
"neorg-telescope": { "branch": "main", "commit": "6a7a677c40fa3c348924a4e2a06a513e0b34c056" },
|
"neorg-telescope": { "branch": "main", "commit": "6a7a677c40fa3c348924a4e2a06a513e0b34c056" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
|
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
|
||||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
|
||||||
"nvim-bqf": { "branch": "main", "commit": "bdc2a4e5bb670b3c0e33ada9c0eec636d93a0748" },
|
"nvim-bqf": { "branch": "main", "commit": "bdc2a4e5bb670b3c0e33ada9c0eec636d93a0748" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "84f2dd42efffa20d505ac44c78568d778ca7e0a1" },
|
"nvim-lspconfig": { "branch": "master", "commit": "ce0e625df61be77abe1340fbc9afe9ad39b31dd8" },
|
||||||
"nvim-spectre": { "branch": "master", "commit": "a18a58015b46f02b4fe537ebfffd82e46110ff24" },
|
"nvim-spectre": { "branch": "master", "commit": "d8906855f1949ac97b1e77aaf8d3fe12ed158ddc" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" },
|
"nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "ab818bf5a2ee21515ade9afcf428e98056b6197b" },
|
"nvim-treesitter": { "branch": "master", "commit": "8ae4080c5ba59d81b4e49525d4168807bc098e73" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "cfa8ee19ac9bae9b7fb2958eabe2b45b70c56ccb" },
|
"nvim-treesitter-context": { "branch": "master", "commit": "652ec514d6ba8bc4a3c2de76c855fe668e2c7196" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "85b9d0cbd4ff901abcda862b50dbb34e0901848b" },
|
||||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
|
||||||
"nvim-ufo": { "branch": "main", "commit": "9fa77fb7e4365a053a5303b773aaf5eaf806d1f4" },
|
"nvim-web-devicons": { "branch": "master", "commit": "3e24abe1ae66532135cec911562f553fe247cb56" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" },
|
|
||||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
||||||
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" },
|
|
||||||
"rasmus": { "branch": "main", "commit": "f824de95d446686e479781c0c2b778c177da528f" },
|
"rasmus": { "branch": "main", "commit": "f824de95d446686e479781c0c2b778c177da528f" },
|
||||||
"refactoring.nvim": { "branch": "master", "commit": "156532476deb10b1b2a32cb38e1078b3f9951c42" },
|
"refactoring.nvim": { "branch": "master", "commit": "258041a596d733dc51f6ad1e092ed1f23e3faa70" },
|
||||||
"rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" },
|
"rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" },
|
||||||
"smart-splits.nvim": { "branch": "master", "commit": "f0003bf9c3f11b8b9209264f865b8864453ca926" },
|
"smart-splits.nvim": { "branch": "master", "commit": "403ad1a4fd7eb39388690a5657e7cbfb16da6668" },
|
||||||
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
|
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" },
|
"telescope.nvim": { "branch": "master", "commit": "87e92ea31b2b61d45ad044cf7b2d9b66dad2a618" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
|
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
|
||||||
"tree-sitter-just": { "branch": "main", "commit": "4e5f5f3ff37b12a1bbf664eb3966b3019e924594" },
|
"tree-sitter-just": { "branch": "main", "commit": "2262a409a3a5b832fe85ae563cd523c82f15f17c" },
|
||||||
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
|
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
|
||||||
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
|
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
|
||||||
"venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" },
|
"venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" },
|
||||||
"vim-dispatch": { "branch": "master", "commit": "6cc2691576f97d43f8751664d1a1a908b99927e5" },
|
"vim-dispatch": { "branch": "master", "commit": "6cc2691576f97d43f8751664d1a1a908b99927e5" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },
|
"vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" },
|
||||||
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
|
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
|
||||||
"vim-rsi": { "branch": "master", "commit": "45540637ead22f011e8215f1c90142e49d946a54" },
|
"vim-rsi": { "branch": "master", "commit": "45540637ead22f011e8215f1c90142e49d946a54" },
|
||||||
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
||||||
"vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" },
|
"vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" },
|
||||||
"vimtex": { "branch": "master", "commit": "29b6c052707b2d713fe2097cd5df54ce12ba2f90" },
|
"vimtex": { "branch": "master", "commit": "f9b19d09ee6f0ba70dad0b5c2e710dd700681000" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
|
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
|
||||||
"zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" }
|
"zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" }
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
235
lua/rayandrew/plugins/file.lua
Normal file
235
lua/rayandrew/plugins/file.lua
Normal file
|
|
@ -0,0 +1,235 @@
|
||||||
|
return {
|
||||||
|
------------------------------
|
||||||
|
-- File Management
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
branch = "v3.x",
|
||||||
|
cmd = "Neotree",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
"3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||||
|
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||||
|
filesystem = {
|
||||||
|
bind_to_cwd = false,
|
||||||
|
follow_current_file = { enabled = true },
|
||||||
|
use_libuv_file_watcher = true,
|
||||||
|
hijack_netrw_behavior = "open_current",
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
["<space>"] = "none",
|
||||||
|
-- ["C"] = "copy",
|
||||||
|
["C"] = {
|
||||||
|
"copy",
|
||||||
|
config = {
|
||||||
|
show_path = "absolute", -- "none", "relative", "absolute"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["R"] = "rename",
|
||||||
|
["y"] = function(state)
|
||||||
|
local node = state.tree:get_node()
|
||||||
|
-- get relative path
|
||||||
|
local filepath = node:get_id()
|
||||||
|
local filename = vim.fn.fnamemodify(filepath, ":.")
|
||||||
|
-- local filename = node.name
|
||||||
|
vim.fn.setreg("+", filename)
|
||||||
|
vim.notify("Copied: " .. filename)
|
||||||
|
end,
|
||||||
|
["Y"] = function(state)
|
||||||
|
local node = state.tree:get_node()
|
||||||
|
local filepath = node:get_id()
|
||||||
|
vim.fn.setreg("+", filepath)
|
||||||
|
vim.notify("Copied: " .. filepath)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default_component_configs = {
|
||||||
|
indent = {
|
||||||
|
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||||
|
expander_collapsed = "",
|
||||||
|
expander_expanded = "",
|
||||||
|
expander_highlight = "NeoTreeExpander",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>E",
|
||||||
|
function()
|
||||||
|
vim.cmd("Neotree toggle position=current")
|
||||||
|
end,
|
||||||
|
desc = "Toggle NeoTree as Buffer",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>e",
|
||||||
|
function()
|
||||||
|
vim.cmd("Neotree toggle")
|
||||||
|
end,
|
||||||
|
desc = "Toggle NeoTree",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
deactivate = function()
|
||||||
|
vim.cmd([[Neotree close]])
|
||||||
|
end,
|
||||||
|
init = function()
|
||||||
|
if vim.fn.argc(-1) == 1 then
|
||||||
|
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||||
|
if stat and stat.type == "directory" then
|
||||||
|
require("neo-tree")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
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)
|
||||||
|
vim.api.nvim_create_autocmd("TermClose", {
|
||||||
|
pattern = "*lazygit",
|
||||||
|
callback = function()
|
||||||
|
if package.loaded["neo-tree.sources.git_status"] then
|
||||||
|
require("neo-tree.sources.git_status").refresh()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "X3eRo0/dired.nvim",
|
||||||
|
-- dependencies = { "MunifTanjim/nui.nvim" },
|
||||||
|
-- opts = {
|
||||||
|
-- path_separator = "/", -- Use '/' as the path separator
|
||||||
|
-- show_hidden = true, -- Show hidden files
|
||||||
|
-- show_banner = false, -- Do not show the banner
|
||||||
|
-- hide_details = false, -- Show file details by default
|
||||||
|
-- sort_order = "name", -- Sort files by name by default
|
||||||
|
--
|
||||||
|
-- -- Define keybindings for various 'dired' actions
|
||||||
|
-- keybinds = {
|
||||||
|
-- dired_enter = "<cr>",
|
||||||
|
-- dired_back = "-",
|
||||||
|
-- dired_up = "_",
|
||||||
|
-- dired_rename = "R",
|
||||||
|
-- dired_quit = "q",
|
||||||
|
-- dired_create = "+",
|
||||||
|
-- dired_toggle_colors = "@",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- keys = {
|
||||||
|
-- { "<leader>e", "<cmd>Dired<cr>", desc = "Dired" },
|
||||||
|
-- },
|
||||||
|
-- config = function(_, opts)
|
||||||
|
-- require("dired").setup(opts)
|
||||||
|
-- vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
-- pattern = "dired",
|
||||||
|
-- callback = function()
|
||||||
|
-- local Util = require("rayandrew.util")
|
||||||
|
-- Util.map("n", "c", "<cmd>DiredCreate<cr>")
|
||||||
|
-- Util.map("n", "g", "<cmd>edit<cr>")
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "stevearc/oil.nvim",
|
||||||
|
-- dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
-- cmd = { "Oil" },
|
||||||
|
-- keys = {
|
||||||
|
-- {
|
||||||
|
-- "<leader>e",
|
||||||
|
-- function()
|
||||||
|
-- -- disable in oil filetype
|
||||||
|
-- if vim.bo.filetype == "oil" then
|
||||||
|
-- return
|
||||||
|
-- end
|
||||||
|
-- require("oil").open_float()
|
||||||
|
-- end,
|
||||||
|
-- desc = "Open current directory",
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- "<leader>E",
|
||||||
|
-- function()
|
||||||
|
-- -- disable in oil filetype
|
||||||
|
-- if vim.bo.filetype == "oil" then
|
||||||
|
-- return
|
||||||
|
-- end
|
||||||
|
-- require("oil").open(".")
|
||||||
|
-- end,
|
||||||
|
-- desc = "Open current directory",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- opts = {
|
||||||
|
-- columns = {
|
||||||
|
-- -- "icon",
|
||||||
|
-- -- "permissions",
|
||||||
|
-- -- "size",
|
||||||
|
-- -- "mtime",
|
||||||
|
-- },
|
||||||
|
-- default_file_explorer = true,
|
||||||
|
-- restore_win_options = true,
|
||||||
|
-- float = {
|
||||||
|
-- padding = 2,
|
||||||
|
-- max_width = 240,
|
||||||
|
-- max_height = 70,
|
||||||
|
-- -- width = 0.2,
|
||||||
|
-- -- max_height = 0.5,
|
||||||
|
-- border = "rounded",
|
||||||
|
-- win_options = {
|
||||||
|
-- winblend = 10,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- keymaps = {
|
||||||
|
-- ["<C-i>"] = {
|
||||||
|
-- callback = function()
|
||||||
|
-- if vim.bo.filetype == "oil" then
|
||||||
|
-- local oil = require("oil")
|
||||||
|
-- vim.g.oil_show_info = not vim.g.oil_show_info
|
||||||
|
-- if vim.g.oil_show_info then
|
||||||
|
-- oil.set_columns({
|
||||||
|
-- "permissions",
|
||||||
|
-- "size",
|
||||||
|
-- "mtime",
|
||||||
|
-- "icon",
|
||||||
|
-- })
|
||||||
|
-- else
|
||||||
|
-- oil.set_columns({})
|
||||||
|
-- end
|
||||||
|
-- return
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- desc = "Toggle info",
|
||||||
|
-- },
|
||||||
|
-- ["q"] = "actions.close",
|
||||||
|
-- ["<C-h>"] = "actions.toggle_hidden",
|
||||||
|
-- ["?"] = "actions.show_help",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- init = function()
|
||||||
|
-- vim.g.oil_show_info = false
|
||||||
|
-- -- if vim.fn.argc() == 1 then
|
||||||
|
-- -- local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||||
|
-- -- if stat and stat.type == "directory" then
|
||||||
|
-- -- require("oil")
|
||||||
|
-- -- end
|
||||||
|
-- -- end
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
1034
lua/rayandrew/plugins/general.lua
Normal file
1034
lua/rayandrew/plugins/general.lua
Normal file
File diff suppressed because it is too large
Load diff
83
lua/rayandrew/plugins/lsp.lua
Normal file
83
lua/rayandrew/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
'VonHeikemen/lsp-zero.nvim',
|
||||||
|
branch = 'v3.x',
|
||||||
|
lazy = true,
|
||||||
|
config = false,
|
||||||
|
init = function()
|
||||||
|
-- Disable automatic setup, we are doing it manually
|
||||||
|
vim.g.lsp_zero_extend_cmp = 0
|
||||||
|
vim.g.lsp_zero_extend_lspconfig = 0
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
lazy = false,
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autocompletion
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
dependencies = {
|
||||||
|
{'L3MON4D3/LuaSnip'},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- Here is where you configure the autocompletion settings.
|
||||||
|
local lsp_zero = require('lsp-zero')
|
||||||
|
lsp_zero.extend_cmp()
|
||||||
|
|
||||||
|
-- And you can configure cmp even more, if you want to.
|
||||||
|
local cmp = require('cmp')
|
||||||
|
local cmp_action = lsp_zero.cmp_action()
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
formatting = lsp_zero.cmp_format(),
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-f>'] = cmp_action.luasnip_jump_forward(),
|
||||||
|
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
cmd = {'LspInfo', 'LspInstall', 'LspStart'},
|
||||||
|
event = {'BufReadPre', 'BufNewFile'},
|
||||||
|
dependencies = {
|
||||||
|
{'hrsh7th/cmp-nvim-lsp'},
|
||||||
|
{'williamboman/mason-lspconfig.nvim'},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- This is where all the LSP shenanigans will live
|
||||||
|
local lsp_zero = require('lsp-zero')
|
||||||
|
lsp_zero.extend_lspconfig()
|
||||||
|
|
||||||
|
lsp_zero.on_attach(function(client, bufnr)
|
||||||
|
-- see :help lsp-zero-keybindings
|
||||||
|
-- to learn the available actions
|
||||||
|
lsp_zero.default_keymaps({buffer = bufnr})
|
||||||
|
end)
|
||||||
|
|
||||||
|
require('mason-lspconfig').setup({
|
||||||
|
ensure_installed = {},
|
||||||
|
handlers = {
|
||||||
|
lsp_zero.default_setup,
|
||||||
|
lua_ls = function()
|
||||||
|
-- (Optional) Configure lua language server for neovim
|
||||||
|
local lua_opts = lsp_zero.nvim_lua_ls()
|
||||||
|
require('lspconfig').lua_ls.setup(lua_opts)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
141
lua/rayandrew/plugins/telescope.lua
Normal file
141
lua/rayandrew/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,141 @@
|
||||||
|
return {
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
------------------------------
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
cmd = "Telescope",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
-- NOTE: If you are having trouble with this installation,
|
||||||
|
-- refer to the README for telescope-fzf-native for more instructions.
|
||||||
|
build = "make",
|
||||||
|
cond = function()
|
||||||
|
return vim.fn.executable("make") == 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
version = false,
|
||||||
|
opts = {
|
||||||
|
pickers = {
|
||||||
|
buffers = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<c-d>"] = function(prompt_bufnr)
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
actions.delete_buffer(prompt_bufnr)
|
||||||
|
actions.move_to_top(prompt_bufnr)
|
||||||
|
end,
|
||||||
|
["<c-u>"] = false,
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
["d"] = "delete_buffer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>sp",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("live_grep")
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "Find in Files (Grep)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ps",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("grep_string", {
|
||||||
|
search = vim.fn.input("Grep > "),
|
||||||
|
})
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "Find in Files (Grep)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>bb",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("buffers")
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "List all opened buffers",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>fF",
|
||||||
|
function()
|
||||||
|
local utils = require("telescope.utils")
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("files", { cwd = utils.buffer_dir() })
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "Find Files (root dir)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ff",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("files", { cwd = false })
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "Find Files (cwd)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>fh",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("files", { cwd = false, hidden = true })
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "Find Files with Hidden (cwd)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<space>sm",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("man_pages")
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
desc = "Find Manual",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<space>sh",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fun = Util.telescope("help_tags")
|
||||||
|
fun()
|
||||||
|
end,
|
||||||
|
desc = "Find Help Tags",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<space>/",
|
||||||
|
function()
|
||||||
|
-- require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||||
|
-- winblend = 10,
|
||||||
|
-- previewer = false,
|
||||||
|
-- }))
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("current_buffer_fuzzy_find", {
|
||||||
|
winblend = 10,
|
||||||
|
previewer = false,
|
||||||
|
})
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<space>sd",
|
||||||
|
function()
|
||||||
|
local Util = require("rayandrew.util")
|
||||||
|
local fn = Util.telescope("diagnostics")
|
||||||
|
fn()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
23
lua/rayandrew/plugins/theme.lua
Normal file
23
lua/rayandrew/plugins/theme.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
return {
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
-- Color Scheme
|
||||||
|
------------------------------
|
||||||
|
{
|
||||||
|
"rose-pine/neovim",
|
||||||
|
name = "rose-pine",
|
||||||
|
lazy = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"davidosomething/vim-colors-meh",
|
||||||
|
name = "meh",
|
||||||
|
lazy = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"kvrohit/rasmus.nvim",
|
||||||
|
name = "rasmus",
|
||||||
|
lazy = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
154
lua/rayandrew/plugins/treesitter.lua
Normal file
154
lua/rayandrew/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,154 @@
|
||||||
|
return {
|
||||||
|
------------------------------
|
||||||
|
-- TreeSitter
|
||||||
|
------------------------------
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
init = function()
|
||||||
|
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
|
||||||
|
load_textobjects = true
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"IndianBoy42/tree-sitter-just",
|
||||||
|
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||||
|
config = function(_, opts)
|
||||||
|
require("tree-sitter-just").setup({})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"c",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"latex",
|
||||||
|
"lua",
|
||||||
|
"luadoc",
|
||||||
|
"luap",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"nix",
|
||||||
|
"python",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"rust",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "<C-space>",
|
||||||
|
node_incremental = "<C-space>",
|
||||||
|
scope_incremental = false,
|
||||||
|
node_decremental = "<bs>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
|
keymaps = {
|
||||||
|
["aa"] = "@parameter.outer",
|
||||||
|
["ia"] = "@parameter.inner",
|
||||||
|
["af"] = "@function.outer",
|
||||||
|
["if"] = "@function.inner",
|
||||||
|
["ac"] = "@class.outer",
|
||||||
|
["ic"] = "@class.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = true,
|
||||||
|
goto_next_start = {
|
||||||
|
["]k"] = { query = "@block.outer", desc = "Next block start" },
|
||||||
|
["]f"] = { query = "@function.outer", desc = "Next function start" },
|
||||||
|
["]a"] = { query = "@parameter.inner", desc = "Next parameter start" },
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
["]K"] = { query = "@block.outer", desc = "Next block end" },
|
||||||
|
["]F"] = { query = "@function.outer", desc = "Next function end" },
|
||||||
|
["]A"] = { query = "@parameter.inner", desc = "Next parameter end" },
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
["[k"] = { query = "@block.outer", desc = "Previous block start" },
|
||||||
|
["[f"] = { query = "@function.outer", desc = "Previous function start" },
|
||||||
|
["[a"] = { query = "@parameter.inner", desc = "Previous parameter start" },
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
["[K"] = { query = "@block.outer", desc = "Previous block end" },
|
||||||
|
["[F"] = { query = "@function.outer", desc = "Previous function end" },
|
||||||
|
["[A"] = { query = "@parameter.inner", desc = "Previous parameter end" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
["<leader>a"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
swap_previous = {
|
||||||
|
["<leader>A"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cmd = { "TSUpdateSync" },
|
||||||
|
keys = {
|
||||||
|
{ "<c-space>", desc = "Increment selection" },
|
||||||
|
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-treesitter.install").compilers = { "gcc", "clang" }
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
---@type table<string, boolean>
|
||||||
|
local added = {}
|
||||||
|
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||||
|
if added[lang] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
added[lang] = true
|
||||||
|
return true
|
||||||
|
end, opts.ensure_installed)
|
||||||
|
end
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
|
||||||
|
if load_textobjects then
|
||||||
|
-- PERF: no need to load the plugin, if we only need its queries for mini.ai
|
||||||
|
if opts.textobjects then
|
||||||
|
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
|
||||||
|
if opts.textobjects[mod] and opts.textobjects[mod].enable then
|
||||||
|
local Loader = require("lazy.core.loader")
|
||||||
|
Loader.disabled_rtp_plugins["nvim-treesitter-textobjects"] = nil
|
||||||
|
local plugin = require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
|
||||||
|
require("lazy.core.loader").source_runtime(plugin.dir, "plugin")
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-treesitter/playground",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
opts = {
|
||||||
|
multiline_threshold = 1,
|
||||||
|
},
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue