From 972e5f9c68cc433c5fc26adf92cd25b293a3776a Mon Sep 17 00:00:00 2001 From: brustybee Date: Mon, 9 Mar 2026 17:02:03 +0530 Subject: One shot upload --- lua/config/colorschemes.lua | 82 ++++++++++++++++++++++++++++++++++++++++ lua/config/init.lua | 4 ++ lua/config/keys.lua | 35 +++++++++++++++++ lua/config/lsp.lua | 91 +++++++++++++++++++++++++++++++++++++++++++++ lua/config/options.lua | 51 +++++++++++++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 lua/config/colorschemes.lua create mode 100644 lua/config/init.lua create mode 100644 lua/config/keys.lua create mode 100644 lua/config/lsp.lua create mode 100644 lua/config/options.lua (limited to 'lua/config') diff --git a/lua/config/colorschemes.lua b/lua/config/colorschemes.lua new file mode 100644 index 0000000..f09ecd3 --- /dev/null +++ b/lua/config/colorschemes.lua @@ -0,0 +1,82 @@ +if nixCats("theme") then + require("vague").setup({ + transparent = true, + bold = false, + }) + + require("gruvbox-material").setup({ + italics = true, + contrast = "medium", + comments = { + italics = true, + }, + background = { + transparent = true, + }, + float = { + force_background = true, + background_color = nil, + }, + }) + + require("kanso").setup({ + compile = true, + transparent = true, + dimInactive = false, + terminalColors = true, + overrides = function(colors) + local theme = colors.theme + return { + Pmenu = { fg = theme.ui.fg, bg = theme.ui.bg_p1 }, + NormalFloat = { bg = theme.ui.bg_p1 }, + FloatTitle = { fg = theme.ui.special, bg = theme.ui.bg_p1 }, + FloatBorder = { fg = theme.ui.shade0, bg = theme.ui.bg_p1 }, + } + end, + background = { + dark = "ink", + light = "pearl", + }, + foreground = "default", + }) + + require("rose-pine").setup({ + styles = { + bold = true, + italic = true, + transparency = true, + }, + }) + + require("kanagawa").setup({ + compile = true, + undercurl = true, + commentStyle = { italic = true }, + functionStyle = {}, + keywordStyle = { italic = true }, + statementStyle = { bold = true }, + typeStyle = {}, + transparent = true, + dimInactive = false, + terminalColors = true, + colors = { + palette = {}, + theme = { + wave = {}, + lotus = {}, + dragon = {}, + all = { ui = { bg_gutter = "none" } }, + }, + }, + overrides = function(colors) + return {} + end, + theme = "dragon", + background = { + dark = "dragon", + light = "lotus", + }, + }) +end + +return {} diff --git a/lua/config/init.lua b/lua/config/init.lua new file mode 100644 index 0000000..2be1996 --- /dev/null +++ b/lua/config/init.lua @@ -0,0 +1,4 @@ +require("config.options") +require("config.colorschemes") +require("config.keys") +require("config.lsp") diff --git a/lua/config/keys.lua b/lua/config/keys.lua new file mode 100644 index 0000000..518b9c1 --- /dev/null +++ b/lua/config/keys.lua @@ -0,0 +1,35 @@ +vim.keymap.set("v", "J", ":m '>+1gv=gv", { silent = true }) +vim.keymap.set("v", "K", ":m '<-2gv=gv", { silent = true }) + +vim.keymap.set("n", "J", "mzJ`z", { silent = true }) +vim.keymap.set("n", "", "zz", { silent = true }) +vim.keymap.set("n", "", "zz", { silent = true }) +vim.keymap.set("n", "n", "nzzzv", { silent = true }) +vim.keymap.set("n", "N", "Nzzzv", { silent = true }) +vim.keymap.set({ "n", "v" }, "y", [["+y]]) +vim.keymap.set({ "n", "v" }, "d", [["_d"]]) + +vim.keymap.set("n", "q:", "") -- disable that annoying cmd history buffer thingy + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") +vim.keymap.set("n", "bn", "bn") +vim.keymap.set("n", "bp", "bp") + +vim.keymap.set("n", "u", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "px", "!chmod +x %") +vim.keymap.set("n", "", "nohlsearch") + +local function hover_cap(opts) + opts = vim.tbl_deep_extend("force", opts or {}, { + max_width = 100, + max_height = 25, + wrap = true, + }) + return vim.lsp.buf.hover(opts) +end + +vim.keymap.set("n", "K", hover_cap, { silent = true }) +-- vim.keymap.set("n", "rn", vim.lsp.buf.rename, { desc = "Rename Symbol" }) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua new file mode 100644 index 0000000..2e7cf05 --- /dev/null +++ b/lua/config/lsp.lua @@ -0,0 +1,91 @@ +vim.lsp.inlay_hint.enable(true) +vim.lsp.enable({ + "clangd", + "lua_ls", + "nixd", + "nil_ls", + "zls", + "pyrefly", + "marksman", + "harper", + "tinymist", + "gopls", + "tombi", +}) + +vim.lsp.config("nil_ls", { + settings = { + formatting = { + command = { "nixfmt" }, + }, + }, +}) + +vim.lsp.config("lua_ls", { + settings = { + Lua = { + codeLens = { enable = true }, + hint = { + enable = true, + semicolon = "Disable", + }, + workspace = { + checkThirdParty = false, + -- IMPORTANT: Leave library empty here. + -- lazydev will inject the correct Nix store paths dynamically. + library = {}, + }, + runtime = { + version = "LuaJIT", + -- Setting this to false allows lazydev to find files + -- outside your immediate workspace (like Nix store plugins) + pathStrict = false, + }, + }, + }, +}) + +vim.lsp.config("*", { + capabilities = { textDocument = { semanticTokens = { multilineTokenSupport = true } } }, + root_markers = { ".git", ".editorconfig", "flake.nix", "shell.nix" }, +}) + +vim.diagnostic.config({ + severity_sort = true, + severity_sort_priority = { + Error = 100, + Warn = 90, + Hint = 50, + Info = 10, + }, +}) + +local RustLsp = function(mode, keymap, action, bufnr) + vim.keymap.set(mode, keymap, function() + vim.cmd.RustLsp(action) + end, { silent = true, buffer = bufnr }) +end + +vim.g.rustaceanvim = { + tools = {}, + server = { + on_attach = function(client, bufnr) + RustLsp({ "n", "x" }, "gra", "codeAction", bufnr) + RustLsp("n", "ee", "explainError", bufnr) + RustLsp("n", "K", { "hover", "actions" }, bufnr) + RustLsp("n", "L", { "hover", "range" }, bufnr) + end, + default_settings = { + ["rust-analyzer"] = { + checkOnSave = { + enable = false, + command = "clippy", + }, + procMacro = { + enable = true, + }, + }, + }, + }, + dap = {}, +} diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..c50b859 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,51 @@ +vim.loader.enable() +vim.g.mapleader = " " +vim.g.maplocalleader = " " +vim.o.updatetime = 1500 + +vim.opt.inccommand = "split" + +vim.opt.undofile = false +vim.opt.undodir = vim.fn.expand("~/.local/share/nvim/undo") + +vim.o.termguicolors = true +-- vim.opt.guicursor = "n-v-c-sm:block,ci-ve:ver25,r-cr-o:hor20" +vim.o.showmode = true +vim.o.showcmd = false +vim.o.signcolumn = "yes" +vim.o.cursorline = true +vim.o.cursorlineopt = "number" -- Restricts the highlight ONLY to the number column +vim.o.background = "dark" +vim.o.conceallevel = 2 +vim.o.autoread = true + +vim.o.nu = true +vim.o.relativenumber = true + +vim.o.mouse = "" +vim.o.scrolloff = 21 +vim.g.loaded_netrwPlugin = 1 +vim.g.loaded_netrw = 1 + +vim.o.expandtab = true +vim.o.tabstop = 4 +vim.o.softtabstop = 4 +vim.o.shiftwidth = 4 +vim.o.smartindent = false +vim.o.smarttab = true +vim.o.breakindent = true +vim.o.autoindent = true + +vim.o.wrap = false +vim.o.linebreak = false + +vim.o.hlsearch = true +vim.o.incsearch = true + +vim.o.title = true +vim.o.swapfile = false + +vim.opt.foldlevel = 99 +vim.opt.foldlevelstart = 99 +vim.opt.foldenable = true +vim.o.foldmethod = "expr" -- cgit v1.3.1