-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bunch of stuff here - Re-orged plugin structure, just load config files instead of the plugin definitions so dependencies are more apparent. - Removed auto pairs which is breaking: jiangmiao/auto-pairs#366 - Removed other unused plugins catppuccin, octo. Will do more of this later. - Updated all plugins.
- Loading branch information
1 parent
a067774
commit b993ede
Showing
19 changed files
with
602 additions
and
656 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,43 @@ | ||
{ | ||
"auto-pairs": { "branch": "master", "commit": "39f06b873a8449af8ff6a3eee716d3da14d63a76" }, | ||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, | ||
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, | ||
"cmp-git": { "branch": "main", "commit": "f900a4cf117300fdc3ba31d26f8b6223ccd9c574" }, | ||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, | ||
"cmp-nvim-ultisnips": { "branch": "main", "commit": "24bca5c3e137b28cd87442d4fc51a2b312dd99cc" }, | ||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, | ||
"gem-ctags": { "branch": "master", "commit": "f947ed4e1f093e48d2305419475d0c9796e354b0" }, | ||
"gitsigns.nvim": { "branch": "main", "commit": "5d73da785a3c05fd63ac31769079db05169a6ec7" }, | ||
"kanagawa.nvim": { "branch": "master", "commit": "1749cea392acb7d1548a946fcee1e6f1304cd3cb" }, | ||
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, | ||
"leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" }, | ||
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, | ||
"mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" }, | ||
"neodev.nvim": { "branch": "main", "commit": "6adf4931c2a1a532d3f7a5c2217c280a07a1aabb" }, | ||
"neovim": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" }, | ||
"nvim": { "branch": "main", "commit": "057c34f849cf21059487d849e2f3b3efcd4ee0eb" }, | ||
"nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, | ||
"nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" }, | ||
"nvim-treesitter": { "branch": "master", "commit": "19b29f7cb046317b74e60fc7bff2f86ece4dc118" }, | ||
"nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" }, | ||
"nvim-treesitter-endwise": { "branch": "master", "commit": "9298b3ac8fd6d0d8f9e321194c6d3fd37e417cf9" }, | ||
"nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, | ||
"octo.nvim": { "branch": "master", "commit": "22328c578bc013fa4b0cef3d00af35efe0c0f256" }, | ||
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, | ||
"smart-splits.nvim": { "branch": "master", "commit": "7aad6019dee974a01333523a5b8e122b7e7da454" }, | ||
"splitjoin.vim": { "branch": "main", "commit": "4073ac528b5e552a6b4347cacca9899f74b98843" }, | ||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, | ||
"telescope.nvim": { "branch": "0.1.x", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, | ||
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, | ||
"treesj": { "branch": "main", "commit": "3203aa553217921fd4dcb79245f9df07278910b2" }, | ||
"trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, | ||
"typescript.nvim": { "branch": "main", "commit": "de304087e6e49981fde01af8ccc5b21e8519306f" }, | ||
"ultisnips": { "branch": "master", "commit": "0ad238b1910d447476b2d98f593322c1cdb71285" }, | ||
"vim-bundler": { "branch": "master", "commit": "5b2c2bae7eb84c70a3830dcf4f00394226a18450" }, | ||
"gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, | ||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, | ||
"leap.nvim": { "branch": "main", "commit": "b6ae80f8fc9993638608fc1a51c6ab0eeb12618c" }, | ||
"mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, | ||
"mason.nvim": { "branch": "main", "commit": "eabf6d347fdb75be360d4c0ced1145670a171453" }, | ||
"neodev.nvim": { "branch": "main", "commit": "80487e4f7bfa11c2ef2a1b461963db019aad6a73" }, | ||
"neovim": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" }, | ||
"nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, | ||
"nvim-lspconfig": { "branch": "master", "commit": "b44737605807023d32e6310b87ba69f4dbf10e0e" }, | ||
"nvim-treesitter": { "branch": "master", "commit": "bef2c24e23d0da62a8542b1f08b1ac87ec43e93f" }, | ||
"nvim-treesitter-context": { "branch": "master", "commit": "2806d83e3965017382ce08792ee527e708fa1bd4" }, | ||
"nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" }, | ||
"nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, | ||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, | ||
"smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" }, | ||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, | ||
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, | ||
"treesj": { "branch": "main", "commit": "070e6761d0b11a55446d988a69908f7a0928dbab" }, | ||
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, | ||
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, | ||
"ultisnips": { "branch": "master", "commit": "b393ba65386d47664421e1f8b246a87a6e8b218c" }, | ||
"vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" }, | ||
"vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, | ||
"vim-dispatch": { "branch": "master", "commit": "6cc2691576f97d43f8751664d1a1a908b99927e5" }, | ||
"vim-eunuch": { "branch": "master", "commit": "67f3dd32b4dcd1c427085f42ff5f29c7adc645c6" }, | ||
"vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, | ||
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, | ||
"vim-projectionist": { "branch": "master", "commit": "e292c4e33b2c44074c47c06e8ce8b309fd8099bc" }, | ||
"vim-rails": { "branch": "master", "commit": "2b8c4fc831e0de2681beda0a2f48222812920a1d" }, | ||
"vim-rake": { "branch": "master", "commit": "e08049f812d241bbc72127aeafa8afa2f6720886" }, | ||
"vim-rails": { "branch": "master", "commit": "1ad9663ce31e8c08134849d04184cda94bb42aba" }, | ||
"vim-rake": { "branch": "master", "commit": "af4ee966f5479fa89e60be067b6183f6addf9e4e" }, | ||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, | ||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, | ||
"vim-snippets": { "branch": "master", "commit": "76e35f37aa9e47a8b7f2909de222844ae38c7007" }, | ||
"vim-snippets": { "branch": "master", "commit": "b039190177d97a968d80518470910aae7faf182a" }, | ||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, | ||
"vim-test": { "branch": "master", "commit": "63d317c2f6c34e561987d4ab0aa003d8391c4033" } | ||
"vim-test": { "branch": "master", "commit": "5880b17c3baf31a22077538dad5d88c658874303" } | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
M = {} | ||
|
||
M.setup = function() | ||
require("gitsigns").setup({ | ||
signs = { | ||
add = { text = "│" }, | ||
change = { text = "│" }, | ||
delete = { text = "-" }, | ||
topdelete = { text = "-" }, | ||
changedelete = { text = "~" }, | ||
untracked = { text = "┆" }, | ||
}, | ||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` | ||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl` | ||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` | ||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` | ||
watch_gitdir = { | ||
follow_files = true, | ||
}, | ||
attach_to_untracked = true, | ||
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` | ||
current_line_blame_opts = { | ||
virt_text = true, | ||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' | ||
delay = 1000, | ||
ignore_whitespace = false, | ||
}, | ||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>", | ||
sign_priority = 6, | ||
update_debounce = 100, | ||
status_formatter = nil, -- Use default | ||
max_file_length = 40000, -- Disable if file is longer than this (in lines) | ||
preview_config = { | ||
-- Options passed to nvim_open_win | ||
border = "single", | ||
style = "minimal", | ||
relative = "cursor", | ||
row = 0, | ||
col = 1, | ||
}, | ||
yadm = { | ||
enable = false, | ||
}, | ||
on_attach = function(bufnr) | ||
local gs = package.loaded.gitsigns | ||
|
||
local function map(mode, l, r, opts) | ||
opts = opts or {} | ||
opts.buffer = bufnr | ||
vim.keymap.set(mode, l, r, opts) | ||
end | ||
|
||
-- Navigation | ||
map("n", "]c", function() | ||
if vim.wo.diff then | ||
return "]c" | ||
end | ||
vim.schedule(function() | ||
gs.next_hunk() | ||
end) | ||
return "<Ignore>" | ||
end, { expr = true }) | ||
|
||
map("n", "[c", function() | ||
if vim.wo.diff then | ||
return "[c" | ||
end | ||
vim.schedule(function() | ||
gs.prev_hunk() | ||
end) | ||
return "<Ignore>" | ||
end, { expr = true }) | ||
|
||
-- Actions | ||
map("n", "<leader>hs", gs.stage_hunk) | ||
map("n", "<leader>hu", gs.undo_stage_hunk) | ||
map("n", "<leader>hp", gs.preview_hunk) | ||
map("n", "<leader>hr", gs.reset_hunk) | ||
map("v", "<leader>hs", function() | ||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) | ||
end) | ||
map("v", "<leader>hr", function() | ||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) | ||
end) | ||
map("n", "<leader>hS", gs.stage_buffer) | ||
map("n", "<leader>hR", gs.reset_buffer) | ||
map("n", "<leader>hb", function() | ||
gs.blame_line({ full = true }) | ||
end) | ||
map("n", "<leader>tb", gs.toggle_current_line_blame) | ||
map("n", "<leader>hd", gs.diffthis) | ||
map("n", "<leader>hD", function() | ||
gs.diffthis("~") | ||
end) | ||
map("n", "<leader>td", gs.toggle_deleted) | ||
|
||
-- Text object | ||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>") | ||
end, | ||
}) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
M = {} | ||
M.setup = function() | ||
-- TODO: Extract concerns to different plugin configs | ||
|
||
require("mason").setup() | ||
require("mason-lspconfig").setup({ | ||
ensure_installed = { | ||
"eslint", | ||
"lua_ls", | ||
"marksman", | ||
"rust_analyzer", | ||
"tailwindcss", | ||
"tsserver", | ||
}, | ||
}) | ||
|
||
local lsp_config = require("lspconfig") | ||
|
||
local client_capabilities = vim.lsp.protocol.make_client_capabilities() | ||
local capabilities = require("cmp_nvim_lsp").default_capabilities(client_capabilities) | ||
|
||
local create_lsp_user_commands = function(client, bufnr) | ||
local opts = { buffer = bufnr } | ||
|
||
vim.api.nvim_buf_create_user_command(bufnr, "LspDiagnosticLine", vim.diagnostic.open_float, {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspDiagnosticNext", vim.diagnostic.goto_next, {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspDiagnosticPrev", vim.diagnostic.goto_prev, {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspDiagnosticSetLoclist", vim.diagnostic.setloclist, {}) | ||
vim.keymap.set("n", "<leader>d", ":LspDiagnosticLine<cr>", opts) | ||
vim.keymap.set("n", "[d", ":LspDiagnosticPrev<cr>", opts) | ||
vim.keymap.set("n", "]d", ":LspDiagnosticNext<cr>", opts) | ||
|
||
if client.supports_method("textDocument/codeAction") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspCodeAction", vim.lsp.buf.code_action, {}) | ||
vim.keymap.set({ "n", "v" }, "<leader>a", vim.lsp.buf.code_action, opts) | ||
end | ||
|
||
if client.supports_method("textDocument/definition") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspDefintion", vim.lsp.buf.definition, {}) | ||
vim.keymap.set("n", "gd", ":LspDefintion<cr>", opts) | ||
end | ||
|
||
if client.supports_method("textDocument/implementation") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspImplementation", vim.lsp.buf.implementation, {}) | ||
vim.keymap.set("n", "gi", ":LspImplementation<cr>", opts) | ||
end | ||
|
||
if client.supports_method("textDocument/typeDefinition") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspTypeDefinition", vim.lsp.buf.type_definition, {}) | ||
vim.keymap.set("n", "gy", ":LspTypeDefinition<cr>", opts) | ||
end | ||
|
||
if client.supports_method("textDocument/hover") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspHover", vim.lsp.buf.hover, {}) | ||
vim.keymap.set("n", "K", ":LspHover<cr>", opts) | ||
end | ||
|
||
if client.supports_method("textDocument/signatureHelp") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspSignatureHelp", vim.lsp.buf.signature_help, {}) | ||
end | ||
|
||
if client.supports_method("textDocument/documentSymbols") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspDocumentSymbols", vim.lsp.buf.document_symbol, {}) | ||
end | ||
|
||
local filtered_formatting = function() | ||
vim.lsp.buf.format({ | ||
-- TODO: Depend on abstractions not concretions | ||
filter = function(ls_client) | ||
return ls_client.name ~= "tsserver" | ||
end, | ||
bufnr = bufnr, | ||
}) | ||
end | ||
|
||
if client.supports_method("textDocument/formatting") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspFormat", filtered_formatting, {}) | ||
vim.keymap.set("n", "<leader>f", ":LspFormat<cr>", opts) | ||
end | ||
|
||
if client.supports_method("textDocument/rangeFormatting") then | ||
vim.keymap.set("v", "<leader>f", filtered_formatting, opts) | ||
end | ||
|
||
if client.supports_method("textDocument/references") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspReferences", vim.lsp.buf.references, {}) | ||
-- TODO: Move to trouble config | ||
vim.keymap.set("n", "gR", ":TroubleToggle lsp_references<cr>", { buffer = bufnr }) | ||
end | ||
|
||
-- FIXME: Range actions not working in TS? | ||
if client.supports_method("textDocument/rename") then | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspRename", vim.lsp.buf.rename, {}) | ||
end | ||
end | ||
|
||
local on_lsp_attach = function(client, bufnr) | ||
create_lsp_user_commands(client, bufnr) | ||
end | ||
|
||
require("neodev").setup({}) | ||
lsp_config.lua_ls.setup({ | ||
on_attach = on_lsp_attach, | ||
capabilities = capabilities, | ||
}) | ||
|
||
-- ruby_ls | ||
-- textDocument/diagnostic support not until nvim 0.10.0 is released | ||
-- Until then we are using solargraph again which is working better than ruby_ls anyway | ||
lsp_config.solargraph.setup({ | ||
on_attach = on_lsp_attach, | ||
capabilities = capabilities | ||
}) | ||
|
||
require("typescript").setup({ | ||
server = { | ||
capabilities = capabilities, | ||
on_attach = function(client, bufnr) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspOrganizeImports", "TypescriptOrganizeImports", {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspAddMissingImports", "TypescriptAddMissingImports", {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspFixAll", "TypescriptFixAll", {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspRemoveUnused", "TypescriptRemoveUnused", {}) | ||
vim.api.nvim_buf_create_user_command(bufnr, "LspRenameFile", "TypescriptRenameFile", {}) | ||
|
||
on_lsp_attach(client, bufnr) | ||
end, | ||
}, | ||
}) | ||
|
||
lsp_config.tailwindcss.setup({ | ||
capabilities = capabilities, | ||
on_attach = on_lsp_attach, | ||
}) | ||
|
||
lsp_config.rust_analyzer.setup({ | ||
capabilities = capabilities, | ||
on_attach = on_lsp_attach, | ||
}) | ||
|
||
lsp_config.gopls.setup({ | ||
capabilities = capabilities, | ||
on_attach = on_lsp_attach, | ||
}) | ||
|
||
lsp_config.marksman.setup({ | ||
capabilities = capabilities, | ||
on_attach = on_lsp_attach, | ||
filetypes = { | ||
"markdown", | ||
"gitcommit", | ||
} | ||
}) | ||
|
||
lsp_config.eslint.setup({ | ||
on_attach = on_lsp_attach, | ||
capabilities = capabilities, | ||
filetypes = { | ||
"javascript", | ||
"typescript" | ||
} | ||
}) | ||
end | ||
return M |
Oops, something went wrong.