diff options
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/init.lua | 39 | ||||
-rw-r--r-- | .config/nvim/lazy-lock.json | 29 | ||||
-rw-r--r-- | .config/nvim/lua/chadrc.lua | 12 | ||||
-rw-r--r-- | .config/nvim/lua/configs/conform.lua | 17 | ||||
-rw-r--r-- | .config/nvim/lua/configs/lazy.lua | 47 | ||||
-rw-r--r-- | .config/nvim/lua/configs/lspconfig.lua | 14 | ||||
-rw-r--r-- | .config/nvim/lua/configs/vimtex.lua | 5 | ||||
-rw-r--r-- | .config/nvim/lua/mappings.lua | 1 | ||||
-rw-r--r-- | .config/nvim/lua/options.lua | 1 | ||||
-rw-r--r-- | .config/nvim/lua/plugins/init.lua | 55 |
10 files changed, 220 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 00000000..1152335b --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,39 @@ +vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" +vim.g.mapleader = " " + +-- bootstrap lazy and all plugins +local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" + +if not vim.loop.fs_stat(lazypath) then + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } +end + +vim.opt.rtp:prepend(lazypath) + +local lazy_config = require "configs.lazy" + +-- load plugins +require("lazy").setup({ + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + config = function() + require "options" + end, + }, + + { import = "plugins" }, +}, lazy_config) + +-- load theme +dofile(vim.g.base46_cache .. "defaults") +dofile(vim.g.base46_cache .. "statusline") + +require "nvchad.autocmds" + +vim.schedule(function() + require "mappings" +end) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 00000000..3d52bc08 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,29 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, + "NvChad": { "branch": "v2.5", "commit": "156eeef8ecae812acd79d5eb58070d734a6202c6" }, + "base46": { "branch": "v2.5", "commit": "bcc9ed2e88ef55b7e9d50b2f80f6a2d4b8080b1d" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, + "friendly-snippets": { "branch": "main", "commit": "fa36367422da5a38560892e3db6d090a635d9d41" }, + "gitsigns.nvim": { "branch": "main", "commit": "bc933d24a669608968ff4791b14d2d9554813a65" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, + "nvim-tree.lua": { "branch": "master", "commit": "64f61e4c913047a045ff90bd188dd3b54ee443cf" }, + "nvim-treesitter": { "branch": "master", "commit": "4e21361e15b1d4147830c5fe571556eb1b14e6f9" }, + "nvim-web-devicons": { "branch": "master", "commit": "475fbcfcb6ee7c35aa33a6b6207ebd4032791d87" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" }, + "ui": { "branch": "v2.5", "commit": "9c16efc915346c7bde5288ad94f0ea40a7267d31" }, + "vimtex": { "branch": "master", "commit": "137f5bded9ce554018c47f4c9c59cddb8ac9a455" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +}
\ No newline at end of file diff --git a/.config/nvim/lua/chadrc.lua b/.config/nvim/lua/chadrc.lua new file mode 100644 index 00000000..d4551929 --- /dev/null +++ b/.config/nvim/lua/chadrc.lua @@ -0,0 +1,12 @@ +---@type ChadrcConfig +local M = {} + +M.ui = { + theme = "onenord", + theme_toggle = { "onenord", "onenord_light" }, + statusline = { theme = "vscode_colored" }, + tabufline = { lazyload = true }, + nvdash = { load_on_startup = true }, +} + +return M diff --git a/.config/nvim/lua/configs/conform.lua b/.config/nvim/lua/configs/conform.lua new file mode 100644 index 00000000..838a8dad --- /dev/null +++ b/.config/nvim/lua/configs/conform.lua @@ -0,0 +1,17 @@ +local options = { + formatters_by_ft = { + python = { "black" }, + rust = { "rustfmt" }, + lua = { "stylua" }, + cpp = { "clang-format" }, + c = { "clang-format" }, + css = { "prettier" }, + html = { "prettier" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, +} + +require("conform").setup(options) diff --git a/.config/nvim/lua/configs/lazy.lua b/.config/nvim/lua/configs/lazy.lua new file mode 100644 index 00000000..cd170bd3 --- /dev/null +++ b/.config/nvim/lua/configs/lazy.lua @@ -0,0 +1,47 @@ +return { + defaults = { lazy = true }, + install = { colorscheme = { "nvchad" } }, + + ui = { + icons = { + ft = "", + lazy = " ", + loaded = "", + not_loaded = "", + }, + }, + + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "tohtml", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", + }, + }, + }, +} diff --git a/.config/nvim/lua/configs/lspconfig.lua b/.config/nvim/lua/configs/lspconfig.lua new file mode 100644 index 00000000..eaf7856f --- /dev/null +++ b/.config/nvim/lua/configs/lspconfig.lua @@ -0,0 +1,14 @@ +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 = { "pylsp", "clangd", "cssls", "rust_analyzer", "marksman", "bash-language-server" } + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup({ + on_attach = on_attach, + on_init = on_init, + capabilities = capabilities, + }) +end diff --git a/.config/nvim/lua/configs/vimtex.lua b/.config/nvim/lua/configs/vimtex.lua new file mode 100644 index 00000000..c25558d5 --- /dev/null +++ b/.config/nvim/lua/configs/vimtex.lua @@ -0,0 +1,5 @@ +vim.g.tex_flavor='latex' +vim.g.vimtex_view_method='zathura' +vim.g.vimtex_quickfix_mode=0 +vim.opt.conceallevel = 1 +vim.g.tex_conceal='abdmg' diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua new file mode 100644 index 00000000..043f8043 --- /dev/null +++ b/.config/nvim/lua/mappings.lua @@ -0,0 +1 @@ +require("nvchad.mappings") diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua new file mode 100644 index 00000000..292dee1a --- /dev/null +++ b/.config/nvim/lua/options.lua @@ -0,0 +1 @@ +require "nvchad.options" diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 00000000..babc8ae8 --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,55 @@ +return { + { + "stevearc/conform.nvim", + event = "BufWritePre", + config = function() + require("configs.conform") + end, + }, + { + "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", + "bash-language-server", + "marksman", + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "vim", + "lua", + "vimdoc", + "html", + "css", + "python", + "rust", + "cpp", + "c", + "bash", + "html", + "markdown", + }, + }, + }, + { + "lervag/vimtex", + config = function() + require("configs.vimtex") + end, + }, +} |