diff --git a/_nvchad_custom/README.md b/_nvchad_custom/README.md new file mode 100644 index 0000000..0cc616c --- /dev/null +++ b/_nvchad_custom/README.md @@ -0,0 +1,3 @@ +# Example_config + +This can be used as an example custom config for NvChad. Do check the https://github.com/NvChad/nvcommunity diff --git a/_nvchad_custom/chadrc.lua b/_nvchad_custom/chadrc.lua new file mode 100644 index 0000000..2cd5c4a --- /dev/null +++ b/_nvchad_custom/chadrc.lua @@ -0,0 +1,23 @@ + --@type ChadrcConfig +local M = {} + +-- Path to overriding theme and highlights files +local highlights = require "custom.highlights" + +M.ui = { + theme = "monekai", + + hl_override = highlights.override, + hl_add = highlights.add, + + statusline = { + theme = "vscode_colored", + } +} + +M.plugins = "custom.plugins" + +-- check core.mappings for table structure +M.mappings = require "custom.mappings" + +return M diff --git a/_nvchad_custom/configs/lspconfig.lua b/_nvchad_custom/configs/lspconfig.lua new file mode 100644 index 0000000..4a7968e --- /dev/null +++ b/_nvchad_custom/configs/lspconfig.lua @@ -0,0 +1,16 @@ +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 = {} + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = on_attach, + capabilities = capabilities, + } +end + +-- lspconfig.pyright.setup { blabla} diff --git a/_nvchad_custom/configs/null-ls.lua b/_nvchad_custom/configs/null-ls.lua new file mode 100644 index 0000000..99cdbf1 --- /dev/null +++ b/_nvchad_custom/configs/null-ls.lua @@ -0,0 +1,21 @@ +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 = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes + + -- Lua + b.formatting.stylua, + + -- cpp + b.formatting.clang_format, +} + +null_ls.setup { + debug = true, + sources = sources, +} diff --git a/_nvchad_custom/configs/overrides.lua b/_nvchad_custom/configs/overrides.lua new file mode 100644 index 0000000..685995e --- /dev/null +++ b/_nvchad_custom/configs/overrides.lua @@ -0,0 +1,41 @@ +local M = {} + +M.treesitter = { + ensure_installed = { + "bash", + "lua", + "markdown", + "markdown_inline", + "python", + "terraform", + "vim", + }, + indent = { + enable = true, + -- disable = { + -- "python" + -- }, + }, +} + +-- M.mason = { +-- ensure_installed = {}, +-- } + +-- git support in nvimtree +M.nvimtree = { + git = { + enable = true, + }, + + renderer = { + highlight_git = true, + icons = { + show = { + git = true, + }, + }, + }, +} + +return M diff --git a/_nvchad_custom/highlights.lua b/_nvchad_custom/highlights.lua new file mode 100644 index 0000000..b05818d --- /dev/null +++ b/_nvchad_custom/highlights.lua @@ -0,0 +1,29 @@ +-- To find any highlight groups: " 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 = { + -- ColorColumn = { bg = "#770000" }, + -- Comment = { italic = true, }, + -- DiffChange = { bg = "NONE", fg = "#e7c547" }, + -- DiffText = { bg = "NONE", fg = "#ff8700" }, + -- FoldColumn = { bg = "NONE" }, + -- NormalFloat = { bg = "NONE" }, + -- LineNr = { bg = "NONE", fg = "#465457" }, + -- NonText = { bg = "NONE" }, + -- Normal = { bg = "NONE" }, + -- SignColumn = { bg = "NONE" }, + -- SpellBad = { bg = "#770000", fg = "#ffffff" }, + -- TelescopeNormal = { bg = "NONE" }, + -- Visual = { bg = "#005577", fg = "#ffffff" }, +} + +---@type HLTable +M.add = { + NvimTreeOpenedFolderName = { fg = "green", bold = true }, +} + +return M diff --git a/_nvchad_custom/init.lua b/_nvchad_custom/init.lua new file mode 100644 index 0000000..b2939e2 --- /dev/null +++ b/_nvchad_custom/init.lua @@ -0,0 +1,22 @@ +local autocmd = vim.api.nvim_create_autocmd +local opt = vim.opt + +autocmd("BufRead", { + pattern = "*.gotmpl", + command = "set filetype=yaml", +}) +autocmd("BufNewFile", { + pattern = "*.gotmpl", + command = "set filetype=yaml", +}) + +opt.hlsearch = false +opt.shiftround = true +opt.relativenumber = false +opt.wrap = true +opt.writebackup = false + +opt.foldcolumn = "0" +-- opt.laststatus = 2 +-- opt.mouse = "" +-- opt.scrolloff = 5 diff --git a/_nvchad_custom/mappings.lua b/_nvchad_custom/mappings.lua new file mode 100644 index 0000000..61e6a04 --- /dev/null +++ b/_nvchad_custom/mappings.lua @@ -0,0 +1,30 @@ +local M = {} + +M.disabled = { + n = { + ["m"] = "", + } +} + +M.general = { + i = { + [""] = { "I" }, + [""] = { "A" }, + }, + n = { + [""] = { "wq!", "Save and Exit" }, + ["m"] = { 'execute "set colorcolumn=" . (&colorcolumn == "" ? "80,120" : "")', "Toggle Column" }, + ["h"] = { "set hlsearch!", "Toggle hlsearch" }, + ["j"] = { "bprevious", "Buffer Previous" }, + ["k"] = { "bnext", "Buffer Next" }, + ["n"] = { 'set number!IndentBlanklineToggleexecute "set signcolumn=" . (&signcolumn == "yes" ? "no" : "yes")', "Toggle Decorations" }, + ["w"] = { "lua require('whitespace-nvim').trim()", "Trim Trailing Whitespaces" }, + ["x"] = { "bd", "Buffer Close" }, + [""] = { "w", }, + }, + v = { + [">"] = { ">gv", "indent"}, + }, +} + +return M diff --git a/_nvchad_custom/plugins.lua b/_nvchad_custom/plugins.lua new file mode 100644 index 0000000..2ed8db8 --- /dev/null +++ b/_nvchad_custom/plugins.lua @@ -0,0 +1,65 @@ +local overrides = require("custom.configs.overrides") + +---@type NvPluginSpec[] +local plugins = { + + -- Override plugin definition options + + { + "neovim/nvim-lspconfig", + dependencies = { + -- format & linting + { + "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, -- Override to setup mason-lspconfig + }, + + -- override plugin configs + { + "williamboman/mason.nvim", + opts = overrides.mason + }, + + { + "nvim-treesitter/nvim-treesitter", + opts = overrides.treesitter, + }, + + { + "nvim-tree/nvim-tree.lua", + opts = overrides.nvimtree, + }, + + -- Install a plugin + { + "max397574/better-escape.nvim", + event = "InsertEnter", + config = function() + require("better_escape").setup() + end, + }, + + -- To make a plugin not be loaded + -- { + -- "NvChad/nvim-colorizer.lua", + -- enabled = false + -- }, + + -- All NvChad plugins are lazy-loaded by default + -- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false` + -- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example + -- { + -- "mg979/vim-visual-multi", + -- lazy = false, + -- } +} + +return plugins diff --git a/_cli/astronvim/lua/user/highlights/init.lua b/_unused/astronvim/lua/user/highlights/init.lua similarity index 100% rename from _cli/astronvim/lua/user/highlights/init.lua rename to _unused/astronvim/lua/user/highlights/init.lua diff --git a/_cli/astronvim/lua/user/init.lua b/_unused/astronvim/lua/user/init.lua similarity index 100% rename from _cli/astronvim/lua/user/init.lua rename to _unused/astronvim/lua/user/init.lua diff --git a/_cli/astronvim/lua/user/mappings.lua b/_unused/astronvim/lua/user/mappings.lua similarity index 100% rename from _cli/astronvim/lua/user/mappings.lua rename to _unused/astronvim/lua/user/mappings.lua diff --git a/_cli/astronvim/lua/user/options.lua b/_unused/astronvim/lua/user/options.lua similarity index 100% rename from _cli/astronvim/lua/user/options.lua rename to _unused/astronvim/lua/user/options.lua diff --git a/_cli/astronvim/lua/user/plugins/init.lua b/_unused/astronvim/lua/user/plugins/init.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/init.lua rename to _unused/astronvim/lua/user/plugins/init.lua diff --git a/_cli/astronvim/lua/user/plugins/lualine.lua b/_unused/astronvim/lua/user/plugins/lualine.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/lualine.lua rename to _unused/astronvim/lua/user/plugins/lualine.lua diff --git a/_cli/astronvim/lua/user/plugins/monokai.lua b/_unused/astronvim/lua/user/plugins/monokai.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/monokai.lua rename to _unused/astronvim/lua/user/plugins/monokai.lua diff --git a/_cli/astronvim/lua/user/plugins/neotree.lua b/_unused/astronvim/lua/user/plugins/neotree.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/neotree.lua rename to _unused/astronvim/lua/user/plugins/neotree.lua diff --git a/_cli/astronvim/lua/user/plugins/notify.lua b/_unused/astronvim/lua/user/plugins/notify.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/notify.lua rename to _unused/astronvim/lua/user/plugins/notify.lua diff --git a/_cli/astronvim/lua/user/plugins/treesitter.lua b/_unused/astronvim/lua/user/plugins/treesitter.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/treesitter.lua rename to _unused/astronvim/lua/user/plugins/treesitter.lua diff --git a/_cli/astronvim/lua/user/plugins/whitespace.lua b/_unused/astronvim/lua/user/plugins/whitespace.lua similarity index 100% rename from _cli/astronvim/lua/user/plugins/whitespace.lua rename to _unused/astronvim/lua/user/plugins/whitespace.lua diff --git a/install.sh b/install.sh index 41b563d..ae66688 100644 --- a/install.sh +++ b/install.sh @@ -19,8 +19,9 @@ git clone https://git.insomniac.pl/ftpd/dotfiles $XDG_DATA_HOME/repos/dotfiles # astronvim rm -rf ~/.config/nvim $XDG_DATA_HOME/repos/AstroNvim ~/.local/share/nvim ~/.local/state/nvim -git clone --depth 1 https://github.com/AstroNvim/AstroNvim $XDG_DATA_HOME/repos/AstroNvim -ln -sf $XDG_DATA_HOME/repos/AstroNvim $XDG_CONFIG_HOME/nvim +git clone https://github.com/NvChad/NvChad $XDG_CONFIG_HOME/nvim --depth 1 +rm -rf $XDG_CONFIG_HOME/nvim/lua/custom +ln -sf $XDG_DATA_HOME/repos/dotfiles/_nvchad_custom $XDG_CONFIG_HOME/nvim/lua/custom # zsh modules mkdir -p $XDG_DATA_HOME/repos/zsh_modules