diff options
| author | seth <[email protected]> | 2023-01-23 15:44:26 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-01-23 16:44:20 -0500 |
| commit | 731f682628837e6934b8b04b470211d3866fd0d8 (patch) | |
| tree | 29cce38fc8ff6636b27edf8830bba6d4fd7efe38 /users/seth/programs/neovim | |
| parent | 79b1d22cc9eb3752ae798d5ca9e6eeefeb86799e (diff) | |
update neovim config
Diffstat (limited to 'users/seth/programs/neovim')
| -rw-r--r-- | users/seth/programs/neovim/config/init.lua | 23 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/ftdetect.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/ftdetect.lua) | 2 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/init.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/config.lua) | 14 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/keymap.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/keymap.lua) | 0 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/config/cmp.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/config/cmp.lua) | 4 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/config/init.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/config/init.lua) | 5 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/config/lsp_config.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/config/lsp_config.lua) | 4 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/config/mason.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/config/mason.lua) | 3 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/config/null_ls.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/config/null_ls.lua) | 10 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/config/sources.lua) | 17 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/init.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/init.lua) | 1 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/keymap.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/keymap.lua) | 0 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/lsp/server.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/lsp/server.lua) | 0 | ||||
| -rw-r--r-- | users/seth/programs/neovim/config/lua/getchoo/plugins.lua (renamed from users/seth/programs/neovim/lua/lua/getchoo/plugins.lua) | 2 | ||||
| -rw-r--r-- | users/seth/programs/neovim/default.nix | 8 | ||||
| -rw-r--r-- | users/seth/programs/neovim/lua/init.lua | 39 | ||||
| -rw-r--r-- | users/seth/programs/neovim/lua/lua/getchoo/init.lua | 4 |
17 files changed, 74 insertions, 62 deletions
diff --git a/users/seth/programs/neovim/config/init.lua b/users/seth/programs/neovim/config/init.lua new file mode 100644 index 0000000..1dbf9bc --- /dev/null +++ b/users/seth/programs/neovim/config/init.lua @@ -0,0 +1,23 @@ +-- +-- getchoo's neovim config (but in lua :p) +-- + +local cmd = vim.cmd +local opt = vim.opt + +vim.g.use_lsp_plugins = false +vim.g.use_mason = false + +require("getchoo") + +-- text options +opt.tabstop = 2 +opt.shiftwidth = 2 +opt.expandtab = false +opt.smartindent = true +opt.wrap = false + +-- appearance +opt.syntax = "on" +cmd("filetype plugin indent on") +opt.termguicolors = true diff --git a/users/seth/programs/neovim/lua/lua/getchoo/ftdetect.lua b/users/seth/programs/neovim/config/lua/getchoo/ftdetect.lua index 5dd569d..c13bdb6 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/ftdetect.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/ftdetect.lua @@ -1,4 +1,6 @@ +-- -- load custom file types +-- local filetypes = { filename = { diff --git a/users/seth/programs/neovim/lua/lua/getchoo/config.lua b/users/seth/programs/neovim/config/lua/getchoo/init.lua index a67f734..83233ea 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/config.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/init.lua @@ -1,7 +1,9 @@ -- --- config for regular plugins +-- setup plugins -- +require("getchoo.plugins") + local M = {} M.bufferline = { @@ -21,5 +23,15 @@ M.lualine = { M.tree = {} +require("bufferline").setup(M.bufferline) +require("lualine").setup(M.lualine) +require("nvim-tree").setup(M.tree) + +if vim.g.use_lsp_plugins then + require("getchoo.ftdetect") + require("getchoo.lsp") +end + require("getchoo.keymap") + return M diff --git a/users/seth/programs/neovim/lua/lua/getchoo/keymap.lua b/users/seth/programs/neovim/config/lua/getchoo/keymap.lua index 9a4484c..9a4484c 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/keymap.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/keymap.lua diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/cmp.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/cmp.lua index 0f0f51f..cef2ad1 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/cmp.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/cmp.lua @@ -1,3 +1,7 @@ +-- +-- config for nvim-cmp +-- + local cmp = require("cmp") local mapping = cmp.mapping local luasnip = require("luasnip") diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/init.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/init.lua index 1c928d3..b3e58dd 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/init.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/init.lua @@ -1,4 +1,7 @@ --- wrapper for all configs +-- +-- load all lsp configs +-- + local cmp = require("getchoo.lsp.config.cmp") local lsp_config = require("getchoo.lsp.config.lsp_config") local mason = require("getchoo.lsp.config.mason") diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/lsp_config.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/lsp_config.lua index 4df3fe0..9874820 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/lsp_config.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/lsp_config.lua @@ -1,3 +1,7 @@ +-- +-- setup lsp_config +-- + local cmp = require("getchoo.lsp.config.cmp") local sources = require("getchoo.lsp.config.sources") diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/mason.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/mason.lua index 6814697..24adffb 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/mason.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/mason.lua @@ -1,4 +1,7 @@ +-- -- config for mason tools +-- + local sources = require("getchoo.lsp.config.sources") local M = {} diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/null_ls.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/null_ls.lua index 42cd30e..16b1b3c 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/null_ls.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/null_ls.lua @@ -1,9 +1,12 @@ +-- +-- config for null_ls +-- + local sources = require("getchoo.lsp.config.sources") local M = {} -- only use null-ls for formatting - -- for neovim >= 8 local lsp_formatting = function(bufnr) vim.lsp.buf.format({ @@ -22,8 +25,9 @@ local formatting_on_attach = function(client, bufnr) group = augroup, buffer = bufnr, callback = function() - -- local params = require("vim.lsp.util").make_formatting_params({}) - -- client.request("textDocument/formatting", params, nil, bufnr) + -- for neovim < 8 + ---- local params = require("vim.lsp.util").make_formatting_params({}) + ---- client.request("textDocument/formatting", params, nil, bufnr) lsp_formatting(bufnr) -- neovim >= 8 end, }) diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/sources.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua index c8c67d1..3b67ab2 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/config/sources.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/config/sources.lua @@ -1,31 +1,30 @@ +-- +-- sources for lsp +-- + local null_ls = require("null-ls") -local code_actions = null_ls.builtins.code_actions local diagnostics = null_ls.builtins.diagnostics local formatting = null_ls.builtins.formatting local M = { lsp_servers = { "rust_analyzer", "pyright", "bashls" }, null_ls = { - code_actions.statix, diagnostics.alex, diagnostics.codespell, - diagnostics.statix, - diagnostics.deadnix, - diagnostics.flake8, - formatting.alejandra, - formatting.black, + diagnostics.pylint, formatting.codespell, formatting.prettier, formatting.rustfmt, formatting.stylua, + formatting.yapf, }, mason = { "alex", - "black", "codespell", - "flake8", "prettier", + "pylint", "stylua", + "yapf", }, } diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/init.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/init.lua index aa3dde5..f354b2a 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/init.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/init.lua @@ -1,6 +1,7 @@ -- -- setup lsp environment -- + require("getchoo.lsp.server") require("getchoo.lsp.keymap") local config = require("getchoo.lsp.config") diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/keymap.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/keymap.lua index 9f34ffa..9f34ffa 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/keymap.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/keymap.lua diff --git a/users/seth/programs/neovim/lua/lua/getchoo/lsp/server.lua b/users/seth/programs/neovim/config/lua/getchoo/lsp/server.lua index 325e1c7..325e1c7 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/lsp/server.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/lsp/server.lua diff --git a/users/seth/programs/neovim/lua/lua/getchoo/plugins.lua b/users/seth/programs/neovim/config/lua/getchoo/plugins.lua index fe510d0..d3f1863 100644 --- a/users/seth/programs/neovim/lua/lua/getchoo/plugins.lua +++ b/users/seth/programs/neovim/config/lua/getchoo/plugins.lua @@ -43,6 +43,7 @@ require("packer").startup(function(use) telescope = true, lsp_trouble = true, }, + no_italic = true, }) vim.api.nvim_command("colorscheme catppuccin") end, @@ -108,4 +109,3 @@ require("packer").startup(function(use) require("packer").sync() end end) - diff --git a/users/seth/programs/neovim/default.nix b/users/seth/programs/neovim/default.nix index 471c885..16d6ad5 100644 --- a/users/seth/programs/neovim/default.nix +++ b/users/seth/programs/neovim/default.nix @@ -8,7 +8,6 @@ enable = true; extraPackages = with pkgs; [ alejandra - black clang codespell deadnix @@ -16,12 +15,13 @@ nodePackages.bash-language-server nodePackages.prettier nodePackages.pyright - python310Packages.flake8 + pylint rust-analyzer rustfmt statix stylua sumneko-lua-language-server + yapf ]; plugins = with pkgs.vimPlugins; [ lualine-nvim @@ -49,8 +49,8 @@ ]; }; - xdg.configFile."nvim" = { - source = ./lua; + xdg.configFile.nvim = { + source = ./config; recursive = true; }; } diff --git a/users/seth/programs/neovim/lua/init.lua b/users/seth/programs/neovim/lua/init.lua deleted file mode 100644 index 262f556..0000000 --- a/users/seth/programs/neovim/lua/init.lua +++ /dev/null @@ -1,39 +0,0 @@ --- --- getchoo's neovim config (but in lua :p) --- - -local cmd = vim.cmd -local opt = vim.opt - -require("getchoo") -require("getchoo.ftdetect") -require("getchoo.lsp") - --- text options -opt.tabstop = 2 -opt.shiftwidth = 2 -opt.expandtab = false -opt.smartindent = true -opt.wrap = false - --- appearance -opt.syntax = "on" -cmd("filetype plugin indent on") -opt.termguicolors = true - -require("catppuccin").setup({ - flavour = "mocha", -- mocha, macchiato, frappe, latte - integrations = { - barbar = true, - gitsigns = true, - lightspeed = true, - mason = true, - cmp = true, - nvimtree = true, - treesitter_context = true, - treesitter = true, - telescope = true, - lsp_trouble = true, - }, -}) -vim.api.nvim_command("colorscheme catppuccin") diff --git a/users/seth/programs/neovim/lua/lua/getchoo/init.lua b/users/seth/programs/neovim/lua/lua/getchoo/init.lua deleted file mode 100644 index f44f622..0000000 --- a/users/seth/programs/neovim/lua/lua/getchoo/init.lua +++ /dev/null @@ -1,4 +0,0 @@ -local config = require("getchoo.config") -require("bufferline").setup(config.bufferline) -require("lualine").setup(config.lualine) -require("nvim-tree").setup(config.tree) |
