summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-13 20:12:35 -0400
committerseth <[email protected]>2024-07-14 13:47:39 -0400
commit5ec30e9a2b9047713c060c90a5e7930fafc2a3d6 (patch)
tree4c10736c3f5a69d2e214575f0ed1fc0e6d3f2f90 /plugin
parentc9fb0eded5c69af78a1af12e5fdce7b347c40da3 (diff)
flatten plugin structure
Diffstat (limited to 'plugin')
-rw-r--r--plugin/bufferline.lua25
-rw-r--r--plugin/catppuccin.lua33
-rw-r--r--plugin/cmp.lua47
-rw-r--r--plugin/dressing.lua6
-rw-r--r--plugin/fidget.lua6
-rw-r--r--plugin/flash.lua6
-rw-r--r--plugin/gitsigns.lua6
-rw-r--r--plugin/ibl.lua27
-rw-r--r--plugin/lsp-format.lua6
-rw-r--r--plugin/lsp.lua129
-rw-r--r--plugin/lualine.lua11
-rw-r--r--plugin/mini.lua26
-rw-r--r--plugin/telescope.lua6
-rw-r--r--plugin/treesitter.lua11
-rw-r--r--plugin/trouble.lua6
-rw-r--r--plugin/which-key.lua10
16 files changed, 361 insertions, 0 deletions
diff --git a/plugin/bufferline.lua b/plugin/bufferline.lua
new file mode 100644
index 0000000..f6e68ef
--- /dev/null
+++ b/plugin/bufferline.lua
@@ -0,0 +1,25 @@
+if vim.g.did_load_bufferline_plugin then
+ return
+end
+vim.g.did_load_bufferline_plugin = true
+
+require("bufferline").setup({
+ options = {
+ always_show_bufferline = false,
+
+ diagnostics = "nvim_lsp",
+
+ mode = "buffers",
+ numbers = "ordinal",
+ separator_style = "slant",
+
+ offsets = {
+ {
+ filetype = "neo-tree",
+ text = "neo-tree",
+ highlight = "Directory",
+ text_align = "left",
+ },
+ },
+ },
+})
diff --git a/plugin/catppuccin.lua b/plugin/catppuccin.lua
new file mode 100644
index 0000000..79b84ec
--- /dev/null
+++ b/plugin/catppuccin.lua
@@ -0,0 +1,33 @@
+if vim.g.did_load_catppuccin_plugin then
+ return
+end
+vim.g.did_load_catppuccin_plugin = true
+
+local compile_path = vim.fn.stdpath("cache") .. "/catppuccin-nvim"
+vim.fn.mkdir(compile_path, "p")
+vim.opt.runtimepath:append(compile_path)
+
+require("catppuccin").setup({
+ compile_path = compile_path,
+ flavour = "mocha",
+ integrations = {
+ cmp = true,
+ flash = true,
+ gitsigns = true,
+ indent_blankline = {
+ enabled = true,
+ },
+ lsp_trouble = true,
+ native_lsp = {
+ enabled = true,
+ },
+ neotree = true,
+ treesitter = true,
+ telescope = true,
+ which_key = true,
+ },
+
+ no_italic = true,
+})
+
+vim.cmd.colorscheme("catppuccin")
diff --git a/plugin/cmp.lua b/plugin/cmp.lua
new file mode 100644
index 0000000..10c750f
--- /dev/null
+++ b/plugin/cmp.lua
@@ -0,0 +1,47 @@
+if vim.g.did_load_cmp_plugin then
+ return
+end
+vim.g.did_load_cmp_plugin = true
+
+local cmp = require("cmp")
+
+cmp.setup({
+ completion = {
+ compleopt = "menu,menuone,insert",
+ },
+
+ snippet = {
+ expand = function(args)
+ require("luasnip").lsp_expand(args.body)
+ end,
+ },
+
+ mapping = {
+ ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
+ ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
+ ["<C-b>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-Space>"] = cmp.mapping.complete(),
+ ["<C-e>"] = cmp.mapping.abort(),
+ ["<CR>"] = cmp.mapping({
+ i = function(fallback)
+ if cmp.visible() and cmp.get_active_entry() then
+ cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
+ else
+ fallback()
+ end
+ end,
+
+ s = cmp.mapping.confirm({ select = true }),
+ c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
+ }),
+ },
+
+ sources = cmp.config.sources({
+ { name = "nvim_lsp" },
+ { name = "luasnip" },
+ { name = "async_path" },
+ { name = "buffer" },
+ { name = "rg" },
+ }),
+})
diff --git a/plugin/dressing.lua b/plugin/dressing.lua
new file mode 100644
index 0000000..dc926fe
--- /dev/null
+++ b/plugin/dressing.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_dressing_plugin then
+ return
+end
+vim.g.did_load_dressing_plugin = true
+
+require("dressing")
diff --git a/plugin/fidget.lua b/plugin/fidget.lua
new file mode 100644
index 0000000..59fbb0c
--- /dev/null
+++ b/plugin/fidget.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_fidget_plugin then
+ return
+end
+vim.g.did_load_fidget_plugin = true
+
+require("fidget").setup()
diff --git a/plugin/flash.lua b/plugin/flash.lua
new file mode 100644
index 0000000..f3e1c15
--- /dev/null
+++ b/plugin/flash.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_flash_plugin then
+ return
+end
+vim.g.did_load_flash_plugin = true
+
+require("flash").setup()
diff --git a/plugin/gitsigns.lua b/plugin/gitsigns.lua
new file mode 100644
index 0000000..7f6f457
--- /dev/null
+++ b/plugin/gitsigns.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_gitsigns_plugin then
+ return
+end
+vim.g.did_load_gitsigns_plugin = true
+
+require("gitsigns").setup()
diff --git a/plugin/ibl.lua b/plugin/ibl.lua
new file mode 100644
index 0000000..d780c74
--- /dev/null
+++ b/plugin/ibl.lua
@@ -0,0 +1,27 @@
+if vim.g.did_load_ibl_plugin then
+ return
+end
+vim.g.did_load_ibl_plugin = true
+
+require("ibl").setup({
+ exclude = {
+ filetypes = {
+ "help",
+ "neo-tree",
+ "Trouble",
+ "lazy",
+ "mason",
+ "notify",
+ "toggleterm",
+ },
+ },
+
+ indent = {
+ char = "│",
+ tab_char = "│",
+ },
+
+ scope = {
+ enabled = false,
+ },
+})
diff --git a/plugin/lsp-format.lua b/plugin/lsp-format.lua
new file mode 100644
index 0000000..e21bdfd
--- /dev/null
+++ b/plugin/lsp-format.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_lsp_format_plugin then
+ return
+end
+vim.g.did_load_lsp_format_plugin = true
+
+require("lsp-format").setup()
diff --git a/plugin/lsp.lua b/plugin/lsp.lua
new file mode 100644
index 0000000..356add3
--- /dev/null
+++ b/plugin/lsp.lua
@@ -0,0 +1,129 @@
+if vim.g.did_load_lsp_plugin then
+ return
+end
+vim.g.did_load_lsp_plugin = true
+
+local lsp_servers = {
+ astro = {
+ binary = "astro-ls",
+ },
+
+ bashls = {
+ binary = "bash-language-server",
+ },
+
+ biome = {},
+
+ clangd = {},
+
+ denols = {
+ binary = "deno",
+ },
+
+ dprint = {},
+
+ eslint = {
+ binary = "vscode-eslint-language-server",
+ },
+
+ efm = {
+ binary = "efm-langserver",
+ extraOptions = require("getchoo.efmls"),
+ },
+
+ lua_ls = {
+ binary = "lua-language-server",
+ extraOptions = {
+ settings = {
+ Lua = {
+ runtime = { version = "LuaJIT" },
+ diagnostics = { globals = "vim" },
+ workspace = { library = vim.api.nvim_get_runtime_file("", true) },
+ },
+ },
+ },
+ },
+
+ nil_ls = {
+ binary = "nil",
+ extraOptions = {
+ settings = {
+ ["nil"] = {
+ formatting = { command = { "nixfmt" } },
+ },
+ },
+ },
+ },
+
+ nim_langserver = {
+ binary = "nimlangserver",
+ },
+
+ pyright = {
+ extraOptions = {
+ settings = {
+ -- ruff is used instead
+ pyright = { disableOrganizeImports = true },
+ python = { ignore = { "*" } },
+ },
+ },
+ },
+
+ ruff_lsp = {
+ binary = "ruff-lsp",
+ extraOptions = {
+ on_attach = function(client, _)
+ require("lsp-format").on_attach(client)
+ -- pyright should handle this
+ client.server_capabilities.hoverProvider = false
+ end,
+ },
+ },
+
+ rust_analyzer = {
+ binary = "rust-analyzer",
+ extraOptions = {
+ settings = {
+ checkOnSave = { command = "clippy" },
+ },
+ },
+ },
+
+ tsserver = {
+ binary = "typescript-language-server",
+ },
+
+ typos_lsp = {
+ binary = "typos-lsp",
+ },
+
+ typst_lsp = {
+ binary = "typst-lsp",
+ },
+}
+
+local caps = vim.tbl_deep_extend(
+ "force",
+ vim.lsp.protocol.make_client_capabilities(),
+ require("cmp_nvim_lsp").default_capabilities(),
+ -- for nil_ls
+ { workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } }
+)
+
+local setup = {
+ on_attach = function(client, _)
+ require("lsp-format").on_attach(client)
+ end,
+
+ capabilities = caps,
+}
+
+for server, config in pairs(lsp_servers) do
+ local binary = config.binary or server
+
+ local options = (config.extraOptions == nil) and setup or vim.tbl_extend("keep", config.extraOptions, setup)
+
+ if vim.fn.executable(binary) == 1 then
+ require("lspconfig")[server].setup(options)
+ end
+end
diff --git a/plugin/lualine.lua b/plugin/lualine.lua
new file mode 100644
index 0000000..8a8f87a
--- /dev/null
+++ b/plugin/lualine.lua
@@ -0,0 +1,11 @@
+if vim.g.did_load_lualine_plugin then
+ return
+end
+vim.g.did_load_lualine_plugin = true
+
+require("lualine").setup({
+ options = {
+ theme = "catppuccin",
+ },
+ extensions = { "neo-tree", "trouble" },
+})
diff --git a/plugin/mini.lua b/plugin/mini.lua
new file mode 100644
index 0000000..1911516
--- /dev/null
+++ b/plugin/mini.lua
@@ -0,0 +1,26 @@
+if vim.g.did_load_mini_plugin then
+ return
+end
+vim.g.did_load_mini_plugin = true
+
+require("mini.comment").setup()
+require("mini.files").setup()
+require("mini.pairs").setup()
+require("mini.indentscope").setup({
+ options = { try_as_border = true },
+})
+
+vim.api.nvim_create_autocmd("FileType", {
+ pattern = {
+ "help",
+ "neo-tree",
+ "Trouble",
+ "lazy",
+ "mason",
+ "notify",
+ "toggleterm",
+ },
+ callback = function()
+ vim.b.miniindentscope_disable = true
+ end,
+})
diff --git a/plugin/telescope.lua b/plugin/telescope.lua
new file mode 100644
index 0000000..d50d742
--- /dev/null
+++ b/plugin/telescope.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_telescope_plugin then
+ return
+end
+vim.g.did_load_telescope_plugin = true
+
+require("telescope").setup()
diff --git a/plugin/treesitter.lua b/plugin/treesitter.lua
new file mode 100644
index 0000000..4668fe8
--- /dev/null
+++ b/plugin/treesitter.lua
@@ -0,0 +1,11 @@
+if vim.g.did_load_treesitter_plugin then
+ return
+end
+vim.g.did_load_treesitter_plugin = true
+
+require("nvim-treesitter.configs").setup({
+ auto_install = false,
+
+ highlight = { enable = true },
+ indent = { enable = true },
+})
diff --git a/plugin/trouble.lua b/plugin/trouble.lua
new file mode 100644
index 0000000..e1e7768
--- /dev/null
+++ b/plugin/trouble.lua
@@ -0,0 +1,6 @@
+if vim.g.did_load_trouble_plugin then
+ return
+end
+vim.g.did_load_trouble_plugin = true
+
+require("trouble").setup()
diff --git a/plugin/which-key.lua b/plugin/which-key.lua
new file mode 100644
index 0000000..e6d5ecc
--- /dev/null
+++ b/plugin/which-key.lua
@@ -0,0 +1,10 @@
+if vim.g.did_load_which_key_plugin then
+ return
+end
+vim.g.did_load_which_key_plugin = true
+
+require("which-key").setup({
+ plugins = {
+ spelling = { enable = true },
+ },
+})