Skip to content

Commit

Permalink
add nvchad_types & .stylua.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Mar 18, 2024
1 parent 9d47133 commit 726248c
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"
8 changes: 7 additions & 1 deletion lua/chadrc.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---@type ChadrcConfig
local M = {}

M.ui = {
theme = "onedark",
theme = "onedark",

-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}

return M
10 changes: 8 additions & 2 deletions lua/configs/conform.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
local options = {
lsp_fallback = true,

formatters_by_ft = {
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)
23 changes: 23 additions & 0 deletions lua/configs/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -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,
}
3 changes: 3 additions & 0 deletions lua/options.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require "nvchad.options"

-- add yours here!

-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
34 changes: 28 additions & 6 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre' -- uncomment for format on save
config = function()
require "configs.conform"
end,
},

{
"nvim-tree/nvim-tree.lua",
opts = {
git = { enable = true },
},
},
-- {
-- "neovim/nvim-lspconfig",
-- config = function()
-- 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"
-- },
-- },
-- },
}

0 comments on commit 726248c

Please sign in to comment.