diff options
author | Jack Sangdahl <[email protected]> | 2023-06-16 10:33:21 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2023-06-16 10:33:21 -0600 |
commit | 2ff709407ce99d972882717a7738ecde7911708a (patch) | |
tree | dc85b6a109af7112c9427fedfd1589f1173b5ac1 /.config/nvchad | |
parent | 80e924489a8507775924ebad5c38ea098b36a990 (diff) | |
download | dots-2ff709407ce99d972882717a7738ecde7911708a.tar.gz dots-2ff709407ce99d972882717a7738ecde7911708a.zip |
nvchad updates & bd
Diffstat (limited to '.config/nvchad')
-rw-r--r-- | .config/nvchad/chadrc.lua | 17 | ||||
-rw-r--r-- | .config/nvchad/configs/lspconfig.lua | 13 | ||||
-rw-r--r-- | .config/nvchad/configs/null-ls.lua | 37 | ||||
-rw-r--r-- | .config/nvchad/configs/overrides.lua | 50 | ||||
-rw-r--r-- | .config/nvchad/plugins.lua | 46 |
5 files changed, 163 insertions, 0 deletions
diff --git a/.config/nvchad/chadrc.lua b/.config/nvchad/chadrc.lua new file mode 100644 index 00000000..62bf96c3 --- /dev/null +++ b/.config/nvchad/chadrc.lua @@ -0,0 +1,17 @@ +---@type ChadrcConfig +local M = {} + +M.ui = { + statusline = { + theme = "vscode_colored", + separator_style = "default", + }, + tabufline = { + lazyload = true, + }, + theme = "catppuccin", +} + +M.plugins = "custom.plugins" + +return M diff --git a/.config/nvchad/configs/lspconfig.lua b/.config/nvchad/configs/lspconfig.lua new file mode 100644 index 00000000..22e17288 --- /dev/null +++ b/.config/nvchad/configs/lspconfig.lua @@ -0,0 +1,13 @@ +local on_attach = require("plugins.configs.lspconfig").on_attach +local capabilities = require("plugins.configs.lspconfig").capabilities + +local lspconfig = require "lspconfig" + +local servers = { "cssls", "pylsp", "clangd" } + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = on_attach, + capabilities = capabilities, + } +end diff --git a/.config/nvchad/configs/null-ls.lua b/.config/nvchad/configs/null-ls.lua new file mode 100644 index 00000000..cd635ee2 --- /dev/null +++ b/.config/nvchad/configs/null-ls.lua @@ -0,0 +1,37 @@ +local present, null_ls = pcall(require, "null-ls") + +if not present then + return +end + +local b = null_ls.builtins + +local sources = { + -- Lua + b.formatting.stylua, + + -- cpp + b.formatting.clang_format, + + -- rust + b.formatting.rustfmt, + + -- python + b.formatting.black, + + -- json + b.diagnostics.jsonlint, +} + +null_ls.setup { + debug = true, + sources = sources, +} + +local notify = vim.notify +vim.notify = function(msg, ...) + if msg:match("warning: multiple different client offset_encodings") then + return + end + notify(msg, ...) +end diff --git a/.config/nvchad/configs/overrides.lua b/.config/nvchad/configs/overrides.lua new file mode 100644 index 00000000..f12ff680 --- /dev/null +++ b/.config/nvchad/configs/overrides.lua @@ -0,0 +1,50 @@ +local M = {} + +M.treesitter = { + ensure_installed = { + "vim", + "lua", + "html", + "css", + "cpp", + "c", + "markdown", + "markdown_inline", + }, + indent = { + enable = true, + }, +} + +M.mason = { + ensure_installed = { + -- lua stuff + "lua-language-server", + "stylua", + + -- web dev stuff + "css-lsp", + + -- c/cpp stuff + "clangd", + "clang-format", + }, +} + +-- git support in nvimtree +M.nvimtree = { + git = { + enable = true, + }, + + renderer = { + highlight_git = true, + icons = { + show = { + git = true, + }, + }, + }, +} + +return M diff --git a/.config/nvchad/plugins.lua b/.config/nvchad/plugins.lua new file mode 100644 index 00000000..e760bc1d --- /dev/null +++ b/.config/nvchad/plugins.lua @@ -0,0 +1,46 @@ +local overrides = require("custom.configs.overrides") + +---@type NvPluginSpec[] +local plugins = { + + { + "neovim/nvim-lspconfig", + dependencies = { + { + "jose-elias-alvarez/null-ls.nvim", + config = function() + require "custom.configs.null-ls" + end, + }, + }, + config = function() + require "plugins.configs.lspconfig" + require "custom.configs.lspconfig" + end, + }, + + { + "williamboman/mason.nvim", + opts = overrides.mason + }, + + { + "nvim-treesitter/nvim-treesitter", + opts = overrides.treesitter, + }, + + { + "nvim-tree/nvim-tree.lua", + opts = overrides.nvimtree, + }, + + { + "max397574/better-escape.nvim", + event = "InsertEnter", + config = function() + require("better_escape").setup() + end, + }, +} + +return plugins |