From 2cc42213f120ffe6a2f06f610bccc31f0c68c2e7 Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Sun, 7 Sep 2025 18:03:20 +0530 Subject: removed nvim submodule --- nvim/lua/autocmds.lua | 1 + nvim/lua/chadrc.lua | 24 +++++++++++++++ nvim/lua/configs/conform.lua | 15 ++++++++++ nvim/lua/configs/lazy.lua | 47 +++++++++++++++++++++++++++++ nvim/lua/configs/lspconfig.lua | 67 ++++++++++++++++++++++++++++++++++++++++++ nvim/lua/mappings.lua | 8 +++++ nvim/lua/options.lua | 9 ++++++ nvim/lua/plugins/init.lua | 50 +++++++++++++++++++++++++++++++ 8 files changed, 221 insertions(+) create mode 100644 nvim/lua/autocmds.lua create mode 100644 nvim/lua/chadrc.lua create mode 100644 nvim/lua/configs/conform.lua create mode 100644 nvim/lua/configs/lazy.lua create mode 100644 nvim/lua/configs/lspconfig.lua create mode 100644 nvim/lua/mappings.lua create mode 100644 nvim/lua/options.lua create mode 100644 nvim/lua/plugins/init.lua (limited to 'nvim/lua') diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua new file mode 100644 index 0000000..d2db0bb --- /dev/null +++ b/nvim/lua/autocmds.lua @@ -0,0 +1 @@ +require "nvchad.autocmds" diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua new file mode 100644 index 0000000..9f9eecc --- /dev/null +++ b/nvim/lua/chadrc.lua @@ -0,0 +1,24 @@ +-- This file needs to have same structure as nvconfig.lua +-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua +-- Please read that file to know all available options :( + +---@type ChadrcConfig +local M = {} + +M.base46 = { + theme = "catppuccin", + + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, +} + +-- M.nvdash = { load_on_startup = true } +-- M.ui = { +-- tabufline = { +-- lazyload = false +-- } +--} + +return M diff --git a/nvim/lua/configs/conform.lua b/nvim/lua/configs/conform.lua new file mode 100644 index 0000000..35ba6cf --- /dev/null +++ b/nvim/lua/configs/conform.lua @@ -0,0 +1,15 @@ +local options = { + 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, + -- }, +} + +return options diff --git a/nvim/lua/configs/lazy.lua b/nvim/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/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/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua new file mode 100644 index 0000000..cc741bd --- /dev/null +++ b/nvim/lua/configs/lspconfig.lua @@ -0,0 +1,67 @@ +require("nvchad.configs.lspconfig").defaults() + +local servers = { "html", "cssls", "rust_analyzer", "zls" } +vim.lsp.enable(servers) + +local lspconfig = require("lspconfig") + +-- Rust +lspconfig.rust_analyzer.setup{} + +-- Zig +lspconfig.zls.setup{ + cmd = { "zls" }, + filetypes = { "zig", "zir" }, + root_dir = lspconfig.util.root_pattern("build.zig", "zls.json", ".git") +} + +-- TS/JS +lspconfig.ts_ls.setup { + cmd = { "typescript-language-server", "--stdio" }, + filetypes = { + "javascript", "javascriptreact", + "typescript", "typescriptreact", + "javascript.jsx", "typescript.tsx" + }, + root_dir = lspconfig.util.root_pattern("package.json", "tsconfig.json", ".git") +} + +-- Python +lspconfig.pylsp.setup { + cmd = { "pylsp" }, + filetypes = { "python" }, + settings = { + pylsp = { + plugins = { + black = { enabled = true }, + ruff = { enabled = true }, + flake8 = { enabled = true }, + isort = { enabled = true } + } + } + } +} + +-- Elixir +lspconfig.elixirls.setup { + cmd = { "elixir-ls" }, + filetypes = { "elixir" }, +} + +-- Erlang +lspconfig.erlangls.setup { + cmd = { "erlang-ls" }, + filetypes = { "erlang" }, +} + +-- C/C++ +lspconfig.clangd.setup { + cmd = { "clangd" }, + filetypes = { "c", "cpp" } +} + +-- Gopls +lspconfig.gopls.setup { + cmd = { "gopls" }, + filetype = { "go" } +} diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua new file mode 100644 index 0000000..79e634e --- /dev/null +++ b/nvim/lua/mappings.lua @@ -0,0 +1,8 @@ +require "nvchad.mappings" + +local map = vim.keymap.set +local unmap = vim.keymap.del + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map({ "n", "i", "v" }, "", " w ") +map({ "n", "v" }, "", ":%s/") diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua new file mode 100644 index 0000000..c5af716 --- /dev/null +++ b/nvim/lua/options.lua @@ -0,0 +1,9 @@ +require "nvchad.options" + +-- add yours here! +vim.opt.wrap = false +vim.opt.spell = true +vim.opt.spelllang = { "en" } + +-- local o = vim.o +-- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..c9b7ea8 --- /dev/null +++ b/nvim/lua/plugins/init.lua @@ -0,0 +1,50 @@ +return { + { + "stevearc/conform.nvim", + -- event = 'BufWritePre', -- uncomment for format on save + opts = require "configs.conform", + }, + + -- These are some examples, uncomment them if you want to see them work! + { + "neovim/nvim-lspconfig", + config = function() + require "configs.lspconfig" + end, + }, + + { + "mbbill/undotree", + event = "BufReadPost", + config = function() + vim.keymap.set("n", "u", vim.cmd.UndotreeToggle, { desc = "Toggle UndoTree" }) + end, + }, + + -- test new blink + -- { import = "nvchad.blink.lazyspec" }, + + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "vim", "lua", "vimdoc", + "html", "css", "elixir", "rust" + }, + }, + }, + + { + "christoomey/vim-tmux-navigator", + lazy = false, + }, + + { + "nvim-tree/nvim-tree.lua", + opts = { + view = { + side = "right" + } + } + }, +} -- cgit v1.2.3