diff options
Diffstat (limited to 'config/plugin')
| -rw-r--r-- | config/plugin/bufferline.lua | 25 | ||||
| -rw-r--r-- | config/plugin/catppuccin.lua | 34 | ||||
| -rw-r--r-- | config/plugin/cmp.lua | 47 | ||||
| -rw-r--r-- | config/plugin/dressing.lua | 6 | ||||
| -rw-r--r-- | config/plugin/fidget.lua | 6 | ||||
| -rw-r--r-- | config/plugin/flash.lua | 6 | ||||
| -rw-r--r-- | config/plugin/gitsigns.lua | 6 | ||||
| -rw-r--r-- | config/plugin/ibl.lua | 27 | ||||
| -rw-r--r-- | config/plugin/lsp-format.lua | 6 | ||||
| -rw-r--r-- | config/plugin/lsp.lua | 98 | ||||
| -rw-r--r-- | config/plugin/lualine.lua | 11 | ||||
| -rw-r--r-- | config/plugin/mini.lua | 34 | ||||
| -rw-r--r-- | config/plugin/telescope.lua | 6 | ||||
| -rw-r--r-- | config/plugin/treesitter.lua | 16 | ||||
| -rw-r--r-- | config/plugin/trouble.lua | 6 | ||||
| -rw-r--r-- | config/plugin/which-key.lua | 10 |
16 files changed, 344 insertions, 0 deletions
diff --git a/config/plugin/bufferline.lua b/config/plugin/bufferline.lua new file mode 100644 index 0000000..f6e68ef --- /dev/null +++ b/config/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/config/plugin/catppuccin.lua b/config/plugin/catppuccin.lua new file mode 100644 index 0000000..f457fc2 --- /dev/null +++ b/config/plugin/catppuccin.lua @@ -0,0 +1,34 @@ +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_context = true, + treesitter = true, + telescope = true, + which_key = true, + }, + + no_italic = true, +}) + +vim.cmd.colorscheme("catppuccin") diff --git a/config/plugin/cmp.lua b/config/plugin/cmp.lua new file mode 100644 index 0000000..10c750f --- /dev/null +++ b/config/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/config/plugin/dressing.lua b/config/plugin/dressing.lua new file mode 100644 index 0000000..dc926fe --- /dev/null +++ b/config/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/config/plugin/fidget.lua b/config/plugin/fidget.lua new file mode 100644 index 0000000..59fbb0c --- /dev/null +++ b/config/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/config/plugin/flash.lua b/config/plugin/flash.lua new file mode 100644 index 0000000..f3e1c15 --- /dev/null +++ b/config/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/config/plugin/gitsigns.lua b/config/plugin/gitsigns.lua new file mode 100644 index 0000000..7f6f457 --- /dev/null +++ b/config/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/config/plugin/ibl.lua b/config/plugin/ibl.lua new file mode 100644 index 0000000..d780c74 --- /dev/null +++ b/config/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/config/plugin/lsp-format.lua b/config/plugin/lsp-format.lua new file mode 100644 index 0000000..e21bdfd --- /dev/null +++ b/config/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/config/plugin/lsp.lua b/config/plugin/lsp.lua new file mode 100644 index 0000000..0312523 --- /dev/null +++ b/config/plugin/lsp.lua @@ -0,0 +1,98 @@ +if vim.g.did_load_lsp_plugin then + return +end +vim.g.did_load_lsp_plugin = true + +local lsp_servers = { + bashls = { + binary = "bash-language-server", + }, + + clangd = {}, + + eslint = {}, + + 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 = { "alejandra" } }, + }, + }, + }, + }, + + pyright = {}, + 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" }, + }, + }, + }, + + denols = { + binary = "deno", + }, + + tsserver = { + binary = "typescript-language-server", + }, +} + +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/config/plugin/lualine.lua b/config/plugin/lualine.lua new file mode 100644 index 0000000..8a8f87a --- /dev/null +++ b/config/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/config/plugin/mini.lua b/config/plugin/mini.lua new file mode 100644 index 0000000..a1ab447 --- /dev/null +++ b/config/plugin/mini.lua @@ -0,0 +1,34 @@ +if vim.g.did_load_mini_plugin then + return +end +vim.g.did_load_mini_plugin = true + +require("mini.comment").setup({ + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() + or vim.bo.context_commentstring + end, + }, +}) + +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/config/plugin/telescope.lua b/config/plugin/telescope.lua new file mode 100644 index 0000000..d50d742 --- /dev/null +++ b/config/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/config/plugin/treesitter.lua b/config/plugin/treesitter.lua new file mode 100644 index 0000000..f2da8f7 --- /dev/null +++ b/config/plugin/treesitter.lua @@ -0,0 +1,16 @@ +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 }, + + -- nvim-ts-autotag + autotag = { enable = true }, +}) + +vim.g.skip_ts_context_commentstring_module = true diff --git a/config/plugin/trouble.lua b/config/plugin/trouble.lua new file mode 100644 index 0000000..e1e7768 --- /dev/null +++ b/config/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/config/plugin/which-key.lua b/config/plugin/which-key.lua new file mode 100644 index 0000000..e6d5ecc --- /dev/null +++ b/config/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 }, + }, +}) |
