From 71e2312e3eaab68551303cc935bbc02b2d8c41f4 Mon Sep 17 00:00:00 2001 From: Vishnu-yes Date: Sun, 21 Sep 2025 08:42:06 +0530 Subject: [PATCH 1/3] Extremely_Modified_init.lua --- Extremely_Modified_init.lua | 725 ++++++++++++++++++++++++++++++++++++ 1 file changed, 725 insertions(+) create mode 100644 Extremely_Modified_init.lua diff --git a/Extremely_Modified_init.lua b/Extremely_Modified_init.lua new file mode 100644 index 0000000..8a578cb --- /dev/null +++ b/Extremely_Modified_init.lua @@ -0,0 +1,725 @@ +-- ============================== +-- NEOVIM CONFIGURATION INIT.LUA +-- ============================== +-- Table of Contents: +-- 1. Leader Keys Setup +-- 2. Environment Configuration +-- 3. Plugin Manager Bootstrap +-- 4. Basic Editor Settings +-- 5. Plugin Configurations +-- - Themes (Gruvbox, GitHub) +-- - Editor Enhancement (Autopairs, Completion) +-- - LSP Enhancement (LSPSaga) +-- - Syntax Highlighting (Treesitter) +-- - Terminal Integration (Toggleterm) +-- - File Navigation (Telescope) +-- - Language Support (Snippets) +-- 6. LSP Server Configurations +-- 7. UI & Diagnostics Customization +-- 8. Filetype Specific Settings +-- ============================== + +-- ============================== +-- 1. LEADER KEYS (Set Early) +-- ============================== +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- ============================== +-- 2. ENVIRONMENT PATHS +-- ============================== +vim.env.PATH = table.concat({ + "/data/data/com.termux/files/usr/bin", + vim.env.HOME .. "/.cargo/bin", + vim.env.HOME .. "/.npm-global/bin", + vim.env.PATH +}, ":") + +-- ============================== +-- 3. BOOTSTRAP LAZY.NVIM PLUGIN MANAGER +-- ============================== +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- ============================== +-- 4. BASIC EDITOR SETTINGS +-- ============================== +vim.o.number = false +vim.o.relativenumber = false +vim.o.cursorline = false +vim.o.termguicolors = true +print("Neovim Lua config loaded!") + +-- ============================== +-- 5. PLUGIN SETUP & CONFIGURATIONS +-- ============================== +require("lazy").setup({ + + -- ============================== + -- 5.1 THEME: GRUVBOX + -- ============================== + { + "ellisonleao/gruvbox.nvim", + priority = 1000, + config = function() + require("gruvbox").setup({ + terminal_colors = true, + contrast = "hard", + }) + end, + }, + + -- ============================== + -- 5.2 THEME: GITHUB + -- ============================== + { + "projekt0n/github-nvim-theme", + name = "github-theme", + priority = 999, + config = function() + local current_theme = "gruvbox_dark_hard" + + -- Theme switching functions + local function set_gruvbox_theme(style) + require("gruvbox").setup({ contrast = "hard" }) + vim.o.background = style + vim.cmd("colorscheme gruvbox") + end + + local function set_github_theme(style) + require("github-theme").setup({ + options = { transparent = false }, + styles = { comments = "NONE", keywords = "NONE", functions = "NONE", variables = "NONE" }, + }) + vim.cmd("colorscheme github_" .. style) + end + + -- Global theme switching functions + _G.t1 = function() current_theme = "gruvbox_dark_hard"; set_gruvbox_theme("dark"); print("Theme: Gruvbox Dark Hard") end + _G.t2 = function() current_theme = "gruvbox_light_hard"; set_gruvbox_theme("light"); print("Theme: Gruvbox Light Hard") end + _G.t3 = function() current_theme = "github_dark"; set_github_theme("dark_default"); print("Theme: GitHub Dark") end + _G.t4 = function() current_theme = "github_light"; set_github_theme("light_default"); print("Theme: GitHub Light") end + + -- Initialize theme + if current_theme == "gruvbox_dark_hard" then _G.t1() + elseif current_theme == "gruvbox_light_hard" then _G.t2() + elseif current_theme == "github_dark" then _G.t3() + elseif current_theme == "github_light" then _G.t4() end + + -- Theme switching keybindings + vim.keymap.set("n", "gt", _G.t3, { noremap = true, silent = true, desc = "GitHub Dark Theme" }) + vim.keymap.set("n", "gl", _G.t4, { noremap = true, silent = true, desc = "GitHub Light Theme" }) + end, + }, + + -- ============================== + -- 5.3 EDITOR ENHANCEMENT: AUTO PAIRS + -- ============================== + { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup({}) + end, + }, + + -- ============================== + -- 5.4 COMPLETION ENGINE: NVIM-CMP + -- ============================== + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + + cmp.setup({ + snippet = { expand = function(args) luasnip.lsp_expand(args.body) end }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" } + }), + }) + + -- Integration with autopairs + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + + -- ============================== + -- 5.5 LSP CONFIGURATION: NVIM-LSPCONFIG + -- ============================== + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + }, + }, + + -- ============================== + -- 5.6 LSP ENHANCEMENT: LSPSAGA + -- ============================== + { + "nvimdev/lspsaga.nvim", + event = "LspAttach", + dependencies = { + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("lspsaga").setup({ + -- UI Configuration + ui = { + border = "rounded", + devicon = true, + title = true, + expand = "⊞", + collapse = "⊟", + code_action = "💡", + actionfix = " ", + lines = { "┗", "┣", "┃", "━", "┏" }, + kind = {}, + imp_sign = "󰳛 ", + }, + + -- Hover Configuration + hover = { + max_width = 0.9, + max_height = 0.8, + open_link = "gx", + open_cmd = "!chrome", + }, + + -- Diagnostic Configuration + diagnostic = { + show_code_action = true, + show_layout = "float", + show_normal_height = 10, + jump_num_shortcut = true, + max_width = 0.8, + max_height = 0.6, + max_show_width = 0.9, + max_show_height = 0.6, + text_hl_follow = true, + border_follow = true, + extend_relatedInformation = false, + diagnostic_only_current = false, + keys = { + exec_action = "o", + quit = "q", + toggle_or_jump = "", + quit_in_show = { "q", "" }, + }, + }, + + -- Code Action Configuration + code_action = { + num_shortcut = true, + show_server_name = false, + extend_gitsigns = true, + only_in_cursor = true, + max_height = 0.3, + keys = { + quit = "q", + exec = "", + }, + }, + + -- Lightbulb Configuration + lightbulb = { + enable = true, + enable_in_insert = true, + sign = true, + sign_priority = 40, + virtual_text = true, + }, + + -- Preview Configuration + preview = { + lines_above = 0, + lines_below = 10, + }, + + -- Scroll Preview Configuration + scroll_preview = { + scroll_down = "", + scroll_up = "", + }, + + -- Request Timeout + request_timeout = 2000, + + -- Finder Configuration + finder = { + max_height = 0.5, + left_width = 0.4, + methods = {}, + default = "ref+imp", + layout = "float", + silent = false, + filter = {}, + fname_sub = nil, + sp_inexist = false, + sp_global = false, + ly_botright = false, + keys = { + jump_to = "p", + edit = { "o", "" }, + vsplit = "s", + split = "i", + tabe = "t", + tabnew = "r", + quit = { "q", "" }, + close_in_preview = "", + }, + }, + + -- Definition Configuration + definition = { + edit = "o", + vsplit = "v", + split = "i", + tabe = "t", + quit = "q", + close = "", + }, + + -- Rename Configuration + rename = { + quit = "", + exec = "", + mark = "x", + confirm = "", + in_select = true, + whole_project = true, + }, + + -- Outline Configuration + outline = { + win_position = "right", + win_with = "", + win_width = 30, + preview_width = 0.4, + show_detail = true, + auto_preview = true, + auto_refresh = true, + auto_close = true, + auto_resize = false, + max_height = 0.5, + left_width = 0.3, + keys = { + jump = "o", + expand_collapse = "u", + quit = "q", + }, + }, + + -- Callhierarchy Configuration + callhierarchy = { + show_detail = false, + keys = { + edit = "e", + vsplit = "s", + split = "i", + tabe = "t", + jump = "o", + quit = "q", + expand_collapse = "u", + }, + }, + + -- Symbol in Winbar + symbol_in_winbar = { + enable = false, + separator = " ", + hide_keyword = true, + show_file = true, + folder_level = 2, + respect_root = false, + color_mode = true, + }, + + -- Beacon Configuration + beacon = { + enable = true, + frequency = 7, + }, + }) + + -- LSPSaga Keybindings (Global) + vim.keymap.set("n", "lf", "Lspsaga finder", { desc = "LSP Finder" }) + vim.keymap.set("n", "lo", "Lspsaga outline", { desc = "LSP Outline" }) + vim.keymap.set("n", "lci", "Lspsaga incoming_calls", { desc = "LSP Incoming Calls" }) + vim.keymap.set("n", "lco", "Lspsaga outgoing_calls", { desc = "LSP Outgoing Calls" }) + end, + }, + + -- ============================== + -- 5.7 SYNTAX HIGHLIGHTING: TREESITTER + -- ============================== + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "asm", "c", "lua", "python", "javascript", "typescript", "html", "css" }, + sync_install = false, + auto_install = false, + highlight = { + enable = true, + additional_vim_regex_highlighting = false + }, + indent = { enable = true }, + }) + end, + }, + + -- ============================== + -- 5.8 TERMINAL INTEGRATION: TOGGLETERM + -- ============================== + { + "akinsho/toggleterm.nvim", + version = "*", + config = function() + require("toggleterm").setup({ + size = 20, + open_mapping = [[]], + shading_factor = 2, + direction = "horizontal", + float_opts = { + border = "curved", + winblend = 0, + highlights = { + border = "Normal", + background = "Normal", + }, + }, + }) + end, + }, + + -- ============================== + -- 5.9 FILE NAVIGATION: TELESCOPE + -- ============================== + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-telescope/telescope-file-browser.nvim", + "nvim-tree/nvim-web-devicons", + }, + config = function() + local telescope = require("telescope") + local builtin = require("telescope.builtin") + + telescope.setup({ + defaults = { + prompt_prefix = "🔍 ", + selection_caret = " ", + layout_config = { + horizontal = { width = 0.9 }, + vertical = { preview_height = 0.4 } + }, + file_ignore_patterns = { "node_modules", ".git/" }, + }, + pickers = { + find_files = { hidden = true } + }, + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case" + } + }, + }) + + -- Load extensions + telescope.load_extension("fzf") + telescope.load_extension("file_browser") + + -- Telescope keybindings + vim.keymap.set("n", "ff", builtin.find_files, { desc = "Find Files" }) + vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Live Grep" }) + vim.keymap.set("n", "fb", builtin.buffers, { desc = "Buffers" }) + vim.keymap.set("n", "fh", builtin.help_tags, { desc = "Help Tags" }) + vim.keymap.set("n", "fs", builtin.lsp_document_symbols, { desc = "LSP Symbols" }) + vim.keymap.set("n", "fo", builtin.oldfiles, { desc = "Recent Files" }) + vim.keymap.set("n", "fe", telescope.extensions.file_browser.file_browser, { desc = "File Browser" }) + end, + }, + + -- ============================== + -- 5.10 LANGUAGE SUPPORT: SNIPPETS + -- ============================== + { + "honza/vim-snippets", + lazy = false, + ft = { "asm", "nasm", "x86asm", "c", "cpp", "python", "lua" }, + }, + +}) + +-- ============================== +-- 6. LSP SERVER CONFIGURATIONS +-- ============================== + +-- Get LSP configuration and capabilities +local lspconfig = require("lspconfig") +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +-- Enhanced LSP attach function with LSPSaga integration +local on_attach = function(client, bufnr) + local opts = { noremap = true, silent = true, buffer = bufnr } + local keymap = vim.keymap.set + + -- LSP Navigation (Enhanced with LSPSaga) + keymap("n", "gd", "Lspsaga peek_definition", vim.tbl_extend("force", opts, { desc = "Peek Definition" })) + keymap("n", "gD", "lua vim.lsp.buf.declaration()", vim.tbl_extend("force", opts, { desc = "Go to Declaration" })) + keymap("n", "gi", "Lspsaga finder imp", vim.tbl_extend("force", opts, { desc = "Find Implementations" })) + keymap("n", "gr", "Lspsaga finder ref", vim.tbl_extend("force", opts, { desc = "Find References" })) + + -- LSP Information & Documentation + keymap("n", "K", "Lspsaga hover_doc", vim.tbl_extend("force", opts, { desc = "Hover Documentation" })) + keymap("n", "", "Lspsaga hover_doc ++keep", vim.tbl_extend("force", opts, { desc = "Pin Hover Documentation" })) + + -- LSP Code Actions & Refactoring + keymap("n", "rn", "Lspsaga rename", vim.tbl_extend("force", opts, { desc = "LSP Rename" })) + keymap("n", "ca", "Lspsaga code_action", vim.tbl_extend("force", opts, { desc = "Code Action" })) + keymap("v", "ca", "Lspsaga code_action", vim.tbl_extend("force", opts, { desc = "Code Action" })) + + -- LSP Diagnostics Navigation + keymap("n", "[d", "Lspsaga diagnostic_jump_prev", vim.tbl_extend("force", opts, { desc = "Previous Diagnostic" })) + keymap("n", "]d", "Lspsaga diagnostic_jump_next", vim.tbl_extend("force", opts, { desc = "Next Diagnostic" })) + keymap("n", "[e", function() + require("lspsaga.diagnostic"):goto_prev({ severity = vim.diagnostic.severity.ERROR }) + end, vim.tbl_extend("force", opts, { desc = "Previous Error" })) + keymap("n", "]e", function() + require("lspsaga.diagnostic"):goto_next({ severity = vim.diagnostic.severity.ERROR }) + end, vim.tbl_extend("force", opts, { desc = "Next Error" })) + + -- LSP Diagnostics Display + keymap("n", "sl", "Lspsaga show_line_diagnostics", vim.tbl_extend("force", opts, { desc = "Line Diagnostics" })) + keymap("n", "sc", "Lspsaga show_cursor_diagnostics", vim.tbl_extend("force", opts, { desc = "Cursor Diagnostics" })) + keymap("n", "sb", "Lspsaga show_buf_diagnostics", vim.tbl_extend("force", opts, { desc = "Buffer Diagnostics" })) + + -- LSP Workspace & Outline + keymap("n", "o", "Lspsaga outline", vim.tbl_extend("force", opts, { desc = "Toggle Outline" })) + + -- Additional LSP utilities + keymap("n", "f", function() + vim.lsp.buf.format({ async = true }) + end, vim.tbl_extend("force", opts, { desc = "Format Document" })) + + -- Enable inlay hints if supported + if client.supports_method("textDocument/inlayHint") then + vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) + end +end + +-- LSP Server Configurations + +-- Python (Pyright) +lspconfig.pyright.setup({ + on_attach = on_attach, + capabilities = capabilities, + cmd = { "/data/data/com.termux/files/usr/bin/pyright-langserver", "--stdio" }, + settings = { + python = { + pythonPath = "/home/you/Python/venv/bin/python", + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = "workspace", + } + } + }, +}) + +-- TypeScript/JavaScript +lspconfig.ts_ls.setup({ + on_attach = on_attach, + capabilities = capabilities, + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, +}) + +-- CSS +lspconfig.cssls.setup({ + on_attach = on_attach, + capabilities = capabilities +}) + +-- HTML +lspconfig.html.setup({ + on_attach = on_attach, + capabilities = capabilities +}) + +-- C/C++ (Clangd) +lspconfig.clangd.setup({ + on_attach = on_attach, + capabilities = capabilities, + cmd = { "clangd", "--background-index", "--clang-tidy", "--header-insertion=iwyu" }, + root_dir = function(fname) + return lspconfig.util.root_pattern("compile_commands.json", "compile_flags.txt", ".git")(fname) + or vim.fn.getcwd() + end, +}) + +-- Lua +lspconfig.lua_ls.setup({ + on_attach = on_attach, + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + globals = { "vim" } + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false + }, + telemetry = { enable = false }, + hint = { enable = true }, + }, + }, +}) + +-- ============================== +-- 7. UI & DIAGNOSTICS CUSTOMIZATION +-- ============================== + +-- Diagnostic configuration +vim.diagnostic.config({ + virtual_text = { + enabled = true, + source = "if_many", + prefix = "●", + }, + signs = true, + underline = true, + update_in_insert = false, + severity_sort = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, +}) + +-- Diagnostic signs +local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) +end + +-- Custom diagnostic highlights +vim.cmd("highlight DiagnosticError guifg=#fb4934 gui=bold") +vim.cmd("highlight DiagnosticWarn guifg=#fabd2f gui=bold") +vim.cmd("highlight DiagnosticInfo guifg=#83a598 gui=italic") +vim.cmd("highlight DiagnosticHint guifg=#b8bb26 gui=italic") + +-- ============================== +-- 8. FILETYPE SPECIFIC SETTINGS +-- ============================== + +-- Assembly file type detection +vim.filetype.add({ + extension = { + s = "gas", + asm = "nasm", + nasm = "nasm", + x86 = "nasm", + }, +}) + +-- Programming language indentation +vim.api.nvim_create_autocmd("FileType", { + pattern = { "c", "cpp", "python", "lua", "javascript", "typescript" }, + callback = function() + vim.bo.shiftwidth = 4 + vim.bo.tabstop = 4 + vim.bo.expandtab = true + end, +}) + +-- Markdown specific settings +vim.api.nvim_create_autocmd("FileType", { + pattern = "markdown", + callback = function() + vim.opt_local.textwidth = 80 + vim.opt_local.wrap = true + vim.opt_local.linebreak = true + vim.opt_local.colorcolumn = "81" + vim.opt_local.spell = true + vim.opt_local.conceallevel = 2 + end, +}) + +-- Assembly specific settings +vim.api.nvim_create_autocmd("FileType", { + pattern = { "asm", "nasm", "gas" }, + callback = function() + vim.bo.shiftwidth = 8 + vim.bo.tabstop = 8 + vim.bo.expandtab = false + vim.opt_local.commentstring = "; %s" + end, +}) + +-- ============================== +-- CONFIGURATION COMPLETE +-- ============================== +-- Your enhanced Neovim configuration is now loaded! +-- Key improvements: +-- - Modern LSPSaga configuration with comprehensive settings +-- - Enhanced keybindings with descriptions +-- - Better organized sections with clear navigation +-- - Additional LSP features like inlay hints +-- - Improved diagnostic display and navigation +-- - Extended language support and filetype settings +-- ============================== From f354d2caa06c25202cec5b8a037c144f1265bbcd Mon Sep 17 00:00:00 2001 From: Vishnu-yes Date: Sun, 21 Sep 2025 20:15:52 +0530 Subject: [PATCH 2/3] LunarVim(LspSaga & MasterTheme).lua Addon for Good to Go Lunarvim. Jay Jagannath --- LunarVim(LspSaga & MasterTheme).lua | 163 ++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 LunarVim(LspSaga & MasterTheme).lua diff --git a/LunarVim(LspSaga & MasterTheme).lua b/LunarVim(LspSaga & MasterTheme).lua new file mode 100644 index 0000000..eb4ea58 --- /dev/null +++ b/LunarVim(LspSaga & MasterTheme).lua @@ -0,0 +1,163 @@ +-- ============================== +-- LUNARVIM SUPREME THEME + LSPSAGA CONFIG +-- ============================== + +-- Ensure true color support +vim.opt.termguicolors = true + +-- ============================== +-- 1. SUPREME THEMES +-- ============================== + +lvim.plugins = lvim.plugins or {} + +table.insert(lvim.plugins, { + [1]"ellisonleao/gruvbox.nvim", + config = function() + require(modname: "gruvbox").setup({ + contrast = "hard", + terminal_colors = true, + overrides = { + Comment = { italic = false, bold = false }, + Function = { italic = false, bold = false }, + Identifier = { italic = false, bold = false }, + }, + }) + end, +}) + +table.insert(lvim.plugins, { + [1]"projekt0n/github-nvim-theme", + name = "github-theme", + config = function() + require(modname: "github-theme").setup(opts: { + options = { transparent = false, dark_float = true }, + styles = { + comments = "NONE", + keywords = "NONE", + functions = "NONE", + variables = "NONE", + }, + }) + end, +}) + +-- Set default supreme theme +lvim.colorscheme = "lunar" +_G.SUPREME_THEME = "lunar" + +-- Theme toggling functions +function _G.set_lunar() + vim.cmd("colorscheme lunar") + _G.SUPREME_THEME = "lunar" + print("Supreme Default: Lunar") +end +function _G.set_gruvbox() + vim.cmd("colorscheme gruvbox") + _G.SUPREME_THEME = "gruvbox" + print("Supreme Default: Gruvbox Dark Hard") +end +function _G.set_github() + vim.cmd("colorscheme github_dark") + _G.SUPREME_THEME = "github_dark" + print("Supreme Default: GitHub Dark") +end +function _G.toggle_theme() + if vim.g.colors_name == "lunar" then + if _G.SUPREME_THEME == "gruvbox" then _G.set_gruvbox() + elseif _G.SUPREME_THEME == "github_dark" then _G.set_github() end + else + _G.set_lunar() + end +end + +-- Keybindings for themes +lvim.keys.normal_mode["tt"] = ":lua toggle_theme()" +lvim.keys.normal_mode["td"] = ":lua set_lunar()" +lvim.keys.normal_mode["tg"] = ":lua set_gruvbox()" +lvim.keys.normal_mode["th"] = ":lua set_github()" + +-- ============================== +-- 2. LSPSAGA CONFIGURATION +-- ============================== + +table.insert(lvim.plugins, { + [1]"nvimdev/lspsaga.nvim", + event = "LspAttach", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require(modname: "lspsaga").setup({ + ui = { + border = "rounded", + devicon = true, + title = true, + expand = "⊞", + collapse = "⊟", + code_action = "💡", + actionfix = " ", + lines = { [1]"┗", [2]"┣", [3]"┃", [4]"━", [5]"┏" }, + imp_sign = "󰳛 ", + }, + hover = { max_width = 0.9, max_height = 0.8 }, + diagnostic = { + show_code_action = true, + jump_num_shortcut = true, + max_width = 0.8, + max_height = 0.6, + keys = { exec_action = "o", quit = "q", toggle_or_jump = "" }, + }, + code_action = { keys = { quit = "q", exec = "" } }, + lightbulb = { enable = true, sign = true, virtual_text = true }, + finder = { keys = { edit = { "o", "" }, vsplit = "s", split = "i", tabe = "t", quit = { "q", "" } } }, + }) + end, +}) + +-- Enhanced diagnostic signs +local signs = { Error = "", Warn = "", Hint = "󰠠", Info = "" } +for type, icon in pairs(t: signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(name: hl, dict: { text = icon, texthl = hl, numhl = "" }) +end + +vim.diagnostic.config(opts: { + virtual_text = { prefix = "●", source = "always" }, + signs = true, + underline = true, + update_in_insert = false, + severity_sort = true, + float = { border = "rounded", source = "always" }, +}) + +-- ============================== +-- 3. LSP ON_ATTACH OVERRIDE +-- ============================== + +local function lspsaga_on_attach(client, bufnr) + if lvim.lsp.on_attach_callback then + lvim.lsp.on_attach_callback(client: client, bufnr: bufnr) + end + local opts = { noremap = true, silent = true, buffer = bufnr } + local keymap = vim.keymap.set + + keymap(mode: "n", lhs: "gd", rhs: "Lspsaga peek_definition", opts: opts) + keymap(mode: "n", lhs: "gr", rhs: "Lspsaga finder ref", opts: opts) + keymap(mode: "n", lhs: "gi", rhs: "Lspsaga finder imp", opts: opts) + keymap(mode: "n", lhs: "K", rhs: "Lspsaga hover_doc", opts: opts) + keymap(mode: "n", lhs: "ca", rhs: "Lspsaga code_action", opts: opts) + keymap(mode: "n", lhs: "rn", rhs: "Lspsaga rename", opts: opts) + keymap(mode: "n", lhs: "[d", rhs: "Lspsaga diagnostic_jump_prev", opts: opts) + keymap(mode: "n", lhs: "]d", rhs: "Lspsaga diagnostic_jump_next", opts: opts) + keymap(mode: "n", lhs: "sl", rhs: "Lspsaga show_line_diagnostics", opts: opts) + keymap(mode: "n", lhs: "o", rhs: "Lspsaga outline", opts: opts) +end + +lvim.lsp.on_attach_callback = lspsaga_on_attach + +-- ============================== +-- CONFIGURATION COMPLETE +-- ============================== +print("🚀 LunarVim Supreme Theme + LSPSaga setup loaded successfully!") \ No newline at end of file From 13df22a648d8f6dccf9ee96df8426757fc343904 Mon Sep 17 00:00:00 2001 From: Vishnu-yes Date: Mon, 22 Sep 2025 06:47:08 +0530 Subject: [PATCH 3/3] zshrc.zsh --- .zshrc | 149 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 83 insertions(+), 66 deletions(-) diff --git a/.zshrc b/.zshrc index 1a35e49..5c3caf2 100644 --- a/.zshrc +++ b/.zshrc @@ -1,113 +1,130 @@ -# ================================================ -# ZSH CONFIG: Oh My Zsh + Autosuggestions -# ================================================ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# ====================================================== +# 🌙 Chad LunarVim Style ZSHRC (Termux Edition) +# ====================================================== + +# ------------------------------- +# Paths & Environment +# ------------------------------- +export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH" +export VIMRUNTIME="/data/data/com.termux/files/usr/share/nvim/runtime" +export LV_CONFIG_DIR="$HOME/.config/lvim-test" # ------------------------------- -# Start ssh-agent if not already running +# Theme Color Support. # ------------------------------- -if [ -z "$SSH_AUTH_SOCK" ] ; then - eval "$(ssh-agent -s)" - ssh-add ~/.ssh/id_ed25519 +export TERM="xterm-256color" +export COLORTERM="truecolor" + +# ------------------------------- +# SSH Agent Auto-Start +# ------------------------------- +if [ -z "$SSH_AUTH_SOCK" ]; then + eval "$(ssh-agent -s)" >/dev/null + ssh-add ~/.ssh/id_ed25519 >/dev/null 2>&1 fi # ------------------------------- -# Persistent command history +# History: Infinite, Shared, Clean # ------------------------------- HISTFILE=~/.zsh_history HISTSIZE=100000 SAVEHIST=100000 -# History options setopt APPEND_HISTORY setopt SHARE_HISTORY setopt INC_APPEND_HISTORY setopt EXTENDED_HISTORY setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_ALL_DUPS -setopt HIST_IGNORE_SPACE setopt HIST_SAVE_NO_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_SAVE_NO_DUPS setopt HIST_REDUCE_BLANKS setopt HIST_VERIFY setopt HIST_FIND_NO_DUPS # ------------------------------- -# Oh My Zsh setup +# Oh My Zsh # ------------------------------- export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="powerlevel10k/powerlevel10k" -# Choose a theme (default Zsh theme) -ZSH_THEME="robbyrussell" - -# Enable plugins -plugins=(git zsh-autosuggestions zsh-syntax-highlighting) +# Plugins: Git + productivity +plugins=( + git + zsh-autosuggestions + zsh-syntax-highlighting + fasd +) # Load Oh My Zsh -if [ -d "$ZSH" ]; then - source $ZSH/oh-my-zsh.sh -fi +[ -f "$ZSH/oh-my-zsh.sh" ] && source "$ZSH/oh-my-zsh.sh" # ------------------------------- -# zsh-autosuggestions +# zsh-autosuggestions & syntax-highlighting +# (if installed outside Oh My Zsh plugins) # ------------------------------- -if [ -f ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then - source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh -fi +[[ -f ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh ]] && \ + source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh -# ------------------------------- -# zsh-syntax-highlighting -# ------------------------------- -if [ -f ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then - source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -fi +[[ -f ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] && \ + source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # ------------------------------- -# Custom prompt fallback +# Fast Directory Navigation (fasd) # ------------------------------- -set_prompt() { - if [[ "$PWD" == "$HOME" ]]; then - PROMPT='%F{cyan}~%f %# ' - else - PROMPT='%F{cyan}%~%f %# ' - fi -} - -autoload -Uz add-zsh-hook -add-zsh-hook chpwd set_prompt -add-zsh-hook precmd set_prompt -set_prompt +eval "$(fasd --init auto)" # ------------------------------- -# Aliases & Extras +# Aliases: Extra Speed # ------------------------------- -alias ll='exa -lah --git' # Use exa instead of ls +alias ll='exa -lah --git' alias gs='git status' alias gp='git push' alias gd='git diff' -alias ls='eza -lh --color=auto --sort=modified' +alias ls='exa -lh --color=auto --sort=modified' +alias cl='clear' +alias vi='nvim' # ------------------------------- -export TERM=xterm-256color - -#-------------------------------- -# Keybindings -#-------------------------------- -# Move to the start of the line +# Keybindings: Vim-style Power +# ------------------------------- bindkey '^A' beginning-of-line - -# Move to the end of the line bindkey '^E' end-of-line -# Force Enter (Ctrl+M) to execute commands -bindkey '^M' accept-line #important +bindkey '^M' accept-line # Ctrl+M = Enter -# Initialize fasd -eval "$(fasd --init auto)" - -# Search and Load folder sl +# ------------------------------- +# Super Directory Finder +# ------------------------------- sl() { - dir=$(find $HOME -type d -iname "$1" 2>/dev/null | head -n 1) - if [ -n "$dir" ]; then - cd "$dir" || return - echo "→ Moved to: $dir" - else - echo "No match found for: $1" - fi + local dir + dir=$(find "$HOME" -type d -iname "$1" 2>/dev/null | head -n 1) + if [[ -n "$dir" ]]; then + cd "$dir" || return + echo "→ Moved to: $dir" + else + echo "❌ No match found for: $1" + fi } + +# ------------------------------- +# Extra Visual & Performance Tweaks +# ------------------------------- +setopt AUTO_MENU +setopt AUTO_PARAM_SLASH +setopt NO_BEEP +setopt HIST_IGNORE_ALL_DUPS + +# Better grep +export GREP_OPTIONS='--color=auto' + +echo "🚀 Chad ZSH Loaded! LunarVim Mode: ACTIVATED" + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh