commit ed329af7dc795296277423db2be987aec0764156 Author: Josh Patra Date: Tue Mar 12 12:13:53 2024 -0400 first commit diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..38a20e5 --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,12 @@ +[user] + email = joshpatra12@gmail.com + name = Josh Patra + signingkey = 01823AE1 +[diff] + tool = nvimdiff +[core] + editor = nvim +[commit] + gpgSign = true +[tag] + gpgSign = true diff --git a/nvim/.config/nvim/.luarc.json b/nvim/.config/nvim/.luarc.json new file mode 100644 index 0000000..1e1765c --- /dev/null +++ b/nvim/.config/nvim/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.globals": [ + "vim" + ] +} \ No newline at end of file diff --git a/nvim/.config/nvim/README.md b/nvim/.config/nvim/README.md new file mode 100644 index 0000000..4b91f87 --- /dev/null +++ b/nvim/.config/nvim/README.md @@ -0,0 +1,20 @@ +# This is my personal Neovim Configuration + +## How it was made + +I'll be honest. I liked LazyVim but didn't want to learn the keybinds so I just copied the stuff I needed and added other plugins/changed keybinds for the rest. + +## Plugin Manager + +[Lazy.nvim](https://github.com/folke/lazy.nvim) +It's not entirely optimized, but I tried to reduce startup time as much as possible + +## UI Stuff + +I run tokyonight-moon theme, with alpha-nvim as my dashboard. + +I also have mini-indentscope and indent-blankline in order to get some cool indentation highlighting. Entirely unnecessary, but entirely cool. + +## LSP, Linting, and Formatters. + +I switched from null-ls to conform.nvim + nvim-lint after reading a Reddit Post. I find it pretty fast. Still perfecting the configuration though. diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..18f965e --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,21 @@ +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", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("vim-options") +require("vim-remaps") +require("vim-undo") +require("lazy").setup("plugins") + +-- vim.diagnostic.config({ +-- virtual_text = false, +-- }) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..4720f80 --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,58 @@ +{ + "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, + "actions-preview.nvim": { "branch": "master", "commit": "5072b1b1065a6b22bdd46b5c21780a91d6a08071" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "codesnap.nvim": { "branch": "main", "commit": "5d51b637125a0e419a684d503f09beb63b0abb96" }, + "conform.nvim": { "branch": "master", "commit": "db2c697fe8302f0328b50b480204be1b577a1e2f" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, + "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, + "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, + "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, + "lualine.nvim": { "branch": "master", "commit": "3c55675a7bc170d21d7ea70874ae66fbf5cfb0dc" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "55716a879568a498fa236593c8119789054a3b8e" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" }, + "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, + "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, + "mini.nvim": { "branch": "main", "commit": "d7d079d6f99c95218d6059e0eaf83997990b2e0e" }, + "minimap.vim": { "branch": "master", "commit": "6dc0c36fd92eab38064f22c016e43639f42293d3" }, + "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, + "nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-lint": { "branch": "master", "commit": "e824adb9bc01647f71e55457353a68f0f37f9931" }, + "nvim-lspconfig": { "branch": "master", "commit": "1917b562a02f20885900b1da0f0ea25028ccedab" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-treesitter": { "branch": "master", "commit": "488bec03254207b1dd071be8cb1fb78434b6e777" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ufo": { "branch": "main", "commit": "239ae620d818ffa1319ca3056546df71906d4bfb" }, + "nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" }, + "outline.nvim": { "branch": "main", "commit": "a8d40aecb799196303ff3521c0e31c87bba57198" }, + "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, + "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" }, + "smart-splits.nvim": { "branch": "master", "commit": "039fb0a5172cc35ffee7cc9d40d9496541609799" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "8839e3f8070dfafa5b0c0e4652700298e7b872c4" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, + "tokyonight.nvim": { "branch": "main", "commit": "c025baf23b62f044eff1f4ef561c45de636f0e32" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, + "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" }, + "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, + "vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" }, + "vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/joshp/icons.lua b/nvim/.config/nvim/lua/joshp/icons.lua new file mode 100644 index 0000000..8746807 --- /dev/null +++ b/nvim/.config/nvim/lua/joshp/icons.lua @@ -0,0 +1,158 @@ +return { + kind = { + Array = " ", + Boolean = " ", + Class = " ", + Color = " ", + Constant = " ", + Constructor = " ", + Enum = " ", + EnumMember = " ", + Event = " ", + Field = " ", + File = " ", + Folder = "󰉋 ", + Function = " ", + Interface = " ", + Key = " ", + Keyword = " ", + Method = " ", + -- Module = " ", + Module = " ", + Namespace = " ", + Null = "󰟢 ", + Number = " ", + Object = " ", + Operator = " ", + Package = " ", + Property = " ", + Reference = " ", + Snippet = " ", + String = " ", + Struct = " ", + Text = " ", + TypeParameter = " ", + Unit = " ", + Value = " ", + Variable = " ", + }, + git = { + LineAdded = "", + LineModified = "", + LineRemoved = "", + FileDeleted = "", + FileIgnored = "◌", + FileRenamed = "", + FileStaged = "S", + FileUnmerged = "", + FileUnstaged = "", + FileUntracked = "U", + Diff = "", + Repo = "", + Octoface = "", + Copilot = "", + Branch = "", + }, + ui = { + ArrowCircleDown = "", + ArrowCircleLeft = "", + ArrowCircleRight = "", + ArrowCircleUp = "", + BoldArrowDown = "", + BoldArrowLeft = "", + BoldArrowRight = "", + BoldArrowUp = "", + BoldClose = "", + BoldDividerLeft = "", + BoldDividerRight = "", + BoldLineLeft = "▎", + BoldLineMiddle = "┃", + BoldLineDashedMiddle = "┋", + BookMark = "", + BoxChecked = "", + Bug = "", + Stacks = "", + Scopes = "", + Watches = "󰂥", + DebugConsole = "", + Calendar = "", + Check = "", + ChevronRight = "", + ChevronShortDown = "", + ChevronShortLeft = "", + ChevronShortRight = "", + ChevronShortUp = "", + Circle = "", + Close = "󰅖", + CloudDownload = "", + Code = "", + Comment = "", + Dashboard = "", + DividerLeft = "", + DividerRight = "", + DoubleChevronRight = "»", + Ellipsis = "", + EmptyFolder = "", + EmptyFolderOpen = "", + File = "", + FileSymlink = "", + Files = "", + FindFile = "󰈞", + FindText = "󰊄", + Fire = "", + Folder = "󰉋", + FolderOpen = "", + FolderSymlink = "", + Forward = "", + Gear = "", + History = "", + Lightbulb = "", + LineLeft = "▏", + LineMiddle = "│", + List = "", + Lock = "", + NewFile = "", + Note = "", + Package = "", + Pencil = "󰏫", + Plus = "", + Project = "", + Search = "", + SignIn = "", + SignOut = "", + Tab = "󰌒", + Table = "", + Target = "󰀘", + Telescope = "", + Text = "", + Tree = "", + Triangle = "󰐊", + TriangleShortArrowDown = "", + TriangleShortArrowLeft = "", + TriangleShortArrowRight = "", + TriangleShortArrowUp = "", + }, + diagnostics = { + BoldError = "", + Error = "", + BoldWarning = "", + Warning = "", + BoldInformation = "", + Information = "", + BoldQuestion = "", + Question = "", + BoldHint = "", + Hint = "󰌶", + Debug = "", + Trace = "✎", + }, + misc = { + Robot = "󰚩", + Squirrel = "", + Tag = "", + Watch = "", + Smiley = "", + Package = "", + CircuitBoard = "", + }, +} diff --git a/nvim/.config/nvim/lua/plugins/alpha.lua b/nvim/.config/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..485e6b6 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/alpha.lua @@ -0,0 +1,40 @@ +return { + "goolord/alpha-nvim", + dependencies = { + { "nvim-tree/nvim-web-devicons", lazy = true }, + }, + + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + dashboard.section.buttons.val = { + dashboard.button("e", " New file", "ene "), + dashboard.button("SPC f f", "󰈞 Find file"), + dashboard.button("SPC f b", " File Browser"), + dashboard.button("SPC o f", "󰊄 Recently opened files"), + dashboard.button("SPC l g", "󰈬 Find word"), + dashboard.button("SPC l a", "💤 Lazy", ":Lazy"), + dashboard.button("SPC q a", "󰅚 Quit NVIM", ":qa"), + } + + alpha.setup(dashboard.opts) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/clangd.lua b/nvim/.config/nvim/lua/plugins/clangd.lua new file mode 100644 index 0000000..bd445db --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/clangd.lua @@ -0,0 +1,98 @@ +return { + + -- Add C/C++ to treesitter + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "c", "cpp" }) + end + end, + }, + + { + "p00f/clangd_extensions.nvim", + lazy = true, + config = function() end, + opts = { + inlay_hints = { + inline = false, + }, + ast = { + --These require codicons (https://github.com/microsoft/vscode-codicons) + role_icons = { + type = "", + declaration = "", + expression = "", + specifier = "", + statement = "", + ["template argument"] = "", + }, + kind_icons = { + Compound = "", + Recovery = "", + TranslationUnit = "", + PackExpansion = "", + TemplateTypeParm = "", + TemplateTemplateParm = "", + TemplateParamObject = "", + }, + }, + }, + }, + + -- Correctly setup lspconfig for clangd 🚀 + { + "neovim/nvim-lspconfig", + opts = { + servers = { + -- Ensure mason installs the server + clangd = { + keys = { + { "cR", "ClangdSwitchSourceHeader", desc = "Switch Source/Header (C/C++)" }, + }, + root_dir = function(fname) + return require("lspconfig.util").root_pattern( + "Makefile", + "configure.ac", + "configure.in", + "config.h.in", + "meson.build", + "meson_options.txt", + "build.ninja" + )(fname) or require("lspconfig.util").root_pattern( + "compile_commands.json", + "compile_flags.txt" + )(fname) or require("lspconfig.util").find_git_ancestor(fname) + end, + capabilities = { + offsetEncoding = { "utf-16" }, + }, + cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--header-insertion=iwyu", + "--completion-style=detailed", + "--function-arg-placeholders", + "--fallback-style=llvm", + }, + init_options = { + usePlaceholders = true, + completeUnimported = true, + clangdFileStatus = true, + }, + }, + }, + setup = { + clangd = function(_, opts) + local clangd_ext_opts = require("lazyvim.util").opts("clangd_extensions.nvim") + require("clangd_extensions").setup( + vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts }) + ) + return false + end, + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/codesnap.lua b/nvim/.config/nvim/lua/plugins/codesnap.lua new file mode 100644 index 0000000..92b235c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/codesnap.lua @@ -0,0 +1,14 @@ +return { + "mistricky/codesnap.nvim", + lazy = "true", + build = "make", + cmd = "CodeSnapPreviewOn", + config = function() + require("codesnap").setup({ + mac_window_bar = true, -- (Optional) MacOS style title bar switch + opacity = true, -- (Optional) The code snap has some opacity by default, set it to false for 100% opacity + watermark = "joshp", -- (Optional) you can custom your own watermark, but if you don't like it, just set it to "" + preview_title = "CodeSnap.nvim", -- (Optional) preview page title + }) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/completions.lua b/nvim/.config/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..dedaa6a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/completions.lua @@ -0,0 +1,134 @@ +return { + { + "hrsh7th/nvim-cmp", + version = false, -- last release is way too old + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lsp-signature-help", + }, + opts = function() + vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) + local cmp = require("cmp") + local luasnip = require("luasnip") + local defaults = require("cmp.config.default")() + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(":", { + -- mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "cmdline" }, + { name = "path" }, + }), + }) + + return { + completion = { + completeopt = "menu,menuone,noinsert", + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = "copilot" }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + { name = "nvim_lsp_signature_help" }, + }), + experimental = { + ghost_text = { + hl_group = "CmpGhostText", + }, + }, + sorting = { + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.recently_used, + require("clangd_extensions.cmp_scores"), + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, + } + end, + ---@param opts cmp.ConfigSchema + config = function(_, opts) + for _, source in ipairs(opts.sources) do + source.group_index = source.group_index or 1 + end + require("cmp").setup(opts) + end, + }, + + -- snippets + { + "L3MON4D3/LuaSnip", + build = "make install_jsregexp", + dependencies = { + { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + { + "nvim-cmp", + dependencies = { + "saadparwaiz1/cmp_luasnip", + }, + opts = function(_, opts) + opts.snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + } + table.insert(opts.sources, { name = "luasnip" }) + end, + }, + }, + opts = { + history = true, + delete_check_events = "TextChanged", + }, + -- stylua: ignore + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, silent = true, mode = "i", + }, + { "", function() require("luasnip").jump(1) end, mode = "s" }, + { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..7f51509 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,32 @@ +return { + "stevearc/conform.nvim", + lazy = true, + event = { "BufReadPre", "BufNewFile" }, -- to disable, comment this out + config = function() + local conform = require("conform") + + conform.setup({ + formatters_by_ft = { + c = { "clang-format" }, + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + svelte = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + lua = { "stylua" }, + python = { "isort", "black" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..3848b5f --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,34 @@ +return { + + -- copilot + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + build = ":Copilot auth", + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + filetypes = { + markdown = true, + help = true, + }, + }, + }, + { + "nvim-lualine/lualine.nvim", + optional = true, + event = "VeryLazy", + }, + + -- copilot cmp source + { + "nvim-cmp", + dependencies = { + { + "zbirenbaum/copilot-cmp", + dependencies = "copilot.lua", + opts = {}, + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/flash.lua b/nvim/.config/nvim/lua/plugins/flash.lua new file mode 100644 index 0000000..b3d03b0 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/flash.lua @@ -0,0 +1,10 @@ +return { + "folke/flash.nvim", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/git-signs.lua b/nvim/.config/nvim/lua/plugins/git-signs.lua new file mode 100644 index 0000000..0c82921 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/git-signs.lua @@ -0,0 +1,63 @@ +-- git signs highlights text that has changed since the list +-- git commit, and also lets you interactively stage & unstage +-- hunks in a commit. +local icons = require("joshp.icons") +return { + "lewis6991/gitsigns.nvim", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = { + signs = { + add = { + hl = "GitSignsAdd", + text = icons.ui.BoldLineMiddle, + numhl = "GitSignsAddNr", + linehl = "GitSignsAddLn", + }, + change = { + hl = "GitSignsChange", + text = icons.ui.BoldLineDashedMiddle, + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + delete = { + hl = "GitSignsDelete", + text = icons.ui.TriangleShortArrowRight, + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = icons.ui.TriangleShortArrowRight, + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsChange", + text = icons.ui.BoldLineMiddle, + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, desc) + vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) + end + + -- stylua: ignore start + map("n", "]h", gs.next_hunk, "Next Hunk") + map("n", "[h", gs.prev_hunk, "Prev Hunk") + map({ "n", "v" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") + map({ "n", "v" }, "ghr", ":Gitsigns reset_hunk", "Reset Hunk") + map("n", "ghS", gs.stage_buffer, "Stage Buffer") + map("n", "ghu", gs.undo_stage_hunk, "Undo Stage Hunk") + -- tempo + map("n", "ghR", gs.reset_buffer, "Reset Buffer") + map("n", "ghp", gs.preview_hunk_inline, "Preview Hunk Inline") + map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") + map("n", "ghd", gs.diffthis, "Diff This") + map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/indent-level.lua b/nvim/.config/nvim/lua/plugins/indent-level.lua new file mode 100644 index 0000000..33560bb --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/indent-level.lua @@ -0,0 +1,57 @@ +return { + { + "echasnovski/mini.indentscope", + version = false, -- wait till new 0.7.0 release to put it back on semver + opts = { + -- symbol = "▏", + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, + { + "lukas-reineke/indent-blankline.nvim", + opts = { + indent = { + char = "│", + tab_char = "│", + }, + scope = { enabled = true }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + }, + main = "ibl", + }, +} diff --git a/nvim/.config/nvim/lua/plugins/lsp-config.lua b/nvim/.config/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..2b63565 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,173 @@ +return { + { + "williamboman/mason.nvim", + lazy = false, + dependencies = { + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + local mason = require("mason") + local mason_tool_installer = require("mason-tool-installer") + + mason.setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, + }) + + mason_tool_installer.setup({ + ensure_installed = { + "prettier", -- prettier formatter + "stylua", -- lua formatter + "isort", -- python formatter + "black", -- python formatter + "pylint", -- python linter + "eslint_d", -- js linter + }, + }) + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + opts = { + auto_install = true, + }, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + opts = { + -- options for vim.diagnostic.config() + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = false, + severity_sort = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "✖ ", + [vim.diagnostic.severity.WARN] = "⚠ ", + [vim.diagnostic.severity.HINT] = "➤ ", + [vim.diagnostic.severity.INFO] = "ℹ ", + }, + }, + }, + -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the inlay hints. + inlay_hints = { + enabled = true, + }, + -- add any global capabilities here + -- options for vim.lsp.buf.format + -- `bufnr` and `filter` is handled by the LazyVim formatter, + -- but can be also overridden when specified + format = { + formatting_options = nil, + timeout_ms = nil, + }, + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + capabilities.offsetEncoding = { "utf-16" } + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + local lspconfig = require("lspconfig") + 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 + lspconfig.tsserver.setup({ + capabilities = capabilities, + }) + lspconfig.html.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ + capabilities = capabilities, + }) + lspconfig.pyright.setup({ + capabilities = capabilities, + }) + lspconfig.rust_analyzer.setup({ + -- Server-specific settings. See `:help lspconfig-setup` + capabilities = capabilities, + settings = { + ["rust-analyzer"] = {}, + }, + }) + + lspconfig.clangd.setup({ + capabilities = capabilities, + }) + require("ufo").setup() + + -- Global mappings. + -- See `:help vim.diagnostic.*` for documentation on any of the below functions + + -- Use LspAttach autocommand to only map the following keys + -- after the language server attaches to the current buffer + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + require("clangd_extensions.inlay_hints").setup_autocmd(), + require("clangd_extensions.inlay_hints").set_inlay_hints(), + callback = function(ev) + -- Enable completion triggered by + -- vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf } + + vim.keymap.set("n", "e", vim.diagnostic.open_float, { desc = "Open diagnostic float" }) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic" }) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic" }) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts, { desc = "Go to declaration" }) + vim.keymap.set( + "n", + "gd", + require("telescope.builtin").lsp_definitions, + opts, + { desc = "Go to definition" } + ) + vim.keymap.set( + "n", + "gr", + require("telescope.builtin").lsp_references, + opts, + { desc = "Go to references" } + ) + vim.keymap.set( + "n", + "gi", + require("telescope.builtin").lsp_implementations, + opts, + { desc = "Go to implementations" } + ) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + -- vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts, { desc = "Rename" }) + vim.keymap.set({ "n", "v" }, "ca", require("actions-preview").code_actions, opts, { + desc = "Code actions", + }) + vim.keymap.set("n", "f", function() + vim.lsp.buf.format({ async = true }) + end, opts, { desc = "Format" }) + end, + }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/lualine.lua b/nvim/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..7575447 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,45 @@ +return { + "nvim-lualine/lualine.nvim", + config = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + } + end, +} diff --git a/nvim/.config/nvim/lua/plugins/mini.lua b/nvim/.config/nvim/lua/plugins/mini.lua new file mode 100644 index 0000000..7913dd0 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/mini.lua @@ -0,0 +1,12 @@ +return { -- Collection of various small independent plugins/modules + "echasnovski/mini.nvim", + config = function() + -- Better Around/Inside textobjects + -- + -- Examples: + -- - va) - [V]isually select [A]round [)]paren + -- - yinq - [Y]ank [I]nside [N]ext [']quote + -- - ci' - [C]hange [I]nside [']quote + require("mini.ai").setup({ n_lines = 500 }) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/minimap.lua b/nvim/.config/nvim/lua/plugins/minimap.lua new file mode 100644 index 0000000..ee95266 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/minimap.lua @@ -0,0 +1,7 @@ +return { + "wfxr/minimap.vim", + lazy = true, + keys = { + { "m", vim.cmd.MinimapToggle, desc = "[M]inimap Toggle" }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/noice.lua b/nvim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..29f224c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,55 @@ +-- lazy.nvim +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- Better `vim.notify()` + { + "rcarriga/nvim-notify", + keys = { + { + "un", + function() + require("notify").dismiss({ silent = true, pending = true }) + end, + desc = "Dismiss all Notifications", + }, + }, + opts = { + timeout = 3000, + max_height = function() + return math.floor(vim.o.lines * 0.75) + end, + max_width = function() + return math.floor(vim.o.columns * 0.75) + end, + on_open = function(win) + vim.api.nvim_win_set_config(win, { zindex = 100 }) + end, + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/nvim-lint.lua b/nvim/.config/nvim/lua/plugins/nvim-lint.lua new file mode 100644 index 0000000..ce872ea --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/nvim-lint.lua @@ -0,0 +1,30 @@ +return { + "mfussenegger/nvim-lint", + lazy = true, + event = { "BufReadPre", "BufNewFile" }, -- to disable, comment this out + config = function() + local lint = require("lint") + + lint.linters_by_ft = { + javascript = { "eslint_d" }, + typescript = { "eslint_d" }, + javascriptreact = { "eslint_d" }, + typescriptreact = { "eslint_d" }, + svelte = { "eslint_d" }, + python = { "pylint" }, + } + + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + group = lint_augroup, + callback = function() + lint.try_lint() + end, + }) + + vim.keymap.set("n", "l", function() + lint.try_lint() + end, { desc = "Trigger linting for current file" }) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/outline.lua b/nvim/.config/nvim/lua/plugins/outline.lua new file mode 100644 index 0000000..d7d0202 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/outline.lua @@ -0,0 +1,16 @@ +return { + "hedyhli/outline.nvim", + lazy = true, + cmd = { "Outline", "OutlineOpen" }, + keys = { -- Example mapping to toggle outline + { "tb", "Outline", desc = "Toggle outline" }, + }, + opts = { + outline_window = { + -- Where to open the split window: right/left + position = "left", + -- Percentage or integer of columns + width = 20, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/smoothie.lua b/nvim/.config/nvim/lua/plugins/smoothie.lua new file mode 100644 index 0000000..ec2f35b --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/smoothie.lua @@ -0,0 +1,3 @@ +return { + "psliwka/vim-smoothie", +} diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..588bd4f --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,112 @@ +return { + { + "aznhe21/actions-preview.nvim", + }, + { + "nvim-telescope/telescope-ui-select.nvim", + }, + { + "nvim-telescope/telescope-file-browser.nvim", + }, + { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + "debugloop/telescope-undo.nvim", + }, + config = function() + local fb_actions = require("telescope._extensions.file_browser.actions") + + require("telescope").setup({ + vim.keymap.set("n", "sn", function() + require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) + end, { desc = "[S]earch [N]eovim files" }), + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + file_browser = { + mappings = { + ["i"] = { + [""] = fb_actions.create, + [""] = fb_actions.create_from_prompt, + [""] = fb_actions.rename, + [""] = fb_actions.move, + [""] = fb_actions.copy, + [""] = fb_actions.remove, + [""] = fb_actions.open, + [""] = fb_actions.goto_parent_dir, + [""] = fb_actions.goto_cwd, + [""] = fb_actions.change_cwd, + [""] = fb_actions.toggle_browser, + [""] = fb_actions.toggle_hidden, + [""] = fb_actions.toggle_all, + [""] = fb_actions.backspace, + }, + ["n"] = { + ["c"] = fb_actions.create, + ["r"] = fb_actions.rename, + ["m"] = fb_actions.move, + ["y"] = fb_actions.copy, + ["d"] = fb_actions.remove, + ["o"] = fb_actions.open, + ["g"] = fb_actions.goto_parent_dir, + ["e"] = fb_actions.goto_home_dir, + ["w"] = fb_actions.goto_cwd, + ["t"] = fb_actions.change_cwd, + ["f"] = fb_actions.toggle_browser, + ["h"] = fb_actions.toggle_hidden, + ["s"] = fb_actions.toggle_all, + }, + }, + }, + undo = { + side_by_side = true, + diff_context_lines = 8, + layout_strategy = "horizontal", + layout_config = { + preview_width = 0.65, + preview_cutoff = 0, + }, + mappings = { + i = { + ["a"] = function(prompt_bufnr) + local base = require("telescope-undo.actions").yank_additions(prompt_bufnr) + local function with_notif() + res = base() + notif({ "Copied " .. #res .. " lines to the clipboard" }) + end + return with_notif + end, + ["d"] = function(prompt_bufnr) + local base = require("telescope-undo.actions").yank_deletions(prompt_bufnr) + local function with_notif() + res = base() + notif({ "Copied " .. #res .. " lines to the clipboard" }) + end + return with_notif + end, + [""] = require("telescope-undo.actions").restore, + }, + n = { + ["A"] = require("telescope-undo.actions").yank_additions, + ["D"] = require("telescope-undo.actions").yank_deletions, + [""] = require("telescope-undo.actions").restore, + }, + }, + }, + }, + }) + require("telescope").load_extension("ui-select") + local builtin = require("telescope.builtin") + vim.keymap.set("n", "ff", "Telescope find_files", {}) + vim.keymap.set("n", "gf", "Telescope git_files", {}) + vim.keymap.set("n", "lg", "Telescope live_grep", {}) + vim.keymap.set("n", "ls", "Telescope grep_string", {}) + vim.keymap.set("n", "of", "Telescope oldfiles", {}) + vim.keymap.set("n", "fb", "Telescope file_browser", {}) + vim.keymap.set("n", "ut", "Telescope undo", {}) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/todo-comments.lua b/nvim/.config/nvim/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..caf6ce9 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/todo-comments.lua @@ -0,0 +1,19 @@ +return { + -- PERF: + -- Finds and lists all of the TODO, HACK, BUG, etc comment + -- in your project and loads them into a browsable list. + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + cmd = { "TodoTrouble", "TodoTelescope" }, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = true, + -- stylua: ignore + keys = { + { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, + { "st", "TodoTelescope", desc = "All [T]odos in Telescope" }, + { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Only [T]ODO/FIX/FIXME in Telescope" }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/tokyonight.lua b/nvim/.config/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..fe30e76 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tokyonight.lua @@ -0,0 +1,8 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme("tokyonight-storm") + end, +} diff --git a/nvim/.config/nvim/lua/plugins/tpope.lua b/nvim/.config/nvim/lua/plugins/tpope.lua new file mode 100644 index 0000000..cf097da --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tpope.lua @@ -0,0 +1,17 @@ +return { + { + "tpope/vim-fugitive", + config = function() + vim.keymap.set("n", "gs", "Git", {}) + end, + }, + { + "tpope/vim-surround", + }, + { + "tpope/vim-commentary", + }, + -- { + -- "tpope/vim-sleuth", + -- }, +} diff --git a/nvim/.config/nvim/lua/plugins/treesitter-autotag.lua b/nvim/.config/nvim/lua/plugins/treesitter-autotag.lua new file mode 100644 index 0000000..9537c8e --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/treesitter-autotag.lua @@ -0,0 +1,22 @@ +return { + "windwp/nvim-ts-autotag", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = function() + local config = require("nvim-ts-autotag") + config.setup({ + filetypes = { + "html", + "xml", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "svelte", + "vue", + }, + autotag = { + enable = true, + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/treesitter-context.lua b/nvim/.config/nvim/lua/plugins/treesitter-context.lua new file mode 100644 index 0000000..66c149c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/treesitter-context.lua @@ -0,0 +1,9 @@ +return { + "nvim-treesitter/nvim-treesitter-context", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + enabled = true, + opts = { mode = "cursor", max_lines = 3 }, + keys = { + + }, +} diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..8d5add1 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,15 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + ensure_installed = { "c", "css", "html", "javascript", "lua", "python", "typescript", "regex", "bash", "markdown", "markdown_inline"} + }) + end + } +} diff --git a/nvim/.config/nvim/lua/plugins/trouble.lua b/nvim/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..6deaa37 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,42 @@ +return { + { + "folke/trouble.nvim", + cmd = { "TroubleToggle", "Trouble" }, + opts = { use_diagnostic_signs = true }, + keys = { + { "td", "TroubleToggle document_diagnostics", desc = "Document Diagnostics (Trouble)" }, + { "tw", "TroubleToggle workspace_diagnostics", desc = "Workspace Diagnostics (Trouble)" }, + { "tl", "TroubleToggle loclist", desc = "Location List (Trouble)" }, + { "tq", "TroubleToggle quickfix", desc = "Quickfix List (Trouble)" }, + { + "[q", + function() + if require("trouble").is_open() then + require("trouble").previous({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cprev) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = "Previous trouble/quickfix item", + }, + { + "]q", + function() + if require("trouble").is_open() then + require("trouble").next({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cnext) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = "Next trouble/quickfix item", + }, + }, + }, + +} diff --git a/nvim/.config/nvim/lua/plugins/ufo.lua b/nvim/.config/nvim/lua/plugins/ufo.lua new file mode 100644 index 0000000..e09fae6 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/ufo.lua @@ -0,0 +1,8 @@ +return { + "kevinhwang91/nvim-ufo", + dependencies = "kevinhwang91/promise-async", + config = function() + vim.keymap.set("n", "zR", require("ufo").openAllFolds) + vim.keymap.set("n", "zM", require("ufo").closeAllFolds) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/util.lua b/nvim/.config/nvim/lua/plugins/util.lua new file mode 100644 index 0000000..1467ea6 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/util.lua @@ -0,0 +1,32 @@ +return { + + -- measure startuptime + { + "dstein64/vim-startuptime", + cmd = "StartupTime", + config = function() + vim.g.startuptime_tries = 100 + end, + }, + + -- Session management. This saves your session in the background, + -- keeping track of open buffers, window arrangement, and more. + -- You can restore sessions when returning through the dashboard. + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, + -- stylua: ignore + keys = { + -- restore the session for the current directory + { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + -- restore the last session + { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + -- stop Persistence => session won't be saved on exit + { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + }, + }, + + -- library used by other plugins + { "nvim-lua/plenary.nvim", lazy = true }, +} diff --git a/nvim/.config/nvim/lua/plugins/vim-illuminate.lua b/nvim/.config/nvim/lua/plugins/vim-illuminate.lua new file mode 100644 index 0000000..20e95ca --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/vim-illuminate.lua @@ -0,0 +1,36 @@ +return { + "RRethy/vim-illuminate", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = { + delay = 200, + large_file_cutoff = 2000, + large_file_overrides = { + providers = { "lsp" }, + }, + }, + config = function(_, opts) + require("illuminate").configure(opts) + + local function map(key, dir, buffer) + vim.keymap.set("n", key, function() + require("illuminate")["goto_" .. dir .. "_reference"](false) + end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer }) + end + + map("]]", "next") + map("[[", "prev") + + -- also set it after loading ftplugins, since a lot overwrite [[ and ]] + vim.api.nvim_create_autocmd("FileType", { + callback = function() + local buffer = vim.api.nvim_get_current_buf() + map("]]", "next", buffer) + map("[[", "prev", buffer) + end, + }) + end, + keys = { + { "]]", desc = "Next Reference" }, + { "[[", desc = "Prev Reference" }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/vim-tmux.lua b/nvim/.config/nvim/lua/plugins/vim-tmux.lua new file mode 100644 index 0000000..06ed852 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/vim-tmux.lua @@ -0,0 +1,41 @@ +return { + -- { + -- "christoomey/vim-tmux-navigator", + -- cmd = { + -- "TmuxNavigateLeft", + -- "TmuxNavigateDown", + -- "TmuxNavigateUp", + -- "TmuxNavigateRight", + -- "TmuxNavigatePrevious", + -- }, + -- keys = { + -- { "", "TmuxNavigateLeft" }, + -- { "", "TmuxNavigateDown" }, + -- { "", "TmuxNavigateUp" }, + -- { "", "TmuxNavigateRight" }, + -- { "", "TmuxNavigatePrevious" }, + -- }, + -- }, + { + "mrjones2014/smart-splits.nvim", + config = function() + require("smart-splits").setup({ + default_amount = 1, + }) + -- recommended mappings + -- resizing splits + -- these keymaps will also accept a range, + -- for example `10` will `resize_left` by `(10 * config.default_amount)` + vim.keymap.set("n", "", require("smart-splits").resize_left) + vim.keymap.set("n", "", require("smart-splits").resize_down) + vim.keymap.set("n", "", require("smart-splits").resize_up) + vim.keymap.set("n", "", require("smart-splits").resize_right) + -- moving between splits + vim.keymap.set("n", "", require("smart-splits").move_cursor_left) + vim.keymap.set("n", "", require("smart-splits").move_cursor_down) + vim.keymap.set("n", "", require("smart-splits").move_cursor_up) + vim.keymap.set("n", "", require("smart-splits").move_cursor_right) + vim.keymap.set("n", "", require("smart-splits").move_cursor_previous) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..1f311fa --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,153 @@ +return { + "folke/which-key.nvim", + config = function() + require("which-key").setup({ + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or in INSERT mode + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + spelling = { + enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions + suggestions = 20, -- how many suggestions should be shown in the list? + }, + presets = { + operators = true, -- adds help for operators like d, y, ... + motions = true, -- adds help for motions + text_objects = true, -- help for text objects triggered after entering an operator + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true, -- bindings for prefixed with g + }, + }, + -- add operators that will trigger motion and text object completion + -- to enable all native operators, set the preset / operators plugin above + operators = { gc = "Comments" }, + key_labels = { + -- override the label used to display some keys. It doesn't effect WK in any other way. + -- For example: + -- [""] = "SPC", + -- [""] = "RET", + -- [""] = "TAB", + }, + motions = { + count = true, + }, + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "➜", -- symbol used between a key and it's label + group = "+", -- symbol prepended to a group + }, + popup_mappings = { + scroll_down = "", -- binding to scroll down inside the popup + scroll_up = "", -- binding to scroll up inside the popup + }, + window = { + border = "none", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size. + padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent + zindex = 1000, -- positive value to position WhichKey above other floating windows. + }, + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + align = "left", -- align columns left, center or right + }, + ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label + hidden = { "", "", "", "", "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate + show_help = true, -- show a help message in the command line for using WhichKey + show_keys = true, -- show the currently pressed key and its label as a message in the command line + triggers = "auto", -- automatically setup triggers + -- triggers = {""} -- or specifiy a list manually + -- list of triggers, where WhichKey should not wait for timeoutlen and show immediately + triggers_nowait = { + -- marks + "`", + "'", + "g`", + "g'", + -- registers + '"', + "", + -- spelling + "z=", + }, + triggers_blacklist = { + -- list of mode / prefixes that should never be hooked by WhichKey + -- this is mostly relevant for keymaps that start with a native binding + i = { "j", "k" }, + v = { "j", "k" }, + }, + -- disable the WhichKey popup for certain buf types and file types. + -- Disabled by default for Telescope + disable = { + buftypes = {}, + filetypes = {}, + }, + }) + + local wk = require("which-key") + wk.register({ + gd = { "Go to definition" }, + gD = { "Go to declaration" }, + K = { "Show hover information" }, + ["gh"] = { "[H]unks" }, + [""] = { + e = { "[E]rror Float" }, + f = { + name = "[F]ile", + f = { "[F]inder" }, + b = { "[B]rowser" }, + }, -- create a binding with label + g = { + name = "[g]it", + s = { "[S]tatus" }, + f = { "[F]ind files in git repository" }, + }, + ["u"] = { + name = "[U]ndo/[NU]otifications", + t = { "[T]ree" }, + }, + ["t"] = { + name = "[T]ag/[T]rouble", + b = { "[B]ar" }, + }, + ["c"] = { + name = "[C]ode", + a = { "[A]ction" }, + }, + ["s"] = { + name = "[S]earch", + }, + ["l"] = { + name = "[L]ive", + g = { "[G]rep" }, + s = { "[S]tring Grep" }, + }, + ["o"] = { + name = "[O]ld", + f = { "[F]iles" }, + }, + ["q"] = { + name = "[Q]uick Session", + }, + ["r"] = { + name = "[r]e", + n = { "[n]ame" }, + }, + }, + }) + -- wk.register({ + -- ["m"] = { "MinimapToggle", "Toggle Minimap" }, + -- ["t"] = { "TagbarToggle", "Toggle Tagbar" }, + -- ["n"] = { "NERDTreeToggle", "Toggle NERDTree" }, + -- ["u"] = { "UndotreeToggle", "Toggle Undotree" }, + -- ["l"] = { "Telescope live_grep", "Live grep" }, + -- ["s"] = { "Search and Replace" }, + -- }, { prefix = "" }) + end, +} diff --git a/nvim/.config/nvim/lua/vim-options.lua b/nvim/.config/nvim/lua/vim-options.lua new file mode 100644 index 0000000..4d24318 --- /dev/null +++ b/nvim/.config/nvim/lua/vim-options.lua @@ -0,0 +1,60 @@ +-- mains +vim.o.compatible = false +vim.cmd("filetype plugin indent on") +vim.cmd("syntax on") +--line numbers +vim.wo.number = true +vim.wo.relativenumber = true +--bullseye cursors +vim.wo.cursorline = true +vim.wo.cursorcolumn = true +--splits +vim.opt.splitright = true +--shift/tab shit +vim.o.softtabstop = 2 +vim.o.tabstop = 2 +vim.o.shiftwidth = 2 +vim.o.expandtab = true +--search stuff +vim.o.incsearch = true +vim.o.hlsearch = true +-- Preview substitutions live, as you type! +vim.opt.inccommand = "split" +-- Sets how neovim will display certain whitespace in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +vim.opt.list = true +vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } +--casing stuff +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.smartindent = true +--random stuff +vim.o.showcmd = true +vim.o.showmode = true +vim.o.history = 1000 +-- commands vim +vim.o.wildmenu = true +vim.o.wildignore = "*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx" +vim.o.updatetime = 50 +--gutter +vim.wo.signcolumn = "yes" +--full colors +vim.o.termguicolors = true +--bottom of page lines left +vim.wo.scrolloff = 8 +--folding stuff +vim.o.foldcolumn = "1" -- '0' is not bad +vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value +vim.o.foldlevelstart = 99 +vim.o.foldenable = true +--yanking displays +vim.api.nvim_create_autocmd("TextYankPost", { + desc = "Highlight when yanking (copying) text", + group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) +--clipboard fixes +vim.o.clipboard = "unnamed" diff --git a/nvim/.config/nvim/lua/vim-remaps.lua b/nvim/.config/nvim/lua/vim-remaps.lua new file mode 100644 index 0000000..a9edfeb --- /dev/null +++ b/nvim/.config/nvim/lua/vim-remaps.lua @@ -0,0 +1,17 @@ +vim.g.mapleader = " " + +-- Visual mode mappings +-- move line up and done, and reformat while moving +vim.keymap.set("v", "J", ":m '>+1gv=gv", { noremap = true }) +vim.keymap.set("v", "K", ":m '<-2gv=gv", { noremap = true }) +--jk to escape +vim.keymap.set("i", "jk", "", { noremap = true }) +--cool search and replace +vim.keymap.set("n", "sr", [[:%s///g]], { desc = "[S]earch and [R]eplace" }) +--center searches when forward and reverse searching +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") +--stop Q from taking over +vim.keymap.set("n", "Q", "") +--clear search +vim.keymap.set("n", "h", ":nohlsearch", { desc = "[H]ide Search" }) diff --git a/nvim/.config/nvim/lua/vim-undo.lua b/nvim/.config/nvim/lua/vim-undo.lua new file mode 100644 index 0000000..3be1e89 --- /dev/null +++ b/nvim/.config/nvim/lua/vim-undo.lua @@ -0,0 +1,10 @@ +local undodir = vim.fn.expand("~/.undodir") + +-- Check if the undo directory exists, if not, create it +if not vim.fn.isdirectory(undodir) then + vim.fn.mkdir(undodir, "p", 0700) +end + +-- Set the undodir and enable undofile +vim.opt.undodir = undodir +vim.opt.undofile = true diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..bc4bce4 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,92 @@ +# C-s instead of C-b +unbind C-b +set-option -g prefix C-s +bind-key C-s send-prefix + +# split panes using | and - +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +unbind '"' +unbind % + +# set vi-mode +set-window-option -g mode-keys vi + +# keybindings for better selections +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cance + +# 24 bit colors +set-option -sa terminal-overrides ",xterm*:Tc" + +# enable mouse mode (tmux 2.1 and above) +set -g mouse on + +# reload config file (change file location to the tmux.conf you want to use) +unbind r +bind r source-file ~/.tmux.conf \; display "Reloaded!" + +# quick reload + +# Start windows and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +# stuff + +# '@pane-is-vim' is a pane-local option that is set by the plugin on load, +# and unset when Neovim exits or suspends; note that this means you'll probably +# not want to lazy-load smart-splits.nvim, as the variable won't be set until +# the plugin is loaded + +# Smart pane switching with awareness of Neovim splits. +bind-key -r h if -F "#{@pane-is-vim}" 'send-keys C-h' 'select-pane -L' +bind-key -r j if -F "#{@pane-is-vim}" 'send-keys C-j' 'select-pane -D' +bind-key -r k if -F "#{@pane-is-vim}" 'send-keys C-k' 'select-pane -U' +bind-key -r l if -F "#{@pane-is-vim}" 'send-keys C-l' 'select-pane -R' + +# Smart pane resizing with awareness of Neovim splits. +bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' 'resize-pane -L 1' +bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' 'resize-pane -D 1' +bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' 'resize-pane -U 1' +bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' 'resize-pane -R 1' + + +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if -F \"#{@pane-is-vim}\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if -F \"#{@pane-is-vim}\" 'send-keys C-\\\\' 'select-pane -l'" + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R +bind-key -T copy-mode-vi 'C-\' select-pane -l + +bind C-l send-keys 'C-l' +# other stuff + +# messages +set -g message-style 'fg=colour2 bg=colour0 bold' + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'dracula/tmux' +set -g @plugin 'tmux-plugins/tmux-yank' + +set -g @dracula-refresh-rate 1 +set -g @dracula-show-powerline true +set -g @dracula-fixed-location "Flemington" +set -g @dracula-plugins "weather battery time date" +set -g @dracula-show-flags true +set -g @dracula-show-left-icon session +set -g status-position top + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/zsh/.zsh_profile b/zsh/.zsh_profile new file mode 100644 index 0000000..49bd4ca --- /dev/null +++ b/zsh/.zsh_profile @@ -0,0 +1,8 @@ +export HISTSIZE=5000 +export SAVEHIST=10000 +HISTFILE=~/.cache/zsh/history +setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format. +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. +setopt SHARE_HISTORY # Share history between all sessions. +setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history. +setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again. diff --git a/zsh/.zsh_sessions/138BA1F8-C366-480B-AC13-865CA21E5B5F.session b/zsh/.zsh_sessions/138BA1F8-C366-480B-AC13-865CA21E5B5F.session new file mode 100644 index 0000000..3373c6a --- /dev/null +++ b/zsh/.zsh_sessions/138BA1F8-C366-480B-AC13-865CA21E5B5F.session @@ -0,0 +1 @@ +echo Restored session: "$(/bin/date -r 1708134380)" diff --git a/zsh/.zsh_sessions/_expiration_check_timestamp b/zsh/.zsh_sessions/_expiration_check_timestamp new file mode 100644 index 0000000..e69de29 diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..552362a --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1 @@ +export PATH=/Users/joshp/.local/bin:$PATH diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..5e8d968 --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,132 @@ +export GPG_TTY=$TTY +gpgconf --launch gpg-agent +export BAT_THEME="Enki-Tokyo-Night" + +source ~/Projects/zsh-autocomplete/zsh-autocomplete.plugin.zsh +# 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 + +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="powerlevel10k/powerlevel10k" +SOLARIZED_THEME="dark" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git hacker-quotes) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='nvim' +fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +alias zshconfig="nvim ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +alias vim=nvim +alias cd=z +alias ls=eza +alias ll="eza -alh" +alias tree="eza --tree" +alias cat=bat + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh +eval "$(zoxide init zsh)" +# zsh-autocomplete keybinds +bindkey '\t' menu-select "$terminfo[kcbt]" menu-select +bindkey -M menuselect '\t' menu-complete "$terminfo[kcbt]" reverse-menu-complete + +eval "$(atuin init zsh)" +eval "$(atuin init zsh)" diff --git a/zsh/.zshrc.pre-oh-my-zsh b/zsh/.zshrc.pre-oh-my-zsh new file mode 100644 index 0000000..8a02b5a --- /dev/null +++ b/zsh/.zshrc.pre-oh-my-zsh @@ -0,0 +1,8 @@ +eval "$(pyenv init --path)" +export PATH="/opt/homebrew/opt/openjdk/bin:$PATH" +export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH" +export PATH=$PATH:/Users/joshp/.spicetify +test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" + +export PATH="$PATH:$HOME/.local/bin" +export PATH="/Users/joshp/.cargo/bin:$PATH"