Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nvchad #35

Merged
merged 15 commits into from
Oct 24, 2023
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "general/NvChad"]
path = general/NvChad
url = https://github.com/NvChad/NvChad.git
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ My Personal Home Directory.
### linux

install

```bash
HOMECLI_INSTALL_DIR=$HOME/.homecli /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/BrightXiaoHan/HOME/main/scripts/install.sh)"
```

update

```bash
HOMECLI_INSTALL_DIR=$HOME/.homecli /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/BrightXiaoHan/HOME/main/scripts/update.sh)"
```


uninstall

```bash
Expand All @@ -30,19 +32,21 @@ HOMECLI_INSTALL_DIR=$HOME/.homecli /bin/bash -c "$(curl -fsSL https://raw.github

unpack

* Download prepacked `home-cli.tar` file and `install.sh`
* Run `install.sh`
- Download prepacked `home-cli.tar` file and `install.sh`
- Run `install.sh`

```bash
HOMECLI_INSTALL_DIR=$HOME/.homecli bash install.sh unpack homecli.tar.gz
```

uninstall but don't delete installation cache, you can relink it if needed.

```bash
HOMECLI_INSTALL_DIR=$HOME/.homecli bash scripts/uninstall.sh false
```

relink

```bash
HOMECLI_INSTALL_DIR=$HOME/.homecli bash scripts/install.sh relink
```
Expand Down
1 change: 1 addition & 0 deletions general/NvChad
Submodule NvChad added at fd10af
24 changes: 24 additions & 0 deletions general/custom/chadrc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---@type ChadrcConfig
local M = {}

-- Path to overriding theme and highlights files
local highlights = require("custom.highlights")

M.ui = {
theme = "vscode_dark",
theme_toggle = { "blossom_light", "vscode_dark" },

hl_override = highlights.override,
hl_add = highlights.add,

nvdash = {
load_on_startup = true,
}
}

M.plugins = "custom.plugins"

-- check core.mappings for table structure
M.mappings = require("custom.mappings")

return M
17 changes: 17 additions & 0 deletions general/custom/configs/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities

local lspconfig = require("lspconfig")

-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd", "pyright", "lua_ls", "bashls"}

for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({
on_attach = on_attach,
capabilities = capabilities,
})
end

--
-- lspconfig.pyright.setup { blabla}
50 changes: 50 additions & 0 deletions general/custom/configs/null-ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local null_ls = require("null-ls")

local b = null_ls.builtins

local sources = {

-- webdev stuff
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
b.formatting.prettier.with({
filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"css",
"scss",
"less",
"html",
"json",
"jsonc",
"yaml",
"markdown",
"markdown.mdx",
"graphql",
"handlebars",
},
}), -- so prettier works only on these filetypes

-- Lua
b.formatting.stylua,

-- cpp
b.formatting.clang_format,

-- python
b.formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
b.formatting.black.with({ extra_args = { "--fast" } }),
b.formatting.stylua,
b.formatting.isort,
b.formatting.autoflake.with({ extra_args = { "--remove-all-unused-imports", "--remove-unused-variables" } }),

-- bash sh
b.formatting.shfmt.with({ filetypes = { "sh" } }), -- sh
}

null_ls.setup({
debug = false,
sources = sources,
})
111 changes: 111 additions & 0 deletions general/custom/configs/overrides.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
local M = {}

M.treesitter = {
ensure_installed = {
"lua",
"c",
"cpp",
"fish",
"python",
"bash",
},
indent = {
enable = true,
disable = {},
},
}

M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",

-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",

-- c/cpp stuff
"clangd",
"clang-format",

-- python stuff
"pyright",
"black",
"isort",
"mypy",
},
}

local function nvimtree_attach(bufnr)
local api = require("nvim-tree.api")

local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end

api.config.mappings.default_on_attach(bufnr)

vim.keymap.set("n", "l", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "v", api.node.open.vertical, opts("Open: Vertical Split"))
vim.keymap.set("n", "h", api.node.open.horizontal, opts("Open: Horizontal Split"))
end

-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},

on_attach = nvimtree_attach,

renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}

M.cmp = {
mapping = {
["<Up>"] = require("cmp").mapping.select_prev_item(),
["<Down>"] = require("cmp").mapping.select_next_item(),
["<C-e>"] = require("cmp").mapping.close(),
["<Tab>"] = require("cmp").config.disable,
},
sources = {
{ name = "path" },
{ name = "nvim_lsp", max_item_count = 3 },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "treesitter" },
},
-- disable auto-complete
-- completion = {
-- autocomplete = false,
-- },
}

-- if win32 then use powershell else fish
if vim.fn.has("win32") == 1 then
SHELL = "powershell.exe"
else
SHELL = "fish"
end

M.nvterm = {
terminals = {
shell = SHELL,
type_opts = {
horizontal = { location = "rightbelow", split_ratio = 0.5, size = 50 },
},
},
}

return M
19 changes: 19 additions & 0 deletions general/custom/highlights.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- To find any highlight groups: "<cmd> Telescope highlights"
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
-- base30 variable names can also be used as colors

local M = {}

---@type Base46HLGroupsList
M.override = {
Comment = {
italic = true,
},
}

---@type HLTable
M.add = {
NvimTreeOpenedFolderName = { fg = "green", bold = true },
}

return M
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
vim.opt.scrolloff = 8

vim.g.mkdp_echo_preview_url = 1
vim.g.mkdp_open_to_the_world = 1
vim.g.mkdp_port = 33333
Loading