add nvchad_types & .stylua.toml

This commit is contained in:
siduck 2024-03-18 06:34:01 +05:30
parent 9d47133ba1
commit 726248c2f3
6 changed files with 75 additions and 9 deletions

6
.stylua.toml Normal file
View File

@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"

View File

@ -1,7 +1,13 @@
---@type ChadrcConfig
local M = {} local M = {}
M.ui = { M.ui = {
theme = "onedark", theme = "onedark",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
} }
return M return M

View File

@ -1,9 +1,15 @@
local options = { local options = {
lsp_fallback = true,
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
}, },
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
} }
require("conform").setup(options) require("conform").setup(options)

23
lua/configs/lspconfig.lua Normal file
View File

@ -0,0 +1,23 @@
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}

View File

@ -1,3 +1,6 @@
require "nvchad.options" require "nvchad.options"
-- add yours here! -- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

View File

@ -1,15 +1,37 @@
return { return {
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
-- event = 'BufWritePre' -- uncomment for format on save
config = function() config = function()
require "configs.conform" require "configs.conform"
end, end,
}, },
{ -- {
"nvim-tree/nvim-tree.lua", -- "neovim/nvim-lspconfig",
opts = { -- config = function()
git = { enable = true }, -- require("nvchad.configs.lspconfig").defaults()
}, -- require "configs.lspconfig"
}, -- end,
-- },
-- {
-- "williamboman/mason.nvim",
-- opts = {
-- ensure_installed = {
-- "lua-language-server", "stylua",
-- "html-lsp", "css-lsp" , "prettier"
-- },
-- },
-- },
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc
-- "html", "css"
-- },
-- },
-- },
} }