├── lua ├── plugins │ ├── lazygit.lua │ ├── rename.lua │ ├── conform.lua │ ├── hardtime.lua │ ├── discord.lua │ ├── multicursors.lua │ ├── inline-diagnostics.lua │ ├── supermaven.lua │ ├── auto-session.lua │ ├── toggle-term.lua │ ├── plugins.lua │ ├── trouble.lua │ ├── nvim-treesitter.lua │ ├── git-signs.lua │ └── ts-ls.lua ├── options.lua ├── autocmds.lua ├── languages.lua ├── configs │ ├── conform.lua │ ├── lazy.lua │ └── lspconfig.lua ├── scripts │ └── prettier.lua ├── chadrc.lua └── mappings.lua ├── README.md ├── .stylua.toml ├── LICENSE ├── init.lua └── lazy-lock.json /lua/plugins/lazygit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "akinsho/toggleterm.nvim", 3 | version = "*", 4 | opts = {}, 5 | } 6 | -------------------------------------------------------------------------------- /lua/plugins/rename.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "smjonas/inc-rename.nvim", 3 | config = function() 4 | require("inc_rename").setup() 5 | end, 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This is my nvim config. 2 | 3 | I am still learning how to use nvim, it will be updated as i add new features and figure out how lua works xD 4 | -------------------------------------------------------------------------------- /lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/conform.nvim", 3 | event = "BufWritePre", 4 | opts = require "configs.conform", 5 | lazy = false, 6 | } 7 | -------------------------------------------------------------------------------- /lua/plugins/hardtime.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "m4xshen/hardtime.nvim", 3 | lazy = false, 4 | dependencies = { "MunifTanjim/nui.nvim" }, 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /lua/plugins/discord.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "andweeb/presence.nvim", 3 | lazy = false, 4 | config = function() 5 | require("presence"):setup {} 6 | end, 7 | } 8 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | call_parentheses = "None" 7 | -------------------------------------------------------------------------------- /lua/plugins/multicursors.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mg979/vim-visual-multi", 3 | branch = "master", 4 | lazy = false, 5 | init = function() 6 | vim.g.VM_maps = { 7 | ["Find Under"] = "", 8 | } 9 | end, 10 | } 11 | -------------------------------------------------------------------------------- /lua/plugins/inline-diagnostics.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rachartier/tiny-inline-diagnostic.nvim", 3 | event = "VeryLazy", -- Or `LspAttach` 4 | priority = 1000, -- needs to be loaded in first 5 | config = function() 6 | require("tiny-inline-diagnostic").setup() 7 | end, 8 | } 9 | -------------------------------------------------------------------------------- /lua/plugins/supermaven.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "supermaven-inc/supermaven-nvim", 3 | lazy = false, 4 | config = function() 5 | require("supermaven-nvim").setup { 6 | keymaps = { 7 | accept_suggestion = "", 8 | clear_suggestion = "", 9 | accept_word = "", 10 | }, 11 | } 12 | end, 13 | } 14 | -------------------------------------------------------------------------------- /lua/options.lua: -------------------------------------------------------------------------------- 1 | require "nvchad.options" 2 | 3 | local o = vim.o 4 | 5 | o.title = true 6 | o.cursorlineopt = "both" 7 | o.relativenumber = true 8 | o.virtualedit = "onemore" 9 | o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" 10 | o.foldmethod = "expr" 11 | o.foldexpr = "nvim_treesitter#foldexpr()" 12 | o.foldenable = false 13 | -------------------------------------------------------------------------------- /lua/plugins/auto-session.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rmagatti/auto-session", 3 | lazy = false, 4 | ---@module "auto-session" 5 | opts = { 6 | suppressed_dirs = { "~/Projects", "~/Downloads" }, 7 | auto_restore_last_session = vim.loop.cwd() == vim.loop.os_homedir(), 8 | }, 9 | config = function(_, opts) 10 | require("auto-session").setup(opts) 11 | end, 12 | } 13 | -------------------------------------------------------------------------------- /lua/autocmds.lua: -------------------------------------------------------------------------------- 1 | require "nvchad.autocmds" 2 | 3 | local autocmd = vim.api.nvim_create_autocmd 4 | ---------------------------------------------- TS TOOLS ---------------------------------------------- 5 | autocmd("BufWritePre", { 6 | pattern = "*.ts,*.tsx", 7 | callback = function() 8 | print "Testing Buf" 9 | vim.cmd "TSToolsOrganizeImports" 10 | vim.cmd "w" 11 | end, 12 | }) 13 | -------------------------------------------------------------------------------- /lua/plugins/toggle-term.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "akinsho/toggleterm.nvim", 3 | lazy = false, 4 | config = function() 5 | local colors = dofile(vim.g.base46_cache .. "colors") 6 | 7 | -- Setup toggleterm 8 | require("toggleterm").setup { 9 | size = 5, 10 | shade_terminals = false, 11 | highlights = { 12 | NormalFloat = { 13 | guibg = colors.black, 14 | }, 15 | }, 16 | } 17 | end, 18 | } 19 | -------------------------------------------------------------------------------- /lua/languages.lua: -------------------------------------------------------------------------------- 1 | local languages = { 2 | treesitter = { 3 | "vim", 4 | "lua", 5 | "vimdoc", 6 | "html", 7 | "css", 8 | "go", 9 | "yaml", 10 | "dockerfile", 11 | "typescript", 12 | "javascript", 13 | "tsx", 14 | "sql", 15 | "c++", 16 | }, 17 | lsp_servers = { 18 | "html", 19 | "cssls", 20 | "gopls", 21 | "sqlls", 22 | "tailwindcss", 23 | "eslint", 24 | "jsonls", 25 | "clangd", 26 | }, 27 | } 28 | 29 | return languages 30 | -------------------------------------------------------------------------------- /lua/plugins/plugins.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "charlespascoe/vim-go-syntax", 4 | ft = "go", 5 | }, 6 | { 7 | "neovim/nvim-lspconfig", 8 | dependencies = "pmizio/typescript-tools.nvim", 9 | config = function() 10 | require("nvchad.configs.lspconfig").defaults() 11 | require "configs.lspconfig" 12 | end, 13 | }, 14 | { 15 | "famiu/bufdelete.nvim", 16 | lazy = false, 17 | }, 18 | { 19 | "nvim-treesitter/nvim-treesitter-context", 20 | lazy = false, 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /lua/configs/conform.lua: -------------------------------------------------------------------------------- 1 | local options = { 2 | formatters_by_ft = { 3 | lua = { "stylua" }, 4 | css = { "prettierd" }, 5 | html = { "prettierd" }, 6 | go = { "gofumpt", "goimports" }, 7 | json = { "prettierd" }, 8 | javascript = { "prettierd" }, 9 | javascriptreact = { "prettierd" }, 10 | typescript = { "prettierd" }, 11 | typescriptreact = { "prettierd" }, 12 | markdown = { "prettierd" }, 13 | sql = { "sqlfmt" }, 14 | cpp = { "clang-format" }, 15 | }, 16 | 17 | format_on_save = { 18 | -- These options will be passed to conform.format() 19 | timeout_ms = 2500, 20 | lsp_fallback = true, 21 | }, 22 | } 23 | 24 | return options 25 | -------------------------------------------------------------------------------- /lua/plugins/trouble.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/trouble.nvim", 3 | opts = {}, -- for default options, refer to the configuration section for custom setup. 4 | cmd = "Trouble", 5 | keys = { 6 | { 7 | "xx", 8 | "Trouble diagnostics toggle", 9 | desc = "Diagnostics (Trouble)", 10 | }, 11 | { 12 | "xX", 13 | "Trouble diagnostics toggle filter.buf=0", 14 | desc = "Buffer Diagnostics (Trouble)", 15 | }, 16 | { 17 | "cs", 18 | "Trouble symbols toggle focus=false", 19 | desc = "Symbols (Trouble)", 20 | }, 21 | { 22 | "xL", 23 | "Trouble loclist toggle", 24 | desc = "Location List (Trouble)", 25 | }, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /lua/scripts/prettier.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.format_with_tailwind = function() 4 | local filepath = vim.fn.expand "%:p" 5 | local temp_dir = vim.fn.expand "~/.temp-prettier" 6 | 7 | -- Create the temp directory if it doesn't exist 8 | if vim.fn.isdirectory(temp_dir) == 0 then 9 | vim.fn.mkdir(temp_dir, "p") 10 | vim.fn.system("cd " .. temp_dir .. " && pnpm add prettier prettier-plugin-tailwindcss") 11 | end 12 | 13 | -- Format the file 14 | local cmd = 15 | string.format("cd %s && pnpm prettier --plugin prettier-plugin-tailwindcss --write %s", temp_dir, filepath) 16 | vim.fn.system(cmd) 17 | 18 | -- Reload the file in Neovim 19 | vim.cmd "edit!" 20 | end 21 | 22 | vim.api.nvim_create_user_command("TailwindFormat", M.format_with_tailwind, {}) 23 | 24 | return M 25 | -------------------------------------------------------------------------------- /lua/plugins/nvim-treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter", 3 | opts = { 4 | ensure_installed = require("languages").treesitter, 5 | }, 6 | dependencies = { 7 | { 8 | "windwp/nvim-ts-autotag", 9 | config = function() 10 | require("nvim-ts-autotag").setup() 11 | end, 12 | }, 13 | }, 14 | config = function() 15 | require("nvim-tree").setup { 16 | update_cwd = true, 17 | update_focused_file = { 18 | enable = true, 19 | update_root = true, 20 | ignore_list = { "help" }, 21 | }, 22 | renderer = { 23 | group_empty = true, 24 | special_files = {}, 25 | symlink_destination = false, 26 | }, 27 | git = { 28 | enable = true, 29 | ignore = false, 30 | }, 31 | filters = { 32 | dotfiles = false, 33 | }, 34 | } 35 | end, 36 | } 37 | -------------------------------------------------------------------------------- /lua/plugins/git-signs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lewis6991/gitsigns.nvim", 3 | config = function() 4 | -- GitSigns configuration 5 | require("gitsigns").setup { 6 | signs = { 7 | add = { text = "+" }, 8 | change = { text = "~" }, 9 | delete = { text = "-" }, 10 | topdelete = { text = "‾" }, 11 | changedelete = { text = "~" }, 12 | }, 13 | numhl = true, 14 | } 15 | 16 | -- Set custom highlights 17 | vim.api.nvim_set_hl(0, "GitSignsAdd", { fg = "#00ff00" }) -- Green for added lines 18 | vim.api.nvim_set_hl(0, "GitSignsChange", { fg = "#ffcc00" }) -- Yellow for changed lines 19 | vim.api.nvim_set_hl(0, "GitSignsChangedelete", { fg = "#ff6600" }) -- Orange for changed + deleted 20 | vim.api.nvim_set_hl(0, "GitSignsDelete", { fg = "#ff0000" }) -- Red for deleted lines 21 | vim.api.nvim_set_hl(0, "GitSignsTopdelete", { fg = "#ff3300" }) -- Dark red for top-deleted lines 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /lua/configs/lazy.lua: -------------------------------------------------------------------------------- 1 | return { 2 | defaults = { lazy = true }, 3 | install = { colorscheme = { "nvchad" } }, 4 | 5 | ui = { 6 | icons = { 7 | ft = "", 8 | lazy = "󰂠 ", 9 | loaded = "", 10 | not_loaded = "", 11 | }, 12 | }, 13 | 14 | performance = { 15 | rtp = { 16 | disabled_plugins = { 17 | "2html_plugin", 18 | "tohtml", 19 | "getscript", 20 | "getscriptPlugin", 21 | "gzip", 22 | "logipat", 23 | "netrw", 24 | "netrwPlugin", 25 | "netrwSettings", 26 | "netrwFileHandlers", 27 | "matchit", 28 | "tar", 29 | "tarPlugin", 30 | "rrhelper", 31 | "spellfile_plugin", 32 | "vimball", 33 | "vimballPlugin", 34 | "zip", 35 | "zipPlugin", 36 | "tutor", 37 | "rplugin", 38 | "syntax", 39 | "synmenu", 40 | "optwin", 41 | "compiler", 42 | "bugreport", 43 | "ftplugin", 44 | }, 45 | }, 46 | }, 47 | } 48 | -------------------------------------------------------------------------------- /lua/plugins/ts-ls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "pmizio/typescript-tools.nvim", 3 | dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, 4 | config = function() 5 | local api = require "typescript-tools.api" 6 | require("typescript-tools").setup { 7 | handlers = { 8 | ["textDocument/publishDiagnostics"] = api.filter_diagnostics { 6133 }, 9 | }, 10 | settings = { 11 | tsserver_file_preferences = { 12 | importModuleSpecifierPreference = "non-relative", 13 | }, 14 | }, 15 | } 16 | local autocmd = vim.api.nvim_create_autocmd 17 | autocmd("BufWritePre", { 18 | pattern = "*.ts,*.tsx,*.jsx,*.js", 19 | callback = function(args) 20 | vim.cmd "silent! undojoin | TSToolsAddMissingImports sync" 21 | vim.cmd "silent! undojoin | TSToolsOrganizeImports sync" 22 | require("conform").format { bufnr = args.buf } 23 | end, 24 | }) 25 | local keymap = vim.keymap.set 26 | keymap("n", "lc", ":TSToolsRemoveUnused", { desc = "Remove unused code" }) 27 | keymap("n", "lf", ":TSToolsFixAll", { desc = "Fix all fixable errors" }) 28 | end, 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /lua/chadrc.lua: -------------------------------------------------------------------------------- 1 | ---@type ChadrcConfig 2 | local M = {} 3 | 4 | M.base46 = { 5 | theme = "catppuccin", 6 | } 7 | 8 | M.ui = { 9 | tabufline = { 10 | order = { "treeOffset", "buffers" }, 11 | }, 12 | lsp_semantic_tokens = true, 13 | cmp = { 14 | icons_left = true, 15 | format_colors = { 16 | tailwind = true, 17 | }, 18 | }, 19 | statusline = { 20 | theme = "default", 21 | separator_style = "arrow", 22 | modules = { 23 | file = function() 24 | -- relative file path limited to 5 levels 25 | local icon = "󰈚 " 26 | local path = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()) 27 | local relpath = vim.fn.fnamemodify(path, ":.") 28 | 29 | -- Limit the path depth to 5 levels 30 | local parts = vim.split(relpath, "/") 31 | if #parts > 4 then 32 | relpath = table.concat(vim.list_slice(parts, #parts - 3, #parts), "/") 33 | end 34 | 35 | local name = (relpath == "" and "Empty ") or relpath 36 | if name ~= "Empty " then 37 | local devicons_present, devicons = pcall(require, "nvim-web-devicons") 38 | 39 | if devicons_present then 40 | local ft_icon = devicons.get_icon(name) 41 | icon = (ft_icon ~= nil and ft_icon) or icon 42 | end 43 | name = " " .. name .. " " 44 | end 45 | return "%#StText# " .. icon .. name 46 | end, 47 | }, 48 | }, 49 | } 50 | return M 51 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/" 2 | vim.g.mapleader = " " 3 | 4 | -- bootstrap lazy and all plugins 5 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 6 | 7 | if not vim.uv.fs_stat(lazypath) then 8 | local repo = "https://github.com/folke/lazy.nvim.git" 9 | vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } 10 | end 11 | vim.opt.rtp:prepend(lazypath) 12 | 13 | local lazy_config = require "configs.lazy" 14 | 15 | -- load plugins 16 | require("lazy").setup({ 17 | { 18 | "NvChad/NvChad", 19 | lazy = false, 20 | branch = "v2.5", 21 | import = "nvchad.plugins", 22 | config = function() 23 | require "options" 24 | end, 25 | }, 26 | 27 | require "plugins.inline-diagnostics", 28 | require "plugins.nvim-treesitter", 29 | require "plugins.git-signs", 30 | require "plugins.conform", 31 | require "plugins.toggle-term", 32 | require "plugins.auto-session", 33 | require "plugins.supermaven", 34 | require "plugins.trouble", 35 | require "plugins.lazygit", 36 | require "plugins.rename", 37 | require "plugins.hardtime", 38 | require "plugins.multicursors", 39 | require "plugins.ts-ls", 40 | require "plugins.discord", 41 | { import = "plugins" }, 42 | }, lazy_config) 43 | 44 | -- load theme 45 | dofile(vim.g.base46_cache .. "defaults") 46 | dofile(vim.g.base46_cache .. "statusline") 47 | require("nvim-treesitter.configs").setup { 48 | highlight = { 49 | enable = true, 50 | }, 51 | indent = { 52 | enable = true, 53 | }, 54 | incremental_selection = { 55 | enable = true, 56 | keymaps = { 57 | node_incremental = "v", 58 | node_decremental = "", 59 | }, 60 | }, 61 | } 62 | require "options" 63 | require "autocmds" 64 | 65 | require("treesitter-context").setup { 66 | max_lines = 1, 67 | trim_scope = "inner", 68 | } 69 | vim.schedule(function() 70 | require "mappings" 71 | end) 72 | -------------------------------------------------------------------------------- /lua/configs/lspconfig.lua: -------------------------------------------------------------------------------- 1 | -- Load defaults (e.g., lua_lsp) 2 | require("nvchad.configs.lspconfig").defaults() 3 | 4 | local lspconfig = require "lspconfig" 5 | 6 | -- List of LSP servers with default configurations 7 | local servers = require("languages").lsp_servers 8 | local nvlsp = require "nvchad.configs.lspconfig" 9 | 10 | -- Setup LSP servers with default configs 11 | for _, lsp in ipairs(servers) do 12 | lspconfig[lsp].setup { 13 | on_attach = nvlsp.on_attach, 14 | on_init = nvlsp.on_init, 15 | capabilities = nvlsp.capabilities, 16 | } 17 | end 18 | 19 | lspconfig.sqlls.setup { 20 | on_attach = nvlsp.on_attach, 21 | on_init = nvlsp.on_init, 22 | capabilities = nvlsp.capabilities, 23 | cmd = { "sql-language-server", "up", "--method", "stdio" }, 24 | filetypes = { "sql" }, 25 | root_dir = lspconfig.util.root_pattern ".", 26 | } 27 | 28 | -- GO language server 29 | lspconfig.gopls.setup { 30 | on_attach = nvlsp.on_attach, 31 | on_init = nvlsp.on_init, 32 | capabilities = nvlsp.capabilities, 33 | cmd = { "gopls" }, 34 | filetypes = { "go", "gomod", "gowork", "gotmpl" }, 35 | root_dir = lspconfig.util.root_pattern("go.work", "go.mod", ".git"), 36 | settings = { 37 | gopls = { 38 | analyses = { 39 | unusedparams = true, 40 | }, 41 | staticcheck = true, 42 | }, 43 | }, 44 | } 45 | 46 | local jsonCapabilities = vim.lsp.protocol.make_client_capabilities() 47 | jsonCapabilities.textDocument.completion.completionItem.snippetSupport = true 48 | -- JSON language server 49 | lspconfig.jsonls.setup { 50 | on_attach = nvlsp.on_attach, 51 | on_init = nvlsp.on_init, 52 | capabilities = jsonCapabilities, 53 | cmd = { "vscode-json-language-server", "--stdio" }, 54 | filetypes = { "json" }, 55 | } 56 | require("typescript-tools").setup { 57 | on_attach = nvlsp.on_attach, 58 | on_init = nvlsp.on_init, 59 | capabilities = nvlsp.capabilities, 60 | } 61 | 62 | lspconfig.tailwindcss.setup { 63 | on_attach = nvlsp.on_attach, 64 | on_init = nvlsp.on_init, 65 | capabilities = nvlsp.capabilities, 66 | settings = { 67 | tailwindCSS = { 68 | classAttributes = { "class", "className", "classList" }, 69 | emmetCompletions = true, 70 | hovers = true, 71 | suggestions = true, 72 | }, 73 | }, 74 | } 75 | 76 | -- C++ language server (Clangd) 77 | lspconfig.clangd.setup { 78 | on_attach = nvlsp.on_attach, 79 | on_init = nvlsp.on_init, 80 | capabilities = nvlsp.capabilities, 81 | -- You can add extra clangd-specific settings here if needed. 82 | } 83 | -------------------------------------------------------------------------------- /lua/mappings.lua: -------------------------------------------------------------------------------- 1 | require "nvchad.mappings" 2 | -- add yours here 3 | -- 4 | local map = vim.keymap.set 5 | map("n", ";", ":", { desc = "CMD enter command mode" }) 6 | map("i", "jk", "") 7 | map("i", "", ":wi", { noremap = true, silent = true }) 8 | map({ "n", "i" }, "", "lua vim.lsp.buf.signature_help()", { noremap = true, silent = true }) 9 | local nvimTreeAPI = require "nvim-tree.api" 10 | map("n", "fs", " lua require ('telescope.builtin').lsp_document_symbols({ symbols = 'function'})", { 11 | desc = "Find function", 12 | }) 13 | map("n", "r", function() 14 | nvimTreeAPI.tree.change_root_to_node() 15 | end, { desc = "Set selected folder as root" }) 16 | 17 | map("n", "fp", function() 18 | require("scripts.prettier").format_with_tailwind() 19 | end, { desc = "Format with tailwind" }) 20 | 21 | map("n", "p", function() 22 | nvimTreeAPI.tree.change_root_to_parent() 23 | end, { desc = "Revert to parent directory as root" }) 24 | local Terminal = require("toggleterm.terminal").Terminal 25 | local lazygit = nil 26 | 27 | vim.keymap.set({ "n", "t" }, "", function() 28 | if not lazygit then 29 | -- Create the LazyGit terminal if it doesn't exist 30 | lazygit = Terminal:new { 31 | cmd = "lazygit", 32 | hidden = true, 33 | direction = "float", 34 | close_on_exit = true, 35 | float_opts = { 36 | border = "shadow", 37 | width = vim.o.columns, 38 | height = math.floor(vim.o.lines * 1), 39 | winblend = 3, 40 | }, 41 | on_close = function() 42 | vim.cmd "set cmdheight=1" 43 | end, 44 | } 45 | end 46 | 47 | -- Check if the terminal is currently open and toggle accordingly 48 | if lazygit:is_open() then 49 | lazygit:close() 50 | else 51 | vim.o.cmdheight = 0 52 | lazygit:open() 53 | end 54 | end, { silent = true, desc = "Toggle LazyGit terminal" }) 55 | -- Create a terminal instance 56 | local term = Terminal:new { 57 | hidden = true, -- Start hidden 58 | } 59 | 60 | -- Function to toggle the current terminal 61 | local function toggle_current_terminal() 62 | term:toggle() 63 | end 64 | 65 | -- Keymaps for toggling and creating terminals 66 | map({ "n", "t" }, "", toggle_current_terminal, { desc = "Toggle the current terminal" }) 67 | 68 | vim.keymap.set("n", "rn", function() 69 | require "inc_rename" 70 | return ":IncRename " 71 | end, { desc = "Rename the word under cursor", expr = true }) 72 | 73 | vim.keymap.set("n", "rN", function() 74 | require "inc_rename" 75 | return ":IncRename " .. vim.fn.expand "" 76 | end, { desc = "Rename the word under cursor (Fills Word)", expr = true }) 77 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, 3 | "NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" }, 4 | "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, 5 | "base46": { "branch": "v2.5", "commit": "40943fc668bf8f1caa4cc45f71c784cf0d3cc34f" }, 6 | "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, 7 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 8 | "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, 9 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, 10 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 11 | "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 12 | "conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" }, 13 | "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, 14 | "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, 15 | "hardtime.nvim": { "branch": "main", "commit": "511e98c3e8c782b2b4e4795568a878d813547d06" }, 16 | "inc-rename.nvim": { "branch": "main", "commit": "f4e13df6e2d0b3177a7305dbc1cc7f7ea44b94f1" }, 17 | "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, 18 | "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 19 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 20 | "menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" }, 21 | "minty": { "branch": "main", "commit": "6dce9f097667862537823d515a0250ce58faab05" }, 22 | "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, 23 | "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, 24 | "nvim-cmp": { "branch": "main", "commit": "8c447245e10a0637d236182c7b02d32da4bc23bf" }, 25 | "nvim-lspconfig": { "branch": "master", "commit": "040001d85e9190a904d0e35ef5774633e14d8475" }, 26 | "nvim-tree.lua": { "branch": "master", "commit": "f7b76cd1a75615c8d6254fc58bedd2a7304eb7d8" }, 27 | "nvim-treesitter": { "branch": "master", "commit": "fa915a30c5cdf1d18129e9ef6ac2ee0fa799904f" }, 28 | "nvim-treesitter-context": { "branch": "master", "commit": "8fd989b6b457a448606b4a2e51f9161700f609a7" }, 29 | "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, 30 | "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, 31 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 32 | "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, 33 | "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, 34 | "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, 35 | "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "66d9166520a0cb3392a5ef68946fd3980d57383f" }, 36 | "toggleterm.nvim": { "branch": "main", "commit": "022ff5594acccc8d90d2e46dc43994f7722ebdf7" }, 37 | "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, 38 | "typescript-tools.nvim": { "branch": "master", "commit": "35e397ce467bedbbbb5bfcd0aa79727b59a08d4a" }, 39 | "ui": { "branch": "v3.0", "commit": "9a4ecb0bbaecd7208471c678e7dbacdeba517648" }, 40 | "vim-go-syntax": { "branch": "main", "commit": "4bd077efb24fb728109daa484ba63da2e1f3fc47" }, 41 | "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, 42 | "volt": { "branch": "main", "commit": "0cdfa1dfbbfc8fda340054915991fda188db8d8e" }, 43 | "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } 44 | } 45 | --------------------------------------------------------------------------------