diff options
Diffstat (limited to '.config/nvim/lua')
-rw-r--r-- | .config/nvim/lua/chadrc.lua | 18 | ||||
-rw-r--r-- | .config/nvim/lua/configs/conform.lua | 15 | ||||
-rw-r--r-- | .config/nvim/lua/configs/lazy.lua | 47 | ||||
-rw-r--r-- | .config/nvim/lua/configs/lspconfig.lua | 67 | ||||
-rw-r--r-- | .config/nvim/lua/mappings.lua | 10 | ||||
-rw-r--r-- | .config/nvim/lua/options.lua | 6 | ||||
-rw-r--r-- | .config/nvim/lua/plugins/init.lua | 80 |
7 files changed, 243 insertions, 0 deletions
diff --git a/.config/nvim/lua/chadrc.lua b/.config/nvim/lua/chadrc.lua new file mode 100644 index 0000000..01cbda4 --- /dev/null +++ b/.config/nvim/lua/chadrc.lua @@ -0,0 +1,18 @@ +-- This file needs to have same structure as nvconfig.lua +-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua +-- Please read that file to know all available options :( + +---@type ChadrcConfig +local M = {} + +M.base46 = { + theme = "chadwal", + transparency = false, + + hl_override = { + Comment = { italic = true }, + ["@comment"] = { italic = true }, + }, +} + +return M diff --git a/.config/nvim/lua/configs/conform.lua b/.config/nvim/lua/configs/conform.lua new file mode 100644 index 0000000..35ba6cf --- /dev/null +++ b/.config/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/.config/nvim/lua/configs/lazy.lua b/.config/nvim/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /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 0000000..34c2fb5 --- /dev/null +++ b/.config/nvim/lua/configs/lspconfig.lua @@ -0,0 +1,67 @@ +-- load defaults i.e lua_lsp +require("nvchad.configs.lspconfig").defaults() + +local lspconfig = require "lspconfig" + +-- EXAMPLE +local servers = { "html", "cssls" } +local nvlsp = require "nvchad.configs.lspconfig" +local spell_words = {} + +-- lsps with default config +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = nvlsp.on_attach, + on_init = nvlsp.on_init, + capabilities = nvlsp.capabilities, + } +end + +lspconfig.ltex.setup({ + settings = { + ltex = { + language = "en-US", + enabled = true, + dictionary = { + ["en-US"] = spell_words, + }, + }, + }, +}) + +lspconfig.eslint.setup({ + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + command = "EslintFixAll", + }) + end, +}) + +lspconfig.rust_analyzer.setup { + -- server-specific settings. See ':help lspconfig-setup' + settings = { + ['rust_analyzer'] = {}, + }, +} + +lspconfig.basedpyright.setup { + cmd = { "basedpyright-langserver", "--stdio" }, + filetypes = { "python" }, + settings = { + basedpright = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "openFilesOnly", + uuseLibraryCodeForTypes = true + }, + }, + }, +} + +-- configuring single server, example: typescript +-- lspconfig.tsserver.setup { +-- on_attach = nvlsp.on_attach, +-- on_init = nvlsp.on_init, +-- capabilities = nvlsp.capabilities, +-- } diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua new file mode 100644 index 0000000..783b78f --- /dev/null +++ b/.config/nvim/lua/mappings.lua @@ -0,0 +1,10 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "<ESC>") + +-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>") diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua new file mode 100644 index 0000000..738f20b --- /dev/null +++ b/.config/nvim/lua/options.lua @@ -0,0 +1,6 @@ +require "nvchad.options" + +-- add yours here! + +-- local o = vim.o +-- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..751f159 --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,80 @@ +return { + { + "stevearc/conform.nvim", + -- event = 'BufWritePre', -- uncomment for format on save + opts = require "configs.conform", + }, + + { + "github/copilot.vim", + lazy = false, + }, + + -- These are some examples, uncomment them if you want to see them work! + { + "neovim/nvim-lspconfig", + config = function() + require "configs.lspconfig" + end, + }, + + { + "Pocco81/auto-save.nvim", + lazy = false, + config = function () + require("auto-save").setup { + -- your config goes here + -- or just leave it empty + enabled = true, + execution_message = { + message = function () + return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) + end, + dim = 0.18, + cleaning_interval = 1250, + }, + trigger_events = {"InsertLeave", "TextChanged"}, + + condition = function (buf) + local fn = vim.fn + local utils = require("auto-save.utils.data") + + if + fn.getbufvar(buf, "&modifiable") == 1 and + utils.not_in(fn.getbufvar(buf, "&filetype"), {}) then + return true -- met conditions, can save + end + return false + + end, + write_all_buffers = false, + debounce_delay = 135, + callbacks = { + enabling = nil, + disabling = nil, + before_asserting_save = nil, + before_saving = nil, + } + } + end, + }, + + { + "andweeb/presence.nvim", + opts = { + ensure_installed = { + "vim", "lua", "vimdoc" + }, + }, + }, + + -- { + -- "nvim-treesitter/nvim-treesitter", + -- opts = { + -- ensure_installed = { + -- "vim", "lua", "vimdoc", + -- "html", "css" + -- }, + -- }, + -- }, +} |