commit a8126bf9b851ba26227b7cc5fa454f0602dff325 Author: JohnCosta27 Date: Thu Aug 4 12:45:36 2022 +0100 adding nvchad config diff --git a/nvchad/chadrc.lua b/nvchad/chadrc.lua new file mode 100644 index 00000000..dc58bb01 --- /dev/null +++ b/nvchad/chadrc.lua @@ -0,0 +1,43 @@ +local M = {} +local override = require "custom.override" + +M.plugins = { + user = require "custom.plugins", + status = { + dashboard = true, + alpha = true, + }, + override = { + ["lewis6991/gitsigns.nvim"] = { + signcolumn = true, + }, + ["NvChad/ui"] = { + tabufline = { + enabled = true, + lazyload = true, + }, + }, + ["williamboman/mason"] = override.mason, + }, + options = { + lspconfig = { + setup_lspconf = "custom.plugins.lspconfig", + }, + }, +} +M.options = { + user = function() + vim.opt.tabstop = 2 + vim.opt.softtabstop = 2 + vim.opt.shiftwidth = 2 + end +} +M.ui = { + theme = "everforest", + theme_toggle = {"everforest", "everforest_light"}, + lazyload = false, +} + +M.mappings = require "custom.mappings" + +return M diff --git a/nvchad/mappings.lua b/nvchad/mappings.lua new file mode 100644 index 00000000..147da822 --- /dev/null +++ b/nvchad/mappings.lua @@ -0,0 +1,11 @@ +local M = {} + +M.formatter = { + n = { + ["fq"] = {" Neoformat", "Formatted :)"}, + ["b"] = {" Gitsigns toggle_current_line_blame", "Toggled line blames"}, + ["bl"] = {" Gitsigns blame_line", "Line blame"} + } +} + +return M diff --git a/nvchad/override.lua b/nvchad/override.lua new file mode 100644 index 00000000..713ed492 --- /dev/null +++ b/nvchad/override.lua @@ -0,0 +1,9 @@ +local M = {} +M.mason = { + ensure_installed = { + "typescript-language-server", + "tailwindcss-language-server", + "eslint-lsp" + } +} +return M diff --git a/nvchad/plugins/init.lua b/nvchad/plugins/init.lua new file mode 100644 index 00000000..8140c872 --- /dev/null +++ b/nvchad/plugins/init.lua @@ -0,0 +1,11 @@ +return { + ["wakatime/vim-wakatime"] = {}, + ["sbdchd/neoformat"] = {}, + ["williamboman/mason-lspconfig.nvim"] = {}, + ["neovim/nvim-lspconfig"] = { + config = function () + require "plugins.configs.lspconfig" + require "custom.plugins.lspconfig" + end + } +} diff --git a/nvchad/plugins/lspconfig.lua b/nvchad/plugins/lspconfig.lua new file mode 100644 index 00000000..59b11638 --- /dev/null +++ b/nvchad/plugins/lspconfig.lua @@ -0,0 +1,12 @@ +local on_attach = require("plugins.configs.lspconfig").on_attach +local capabilities = require("plugins.configs.lspconfig").capabilities + +local lspconfig = require("lspconfig") +local servers = {"tsserver", "tailwindcss", "eslint" } + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup({ + on_attach = on_attach, + capabilities = capabilities, + }) +end