From 9807cc8cf6d897124968574c413aa99658457de6 Mon Sep 17 00:00:00 2001 From: Blake Donnelly Date: Mon, 10 Feb 2025 20:36:07 -0500 Subject: [PATCH 1/2] Add dotfiles --- .zshrc | 123 +++++++++ nvim_configs | 1 - nvim_configs_test/.gitignore | 2 - nvim_configs_test/README.md | 18 -- nvim_configs_test/init.lua | 2 - nvim_configs_test/lazy-lock.json | 33 --- nvim_configs_test/lua/theprimeagen/init.lua | 70 ------ .../lua/theprimeagen/lazy/cloak.lua | 26 -- .../lua/theprimeagen/lazy/colors.lua | 89 ------- .../lua/theprimeagen/lazy/fugitive.lua | 38 --- .../lua/theprimeagen/lazy/init.lua | 10 - .../lua/theprimeagen/lazy/lsp.lua | 238 ------------------ .../lua/theprimeagen/lazy/snippets.lua | 25 -- .../lua/theprimeagen/lazy/telescope.lua | 30 --- .../lua/theprimeagen/lazy/treesitter.lua | 49 ---- .../lua/theprimeagen/lazy/trouble.lua | 23 -- .../lua/theprimeagen/lazy/undotree.lua | 9 - .../lua/theprimeagen/lazy/vimbegood.lua | 12 - .../lua/theprimeagen/lazy/zenmode.lua | 37 --- .../lua/theprimeagen/lazy_init.lua | 17 -- nvim_configs_test/lua/theprimeagen/remap.lua | 77 ------ nvim_configs_test/lua/theprimeagen/set.lua | 32 --- zshrc | 59 ----- 23 files changed, 123 insertions(+), 897 deletions(-) create mode 100644 .zshrc delete mode 160000 nvim_configs delete mode 100644 nvim_configs_test/.gitignore delete mode 100644 nvim_configs_test/README.md delete mode 100644 nvim_configs_test/init.lua delete mode 100644 nvim_configs_test/lazy-lock.json delete mode 100644 nvim_configs_test/lua/theprimeagen/init.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/cloak.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/colors.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/fugitive.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/init.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/lsp.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/snippets.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/telescope.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/treesitter.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/trouble.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/undotree.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/vimbegood.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy/zenmode.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/lazy_init.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/remap.lua delete mode 100644 nvim_configs_test/lua/theprimeagen/set.lua delete mode 100644 zshrc diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..107d00a --- /dev/null +++ b/.zshrc @@ -0,0 +1,123 @@ +# Source zsh-async +source "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-async/async.zsh" + +# Initialize async worker +async_init +async_start_worker async_worker -n + +# Callback function to handle the result of compinit +async_register_callback async_worker handle_compinit() { + # Actions after compinit, if needed +} + +# Load compinit asynchronously +async_job async_worker compinit -C + +# Path to your Oh My Zsh installation +export ZSH="$HOME/.oh-my-zsh" + +# Set theme and plugins +ZSH_THEME="crunch" +DISABLE_AUTO_UPDATE="true" +plugins=(git) + +# Export PATH +export PATH="$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH:$HOME/.yarn-global/bin" + +# Load Oh My Zsh +source $ZSH/oh-my-zsh.sh + +function git_prepare_commit() { + # Pull the latest changes from the main branch of the main repo + git pull origin main + + # Update submodules, initialize if needed, and pull from main branch for each + git submodule update --init --recursive + git submodule foreach --recursive 'git checkout main && git pull origin main' + + # Stage all changes + git add . + + # Commit with the provided message + git commit -m "$1" + + echo "Main repo and submodules updated and committed with message: '$1'" +} + + +# Custom Aliases +alias hg="history | grep" +alias tcp="(tree -a -I 'node_modules|objects|*.log|target|build|dist|*.lock|Pods|.DS_Store|.next|.git|__tests__|screenshots|downloads|cache|media|*.map|*.nft.json|chunks|webpack-runtime.js|public' -L 6; tree -a -I 'node_modules|*.log|target|build|dist|*.lock|Pods|.DS_Store|*.map' .github/workflows) | pbcopy" + + +alias .="nvim" +alias zshconfig="nvim ~/.zshrc" + +# Git aliases +alias gs="git status" +alias ga="git add ." +alias gc="git commit -m" +alias gca="git commit --amend --no-edit" +alias gcb="git checkout -b" +alias gp='if ! git config remote.origin.url > /dev/null; then git remote add origin git@github.com:yourusername/trustystack-frontend.git; fi; git push origin $(git symbolic-ref --short HEAD)' +alias gg='git checkout -' +alias gcm='git checkout main' +alias br='git branch -a' +alias so='source ~/.zshrc' +alias gr='git restore --staged .' +alias go='npx expo start' +alias gpull='git pull' +alias gogo='RUST_LOG=debug cargo run' +alias dcu='docker compose up' +alias dcub='(cd ~/Code/infra/cicd/pipelines/ && make dev-run)' +alias rtest='RUST_BACKTRACE=full cargo test -- --nocapture' +alias devrun='~/Code/dev_workflow/dev_run_tmux.sh*' +alias zrc='. ~/.zshrc' +alias vrc='cd ~/.config/nvim && .' +alias gpf='gp --force' +alias gpfa='ga && gca && gpf' +alias migrate='diesel migration run' + +# Trustystack nav +alias cdp='cd ~/Code/backend/python/parts' +alias cdr='cd ~/Code/backend/rust' +alias cdd='cd ~/Code/data/database' +alias cddoc='cd ~/Code/docs' +alias cdn='cd ~/Code/frontend/native' +alias cdw='cd ~/Code/frontend/web' +alias cdci='cd ~/Code/infra/cicd' +alias cdm='cd ~/Code' +alias kill-dev='pgrep -f "rust-backend" | xargs kill && tmux kill-session -t dev_session' +alias drev='diesel migration revert --all' +alias drun='diesel migration run' +alias stash='git stash' +alias pop='git stash pop' + + + + + +# Function to print Trustystack navigation aliases +alias nav='echo "Trustystack Navigation: +cdp -> ~/Code/backend/python/parts +cdr -> ~/Code/backend/rust +cdd -> ~/Code/data/database +cddoc -> ~/Code/docs +cdn -> ~/Code/frontend/native +cdw -> ~/Code/frontend/web +cdci -> ~/Code/infra/cicd"' + + + +# ruby +export PATH="$HOME/.rbenv/bin:$PATH" +eval "$(rbenv init -)" + +# NVM setup +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + +# Load Angular CLI autocompletion asynchronously +async_job async_worker source <(ng completion script) + diff --git a/nvim_configs b/nvim_configs deleted file mode 160000 index 89ac751..0000000 --- a/nvim_configs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 89ac751627beb4ed019bae7026e44e021a5b6018 diff --git a/nvim_configs_test/.gitignore b/nvim_configs_test/.gitignore deleted file mode 100644 index 6b3503f..0000000 --- a/nvim_configs_test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -plugin/packer_compiled.lua - diff --git a/nvim_configs_test/README.md b/nvim_configs_test/README.md deleted file mode 100644 index aa3823b..0000000 --- a/nvim_configs_test/README.md +++ /dev/null @@ -1,18 +0,0 @@ -### ThePrimeagen's init.lua -Prerequisite: install [ripgrep](https://github.com/BurntSushi/ripgrep). - -[The full video of me setting up this repo](https://www.youtube.com/watch?v=w7i4amO_zaE) - -For anyone that is interested in my vimrc, i will have a commit log below -documenting each one of my commits (easy to C-f the change you want to know -about though i would just suggest `git log -S`). - -### Change Log -* [33eee9ad](https://github.com/ThePrimeagen/init.lua/commit/33eee9ad0c035a92137d99dae06a2396be4c892e) initial commits -* [cb210006](https://github.com/ThePrimeagen/init.lua/commit/cb210006356b4b613b71c345cb2b02eefa961fc0) netrw, autogroups for yank highlighting, and auto remove whitespace -* [c8c0bf4a](https://github.com/ThePrimeagen/init.lua/commit/c8c0bf4aeacd0bd77136d9c5ee490680515a106b) zenmode. i really like this plugin -* [81c770d2](https://github.com/ThePrimeagen/init.lua/commit/81c770d2d2e32e59916b39c7f5babbc8560f7a82) copilot testing -* [4a96e645](https://github.com/ThePrimeagen/init.lua/commit/4a96e6457b0a0241ca7361ce62177aa6b9a33a38) fugitive mappings for push and pull -* [a3bad06a](https://github.com/ThePrimeagen/init.lua/commit/a3bad06a4681c322538d609aa1c0bd18880f77c6) disabled eslint. driving me crazy - - diff --git a/nvim_configs_test/init.lua b/nvim_configs_test/init.lua deleted file mode 100644 index a39d9f1..0000000 --- a/nvim_configs_test/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require("theprimeagen") - diff --git a/nvim_configs_test/lazy-lock.json b/nvim_configs_test/lazy-lock.json deleted file mode 100644 index d3696c2..0000000 --- a/nvim_configs_test/lazy-lock.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "brightburn.vim": { "branch": "master", "commit": "fc0d2fafc51e86d6065acd54b5e82e686019ff2f" }, - "cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" }, - "cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, - "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "gruvbox": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, - "hererocks": { "branch": "master", "commit": "8bd2fcfdd65cfa7535ce39ea372a63b0bdb8e528" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-lspconfig": { "branch": "master", "commit": "fdc44768a09a65140aa00c92872a5381ad486485" }, - "nvim-treesitter": { "branch": "master", "commit": "9f8c99e980f55e72148a95a0fb2e260c95f6341b" }, - "plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "rose-pine": { "branch": "main", "commit": "e4b08d74b7272cb21e4e9c71b8b9e0830fd722fe" }, - "schemastore.nvim": { "branch": "main", "commit": "bb73383589c0aab431a100a014eed6cb0e1b3832" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, - "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, - "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, - "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" }, - "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" } -} diff --git a/nvim_configs_test/lua/theprimeagen/init.lua b/nvim_configs_test/lua/theprimeagen/init.lua deleted file mode 100644 index 8d2ce94..0000000 --- a/nvim_configs_test/lua/theprimeagen/init.lua +++ /dev/null @@ -1,70 +0,0 @@ -require("theprimeagen.set") -require("theprimeagen.remap") -require("theprimeagen.lazy_init") - --- DO.not --- DO NOT INCLUDE THIS - --- If i want to keep doing lsp debugging --- function restart_htmx_lsp() --- require("lsp-debug-tools").restart({ expected = {}, name = "htmx-lsp", cmd = { "htmx-lsp", "--level", "DEBUG" }, root_dir = vim.loop.cwd(), }); --- end - --- DO NOT INCLUDE THIS --- DO.not - -local augroup = vim.api.nvim_create_augroup -local ThePrimeagenGroup = augroup('ThePrimeagen', {}) - -local autocmd = vim.api.nvim_create_autocmd -local yank_group = augroup('HighlightYank', {}) - -function R(name) - require("plenary.reload").reload_module(name) -end - -vim.filetype.add({ - extension = { - templ = 'templ', - } -}) - -autocmd('TextYankPost', { - group = yank_group, - pattern = '*', - callback = function() - vim.highlight.on_yank({ - higroup = 'IncSearch', - timeout = 40, - }) - end, -}) - -autocmd({"BufWritePre"}, { - group = ThePrimeagenGroup, - pattern = "*", - command = [[%s/\s\+$//e]], -}) - -autocmd('LspAttach', { - group = ThePrimeagenGroup, - callback = function(e) - local opts = { buffer = e.buf } - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) - vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) - vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - end -}) - -vim.g.netrw_browse_split = 0 -vim.g.netrw_banner = 0 -vim.g.netrw_winsize = 25 -vim.cmd([[colorscheme gruvbox]]) - diff --git a/nvim_configs_test/lua/theprimeagen/lazy/cloak.lua b/nvim_configs_test/lua/theprimeagen/lazy/cloak.lua deleted file mode 100644 index 2dd083f..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/cloak.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "laytan/cloak.nvim", - config = function() - require("cloak").setup({ - enabled = true, - cloak_character = "*", - -- The applied highlight group (colors) on the cloaking, see `:h highlight`. - highlight_group = "Comment", - patterns = { - { - -- Match any file starting with ".env". - -- This can be a table to match multiple file patterns. - file_pattern = { - ".env*", - "wrangler.toml", - ".dev.vars", - }, - -- Match an equals sign and any character after it. - -- This can also be a table of patterns to cloak, - -- example: cloak_pattern = { ":.+", "-.+" } for yaml files. - cloak_pattern = "=.+" - }, - }, - }) - end -} diff --git a/nvim_configs_test/lua/theprimeagen/lazy/colors.lua b/nvim_configs_test/lua/theprimeagen/lazy/colors.lua deleted file mode 100644 index b607bb8..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/colors.lua +++ /dev/null @@ -1,89 +0,0 @@ -function ColorMyPencils(color) - color = color or "rose-pine-moon" - vim.cmd.colorscheme(color) - - vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) -end - -return { - - { - "erikbackman/brightburn.vim", - }, - - { - "folke/tokyonight.nvim", - lazy = false, - opts = {}, - config = function() - ColorMyPencils() - end - }, - { - "ellisonleao/gruvbox.nvim", - name = "gruvbox", - config = function() - require("gruvbox").setup({ - terminal_colors = true, -- add neovim terminal colors - undercurl = true, - underline = false, - bold = true, - italic = { - strings = false, - emphasis = false, - comments = false, - operators = false, - folds = false, - }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "", -- can be "hard", "soft" or empty string - palette_overrides = {}, - overrides = {}, - dim_inactive = false, - transparent_mode = false, - }) - end, - }, - { - "folke/tokyonight.nvim", - config = function() - require("tokyonight").setup({ - -- your configuration comes here - -- or leave it empty to use the default settings - style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` - transparent = true, -- Enable this to disable setting the background color - terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim - styles = { - -- Style to be applied to different syntax groups - -- Value is any valid attr-list value for `:help nvim_set_hl` - comments = { italic = false }, - keywords = { italic = false }, - -- Background styles. Can be "dark", "transparent" or "normal" - sidebars = "dark", -- style for sidebars, see below - floats = "dark", -- style for floating windows - }, - }) - end - }, - - { - "rose-pine/neovim", - name = "rose-pine", - config = function() - require('rose-pine').setup({ - disable_background = true, - styles = { - italic = false, - }, - }) - end - }, - - -} diff --git a/nvim_configs_test/lua/theprimeagen/lazy/fugitive.lua b/nvim_configs_test/lua/theprimeagen/lazy/fugitive.lua deleted file mode 100644 index e02ccfa..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/fugitive.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", vim.cmd.Git) - - local ThePrimeagen_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {}) - - local autocmd = vim.api.nvim_create_autocmd - autocmd("BufWinEnter", { - group = ThePrimeagen_Fugitive, - pattern = "*", - callback = function() - if vim.bo.ft ~= "fugitive" then - return - end - - local bufnr = vim.api.nvim_get_current_buf() - local opts = {buffer = bufnr, remap = false} - vim.keymap.set("n", "k", function() - vim.cmd.Git('push') - end, opts) - - -- rebase always - vim.keymap.set("n", "K", function() - vim.cmd.Git({'pull', '--rebase'}) - end, opts) - - -- NOTE: It allows me to easily set the branch i am pushing and any tracking - -- needed if i did not set the branch up correctly - -- vim.keymap.set("n", "", ":Git push -u origin ", opts); - end, - }) - - - vim.keymap.set("n", "gu", "diffget //2") - vim.keymap.set("n", "gh", "diffget //3") - end -} diff --git a/nvim_configs_test/lua/theprimeagen/lazy/init.lua b/nvim_configs_test/lua/theprimeagen/lazy/init.lua deleted file mode 100644 index 77c2158..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/init.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - - { - "nvim-lua/plenary.nvim", - name = "plenary" - }, - - "eandrju/cellular-automaton.nvim", -} - diff --git a/nvim_configs_test/lua/theprimeagen/lazy/lsp.lua b/nvim_configs_test/lua/theprimeagen/lazy/lsp.lua deleted file mode 100644 index 28ef692..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/lsp.lua +++ /dev/null @@ -1,238 +0,0 @@ --- lsp.lua -return { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - --"L3MON4D3/LuaSnip", - --"saadparwaiz1/cmp_luasnip", - 'hrsh7th/cmp-vsnip', - 'hrsh7th/vim-vsnip', - "j-hui/fidget.nvim", - "b0o/schemastore.nvim", -- Add this line to include schemastore - }, - - config = function() - local cmp = require('cmp') - local luasnip = require 'luasnip' - local cmp_lsp = require("cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - cmp_lsp.default_capabilities()) - - require("fidget").setup({}) - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "rust_analyzer", - "tsserver", - "sqlls", - "jsonls", - "angularls", - "clangd", - "html", - }, - handlers = { - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end, - - zls = function() - local lspconfig = require("lspconfig") - lspconfig.zls.setup({ - root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), - settings = { - zls = { - enable_inlay_hints = true, - enable_snippets = true, - warn_style = true, - }, - }, - }) - vim.g.zig_fmt_parse_errors = 0 - vim.g.zig_fmt_autosave = 0 - end, - ["lua_ls"] = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup { - capabilities = capabilities, - settings = { - Lua = { - runtime = { version = "Lua 5.1" }, - diagnostics = { - globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, - } - } - } - } - end, - ["html"] = function() - local lspconfig = require("lspconfig") - lspconfig.html.setup { - capabilities = capabilities, - } - end, - ["tsserver"] = function() - local lspconfig = require("lspconfig") - lspconfig.tsserver.setup { - capabilities = capabilities, - settings = { - typescript = { - enable_inlay_hints = true, - enable_snippets = true, - warn_style = true, - inlayHints = { - parameterNames = { - enabled = "all", - }, - parameterTypes = { enabled = true }, - variableTypes = { enabled = true }, - propertyDeclarationTypes = { enabled = true }, - functionLikeReturnTypes = { enabled = true }, - enumMemberValues = { enabled = true }, - }, - }, - }, - } - end, - ["rust_analyzer"] = function() - local lspconfig = require("lspconfig") - lspconfig.rust_analyzer.setup { - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - assist = { - importGranularity = "module", - importPrefix = "by_self", - }, - cargo = { - allFeatures = true, - }, - checkOnSave = { - command = "clippy", - }, - } - } - } - end, - ["sqlls"] = function() - local lspconfig = require("lspconfig") - lspconfig.sqlls.setup { - capabilities = capabilities, - settings = { - sql = { - connections = { - { - driver = "postgres", - dataSourceName = "host=localhost port=5432 user=myuser password=mypassword dbname=mydb sslmode=disable", - }, - }, - }, - }, - } - end, - ["jsonls"] = function() - local lspconfig = require("lspconfig") - lspconfig.jsonls.setup { - capabilities = capabilities, - settings = { - json = { - schemas = require('schemastore').json.schemas(), - validate = { enable = true }, - }, - }, - } - end, - ["angularls"] = function() - local lspconfig = require("lspconfig") - lspconfig.angularls.setup { - capabilities = capabilities, - root_dir = lspconfig.util.root_pattern("angular.json"), - } - end, - ["clangd"] = function() - local lspconfig = require("lspconfig") - lspconfig.clangd.setup { - capabilities = capabilities, - filetypes = { "swift", "c", "cpp", "objective-c", "objective-cpp" }, - root_dir = lspconfig.util.root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", "compile_commands.json", "Package.swift", ".git"), - } - end,} - }) - - local cmp_select = { behavior = cmp.SelectBehavior.Select } - - cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.select_prev_item(cmp_select), - [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - if luasnip.expandable() then - luasnip.expand() - else - cmp.confirm({ - select = true, - }) - end - else - fallback() - end - end), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.locally_jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - --{ name = 'luasnip' }, - { name = 'vsnip' }, - }, { - { name = 'buffer' }, - }) - }) - - vim.diagnostic.config({ - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - }) - end -} - diff --git a/nvim_configs_test/lua/theprimeagen/lazy/snippets.lua b/nvim_configs_test/lua/theprimeagen/lazy/snippets.lua deleted file mode 100644 index f90d8f0..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/snippets.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "L3MON4D3/LuaSnip", - version = "v2.*", - build = "make install_jsregexp", - dependencies = { "rafamadriz/friendly-snippets" }, - - config = function() - local ls = require("luasnip") - ls.filetype_extend("javascript", { "jsdoc" }) - ls.filetype_extend("typescript", { "tsx" }) - ls.filetype_extend("html", { "tsx" }) - - vim.keymap.set({"i"}, "e", function() ls.expand() end, {silent = true}) - vim.keymap.set({"i", "s"}, ";", function() ls.jump(1) end, {silent = true}) - vim.keymap.set({"i", "s"}, ",", function() ls.jump(-1) end, {silent = true}) - vim.keymap.set({"i", "s"}, "", function() - if ls.choice_active() then - ls.change_choice(1) - end - end, {silent = true}) - end, - } -} - diff --git a/nvim_configs_test/lua/theprimeagen/lazy/telescope.lua b/nvim_configs_test/lua/theprimeagen/lazy/telescope.lua deleted file mode 100644 index 5b720fa..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/telescope.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - - tag = "0.1.5", - - dependencies = { - "nvim-lua/plenary.nvim" - }, - - config = function() - require('telescope').setup({}) - - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'pf', builtin.find_files, {}) - vim.keymap.set('n', 'pa', builtin.git_files, {}) - vim.keymap.set('n', 'pw', function() - local word = vim.fn.expand("") - builtin.grep_string({ search = word }) - end) - vim.keymap.set('n', 'pWs', function() - local word = vim.fn.expand("") - builtin.grep_string({ search = word }) - end) - vim.keymap.set('n', 'f', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) - end) - vim.keymap.set('n', 'pg', builtin.live_grep, {}) - vim.keymap.set('n', 'vh', builtin.help_tags, {}) - end -} diff --git a/nvim_configs_test/lua/theprimeagen/lazy/treesitter.lua b/nvim_configs_test/lua/theprimeagen/lazy/treesitter.lua deleted file mode 100644 index 32ec9ee..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/treesitter.lua +++ /dev/null @@ -1,49 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - -- A list of parser names, or "all" - ensure_installed = { - "vimdoc", "javascript", "typescript", "c", "lua", "rust", - "jsdoc", "bash", "html", "tsx", "css" - }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally - auto_install = true, - - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on "syntax" being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = { "markdown" }, - }, - autotag = { - enable = true, - filetypes = { - 'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx', 'rescript', - 'css', 'lua', 'xml', 'php', 'markdown' - }, - }, - }) - - local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() - treesitter_parser_config.templ = { - install_info = { - url = "https://github.com/vrischmann/tree-sitter-templ.git", - files = {"src/parser.c", "src/scanner.c"}, - branch = "master", - }, - } - - vim.treesitter.language.register("templ", "templ") - end -} diff --git a/nvim_configs_test/lua/theprimeagen/lazy/trouble.lua b/nvim_configs_test/lua/theprimeagen/lazy/trouble.lua deleted file mode 100644 index b3c8b0a..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/trouble.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "folke/trouble.nvim", - config = function() - require("trouble").setup({ - icons = false, - }) - - vim.keymap.set("n", "o", function() - require("trouble").toggle() - end) - - vim.keymap.set("n", "[t", function() - require("trouble").next({skip_groups = true, jump = true}); - end) - - vim.keymap.set("n", "]t", function() - require("trouble").previous({skip_groups = true, jump = true}); - end) - - end - }, -} diff --git a/nvim_configs_test/lua/theprimeagen/lazy/undotree.lua b/nvim_configs_test/lua/theprimeagen/lazy/undotree.lua deleted file mode 100644 index 020848c..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/undotree.lua +++ /dev/null @@ -1,9 +0,0 @@ - -return { - "mbbill/undotree", - - config = function() - vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) - end -} - diff --git a/nvim_configs_test/lua/theprimeagen/lazy/vimbegood.lua b/nvim_configs_test/lua/theprimeagen/lazy/vimbegood.lua deleted file mode 100644 index 8338dd5..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/vimbegood.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "theprimeagen/vim-be-good", - - dependencies = { - "nvim-lua/plenary.nvim" - }, - - config = function() - end -} - - diff --git a/nvim_configs_test/lua/theprimeagen/lazy/zenmode.lua b/nvim_configs_test/lua/theprimeagen/lazy/zenmode.lua deleted file mode 100644 index 3b20707..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy/zenmode.lua +++ /dev/null @@ -1,37 +0,0 @@ - -return { - "folke/zen-mode.nvim", - config = function() - vim.keymap.set("n", "zz", function() - require("zen-mode").setup { - window = { - width = 90, - options = { } - }, - } - require("zen-mode").toggle() - vim.wo.wrap = false - vim.wo.number = true - vim.wo.rnu = true - ColorMyPencils() - end) - - - vim.keymap.set("n", "zZ", function() - require("zen-mode").setup { - window = { - width = 80, - options = { } - }, - } - require("zen-mode").toggle() - vim.wo.wrap = false - vim.wo.number = false - vim.wo.rnu = false - vim.opt.colorcolumn = "0" - ColorMyPencils() - end) - end -} - - diff --git a/nvim_configs_test/lua/theprimeagen/lazy_init.lua b/nvim_configs_test/lua/theprimeagen/lazy_init.lua deleted file mode 100644 index 1c50d52..0000000 --- a/nvim_configs_test/lua/theprimeagen/lazy_init.lua +++ /dev/null @@ -1,17 +0,0 @@ -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("lazy").setup({ - spec = "theprimeagen.lazy", - change_detection = { notify = false } -}) diff --git a/nvim_configs_test/lua/theprimeagen/remap.lua b/nvim_configs_test/lua/theprimeagen/remap.lua deleted file mode 100644 index 5b8e4d1..0000000 --- a/nvim_configs_test/lua/theprimeagen/remap.lua +++ /dev/null @@ -1,77 +0,0 @@ -vim.g.mapleader = " " -vim.keymap.set("n", "t", function() vim.cmd("Ex") end) -vim.keymap.set("n", "q", ":qa") -vim.keymap.set("n", "q", - [[lua if #vim.api.nvim_list_wins() > 1 then vim.cmd('close') else vim.cmd('qa') end]]) -vim.keymap.set("n", "l", "l") -vim.keymap.set("n", "h", "h") - --- Mapping leader v followed by l to split to the left -vim.keymap.set("n", "vl", [[vertical leftabove splitw]]) - - -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") - -vim.keymap.set("n", "J", "mzJ`z") -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "n", "nzzzv") -vim.keymap.set("n", "N", "Nzzzv") -vim.keymap.set("n", "zig", "LspRestart") - ---vim.keymap.set("n", "vwm", function() --- require("vim-with-me").StartVimWithMe() ---end) ---vim.keymap.set("n", "svwm", function() --- require("vim-with-me").StopVimWithMe() ---end) - --- greatest remap ever -vim.keymap.set("x", "p", [["_dP]]) - --- next greatest remap ever : asbjornHaland -vim.keymap.set({ "n", "v" }, "y", [["+y]]) -vim.keymap.set("n", "Y", [["+Y]]) - -vim.keymap.set({ "n", "v" }, "d", [["_d]]) - --- This is going to get me cancelled -vim.keymap.set("i", "", "") - -vim.keymap.set("n", "Q", "") -vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") -vim.keymap.set("n", "f", vim.lsp.buf.format) - ---vim.keymap.set("n", "", "cnextzz") ---vim.keymap.set("n", "", "cprevzz") ---vim.keymap.set("n", "k", "lnextzz") ---vim.keymap.set("n", "j", "lprevzz") - -vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) -vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) - -vim.keymap.set( - "n", - "ee", - "oif err != nil {}Oreturn err" -) - -vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); -vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); - -vim.keymap.set("n", "", function() - vim.cmd("so") -end) - --- Yank into system clipboard -vim.keymap.set({ 'n', 'v' }, 'y', '"+y') -- yank motion -vim.keymap.set({ 'n', 'v' }, 'Y', '"+Y') -- yank line - --- Delete into system clipboard -vim.keymap.set({ 'n', 'v' }, 'd', '"+d') -- delete motion -vim.keymap.set({ 'n', 'v' }, 'D', '"+D') -- delete line - --- Paste from system clipboard -vim.keymap.set('n', 'p', '"+p') -- paste after cursor -vim.keymap.set('n', 'P', '"+P') -- paste before cursor diff --git a/nvim_configs_test/lua/theprimeagen/set.lua b/nvim_configs_test/lua/theprimeagen/set.lua deleted file mode 100644 index 18acbf1..0000000 --- a/nvim_configs_test/lua/theprimeagen/set.lua +++ /dev/null @@ -1,32 +0,0 @@ -vim.opt.guicursor = "" - -vim.opt.nu = true -vim.opt.relativenumber = true - -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true - -vim.opt.smartindent = true - -vim.opt.wrap = false - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true - -vim.opt.hlsearch = false -vim.opt.incsearch = true - -vim.opt.termguicolors = true - -vim.opt.scrolloff = 8 -vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") - -vim.opt.updatetime = 50 - -vim.opt.colorcolumn = "80" - diff --git a/zshrc b/zshrc deleted file mode 100644 index 207103f..0000000 --- a/zshrc +++ /dev/null @@ -1,59 +0,0 @@ -# Source zsh-async -source "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-async/async.zsh" - -# Initialize async worker -async_init -async_start_worker async_worker -n - -# Callback function to handle the result of compinit -async_register_callback async_worker handle_compinit() { - # Actions after compinit, if needed -} - -# Load compinit asynchronously -async_job async_worker compinit -C - -# Path to your Oh My Zsh installation -export ZSH="$HOME/.oh-my-zsh" - -# Set theme and plugins -ZSH_THEME="crunch" -DISABLE_AUTO_UPDATE="true" -plugins=(git) - -# Export PATH -export PATH="$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH:$HOME/.yarn-global/bin" - -# Load Oh My Zsh -source $ZSH/oh-my-zsh.sh - -# Custom Aliases -alias hg="history | grep" -alias tcp="tree -I 'node_modules|.git|*.log|target|build|dist|*.lock|Pods' -L 3 | pbcopy" -alias .="nvim" -alias zshconfig="nvim ~/.zshrc" - -# Git aliases -alias gs="git status" -alias ga="git add ." -alias gc="git commit -m" -alias gca="git commit --amend --no-edit" -alias gcb="git checkout -b" -alias gp='if ! git config remote.origin.url > /dev/null; then git remote add origin git@github.com:yourusername/trustystack-frontend.git; fi; git push origin $(git symbolic-ref --short HEAD)' -alias gg='git checkout -' -alias gcm='git checkout main' -alias br='git branch -a' -alias so='source ~/.zshrc' - -# ruby -export PATH="$HOME/.rbenv/bin:$PATH" -eval "$(rbenv init -)" - -# NVM setup -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -# Load Angular CLI autocompletion asynchronously -async_job async_worker source <(ng completion script) - From 40081c78f9bbb0ca374b10dd65fdf323ca7c4c78 Mon Sep 17 00:00:00 2001 From: Blake Donnelly Date: Mon, 10 Feb 2025 20:46:48 -0500 Subject: [PATCH 2/2] Remove submodule --- .DS_Store | Bin 0 -> 6148 bytes .zshrc | 96 +------ nvim | 1 - nvim/.gitignore | 2 + nvim/README.md | 18 ++ nvim/init.lua | 2 + nvim/lazy-lock.json | 36 +++ nvim/lua/theprimeagen/init.lua | 113 ++++++++ nvim/lua/theprimeagen/lazy/cloak.lua | 26 ++ nvim/lua/theprimeagen/lazy/colors.lua | 89 +++++++ nvim/lua/theprimeagen/lazy/fugitive.lua | 38 +++ nvim/lua/theprimeagen/lazy/harpoon.lua | 5 + nvim/lua/theprimeagen/lazy/init.lua | 10 + nvim/lua/theprimeagen/lazy/lexima.lua | 3 + nvim/lua/theprimeagen/lazy/lsp.lua | 258 +++++++++++++++++++ nvim/lua/theprimeagen/lazy/luasnip.lua | 24 ++ nvim/lua/theprimeagen/lazy/rustaceannvim.lua | 5 + nvim/lua/theprimeagen/lazy/telescope.lua | 44 ++++ nvim/lua/theprimeagen/lazy/treesitter.lua | 50 ++++ nvim/lua/theprimeagen/lazy/trouble.lua | 23 ++ nvim/lua/theprimeagen/lazy/undotree.lua | 9 + nvim/lua/theprimeagen/lazy/vimbegood.lua | 12 + nvim/lua/theprimeagen/lazy/zenmode.lua | 37 +++ nvim/lua/theprimeagen/lazy_init.lua | 17 ++ nvim/lua/theprimeagen/remap.lua | 91 +++++++ nvim/lua/theprimeagen/set.lua | 34 +++ 26 files changed, 956 insertions(+), 87 deletions(-) create mode 100644 .DS_Store delete mode 160000 nvim create mode 100644 nvim/.gitignore create mode 100644 nvim/README.md create mode 100644 nvim/init.lua create mode 100644 nvim/lazy-lock.json create mode 100644 nvim/lua/theprimeagen/init.lua create mode 100644 nvim/lua/theprimeagen/lazy/cloak.lua create mode 100644 nvim/lua/theprimeagen/lazy/colors.lua create mode 100644 nvim/lua/theprimeagen/lazy/fugitive.lua create mode 100644 nvim/lua/theprimeagen/lazy/harpoon.lua create mode 100644 nvim/lua/theprimeagen/lazy/init.lua create mode 100644 nvim/lua/theprimeagen/lazy/lexima.lua create mode 100644 nvim/lua/theprimeagen/lazy/lsp.lua create mode 100644 nvim/lua/theprimeagen/lazy/luasnip.lua create mode 100644 nvim/lua/theprimeagen/lazy/rustaceannvim.lua create mode 100644 nvim/lua/theprimeagen/lazy/telescope.lua create mode 100644 nvim/lua/theprimeagen/lazy/treesitter.lua create mode 100644 nvim/lua/theprimeagen/lazy/trouble.lua create mode 100644 nvim/lua/theprimeagen/lazy/undotree.lua create mode 100644 nvim/lua/theprimeagen/lazy/vimbegood.lua create mode 100644 nvim/lua/theprimeagen/lazy/zenmode.lua create mode 100644 nvim/lua/theprimeagen/lazy_init.lua create mode 100644 nvim/lua/theprimeagen/remap.lua create mode 100644 nvim/lua/theprimeagen/set.lua diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..bab25edc45c78d6464bcb7bae16bda1051ed9ec6 GIT binary patch literal 6148 zcmeH~K?=e^3`G;|qTr@Wm$UHz-e3?tK`-D!5J4*lc0EV;Clds#YZ3W@ zh=^|PhqXv2A}!ohRu(3v$Qv1Cl#^V>{x+Pi!x1&B&*H4D;hjwOW1B((BtQZrKmsK2 zLj>&JhP8{Tj3ht;B=96)--iS@&7q~Le>xC+1b{XuyJ79K1T}(S!u1*@b}wNMJ%>Uh~fG{~i3({6A@7N&+PC zX9Tp__S+3!D(=>|*R%RQsV!Z literal 0 HcmV?d00001 diff --git a/.zshrc b/.zshrc index 107d00a..4693430 100644 --- a/.zshrc +++ b/.zshrc @@ -1,50 +1,3 @@ -# Source zsh-async -source "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-async/async.zsh" - -# Initialize async worker -async_init -async_start_worker async_worker -n - -# Callback function to handle the result of compinit -async_register_callback async_worker handle_compinit() { - # Actions after compinit, if needed -} - -# Load compinit asynchronously -async_job async_worker compinit -C - -# Path to your Oh My Zsh installation -export ZSH="$HOME/.oh-my-zsh" - -# Set theme and plugins -ZSH_THEME="crunch" -DISABLE_AUTO_UPDATE="true" -plugins=(git) - -# Export PATH -export PATH="$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH:$HOME/.yarn-global/bin" - -# Load Oh My Zsh -source $ZSH/oh-my-zsh.sh - -function git_prepare_commit() { - # Pull the latest changes from the main branch of the main repo - git pull origin main - - # Update submodules, initialize if needed, and pull from main branch for each - git submodule update --init --recursive - git submodule foreach --recursive 'git checkout main && git pull origin main' - - # Stage all changes - git add . - - # Commit with the provided message - git commit -m "$1" - - echo "Main repo and submodules updated and committed with message: '$1'" -} - - # Custom Aliases alias hg="history | grep" alias tcp="(tree -a -I 'node_modules|objects|*.log|target|build|dist|*.lock|Pods|.DS_Store|.next|.git|__tests__|screenshots|downloads|cache|media|*.map|*.nft.json|chunks|webpack-runtime.js|public' -L 6; tree -a -I 'node_modules|*.log|target|build|dist|*.lock|Pods|.DS_Store|*.map' .github/workflows) | pbcopy" @@ -69,9 +22,9 @@ alias go='npx expo start' alias gpull='git pull' alias gogo='RUST_LOG=debug cargo run' alias dcu='docker compose up' -alias dcub='(cd ~/Code/infra/cicd/pipelines/ && make dev-run)' +alias dcub='(cd ~/code/infra/cicd/pipelines/ && make dev-run)' alias rtest='RUST_BACKTRACE=full cargo test -- --nocapture' -alias devrun='~/Code/dev_workflow/dev_run_tmux.sh*' +alias devrun='~/code/dev_workflow/dev_run_tmux.sh*' alias zrc='. ~/.zshrc' alias vrc='cd ~/.config/nvim && .' alias gpf='gp --force' @@ -79,45 +32,16 @@ alias gpfa='ga && gca && gpf' alias migrate='diesel migration run' # Trustystack nav -alias cdp='cd ~/Code/backend/python/parts' -alias cdr='cd ~/Code/backend/rust' -alias cdd='cd ~/Code/data/database' -alias cddoc='cd ~/Code/docs' -alias cdn='cd ~/Code/frontend/native' -alias cdw='cd ~/Code/frontend/web' -alias cdci='cd ~/Code/infra/cicd' -alias cdm='cd ~/Code' +alias cdp='cd ~/code/backend/python/parts' +alias cdr='cd ~/code/backend/rust' +alias cdd='cd ~/code/data/database' +alias cddoc='cd ~/code/docs' +alias cdn='cd ~/code/frontend/native' +alias cdw='cd ~/code/frontend/web' +alias cdci='cd ~/code/infra/cicd' +alias cdm='cd ~/code' alias kill-dev='pgrep -f "rust-backend" | xargs kill && tmux kill-session -t dev_session' alias drev='diesel migration revert --all' alias drun='diesel migration run' alias stash='git stash' alias pop='git stash pop' - - - - - -# Function to print Trustystack navigation aliases -alias nav='echo "Trustystack Navigation: -cdp -> ~/Code/backend/python/parts -cdr -> ~/Code/backend/rust -cdd -> ~/Code/data/database -cddoc -> ~/Code/docs -cdn -> ~/Code/frontend/native -cdw -> ~/Code/frontend/web -cdci -> ~/Code/infra/cicd"' - - - -# ruby -export PATH="$HOME/.rbenv/bin:$PATH" -eval "$(rbenv init -)" - -# NVM setup -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - -# Load Angular CLI autocompletion asynchronously -async_job async_worker source <(ng completion script) - diff --git a/nvim b/nvim deleted file mode 160000 index e148c2c..0000000 --- a/nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e148c2cdfd54d6194ce57c856d1000d8c8111d4f diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..6b3503f --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1,2 @@ +plugin/packer_compiled.lua + diff --git a/nvim/README.md b/nvim/README.md new file mode 100644 index 0000000..aa3823b --- /dev/null +++ b/nvim/README.md @@ -0,0 +1,18 @@ +### ThePrimeagen's init.lua +Prerequisite: install [ripgrep](https://github.com/BurntSushi/ripgrep). + +[The full video of me setting up this repo](https://www.youtube.com/watch?v=w7i4amO_zaE) + +For anyone that is interested in my vimrc, i will have a commit log below +documenting each one of my commits (easy to C-f the change you want to know +about though i would just suggest `git log -S`). + +### Change Log +* [33eee9ad](https://github.com/ThePrimeagen/init.lua/commit/33eee9ad0c035a92137d99dae06a2396be4c892e) initial commits +* [cb210006](https://github.com/ThePrimeagen/init.lua/commit/cb210006356b4b613b71c345cb2b02eefa961fc0) netrw, autogroups for yank highlighting, and auto remove whitespace +* [c8c0bf4a](https://github.com/ThePrimeagen/init.lua/commit/c8c0bf4aeacd0bd77136d9c5ee490680515a106b) zenmode. i really like this plugin +* [81c770d2](https://github.com/ThePrimeagen/init.lua/commit/81c770d2d2e32e59916b39c7f5babbc8560f7a82) copilot testing +* [4a96e645](https://github.com/ThePrimeagen/init.lua/commit/4a96e6457b0a0241ca7361ce62177aa6b9a33a38) fugitive mappings for push and pull +* [a3bad06a](https://github.com/ThePrimeagen/init.lua/commit/a3bad06a4681c322538d609aa1c0bd18880f77c6) disabled eslint. driving me crazy + + diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..a39d9f1 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,2 @@ +require("theprimeagen") + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..fccdc91 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,36 @@ +{ + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "brightburn.vim": { "branch": "master", "commit": "fc0d2fafc51e86d6065acd54b5e82e686019ff2f" }, + "cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" }, + "cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "gruvbox": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" }, + "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, + "hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, + "lexima.vim": { "branch": "master", "commit": "f851b232505766aff7bed7d20100ad31c9c0b33b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, + "nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" }, + "nvim-treesitter": { "branch": "master", "commit": "622a4a6ba76d1de52b72a965159213ae655b4ac7" }, + "plenary": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "rose-pine": { "branch": "main", "commit": "66aabf210b5e736a3df5006648d4201016e05a2a" }, + "rustaceanvim": { "branch": "master", "commit": "0a1876b970ab946be3f4d341e9d743a5d62d646a" }, + "schemastore.nvim": { "branch": "main", "commit": "438f4f1f1fb890980cb23002597f99c9579834bd" }, + "telescope-luasnip.nvim": { "branch": "master", "commit": "07a2a2936a7557404c782dba021ac0a03165b343" }, + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" }, + "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, + "undotree": { "branch": "master", "commit": "2556c6800b210b2096b55b66e74b4cc1d9ebbe4f" }, + "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, + "vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" }, + "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } +} diff --git a/nvim/lua/theprimeagen/init.lua b/nvim/lua/theprimeagen/init.lua new file mode 100644 index 0000000..ff9512d --- /dev/null +++ b/nvim/lua/theprimeagen/init.lua @@ -0,0 +1,113 @@ +require("theprimeagen.set") +require("theprimeagen.remap") +require("theprimeagen.lazy_init") + +-- DO.not +-- DO NOT INCLUDE THIS + +-- If i want to keep doing lsp debugging +-- function restart_htmx_lsp() +-- require("lsp-debug-tools").restart({ expected = {}, name = "htmx-lsp", cmd = { "htmx-lsp", "--level", "DEBUG" }, root_dir = vim.loop.cwd(), }); +-- end + +-- DO NOT INCLUDE THIS +-- DO.not + +local augroup = vim.api.nvim_create_augroup +local ThePrimeagenGroup = augroup('ThePrimeagen', {}) + +local autocmd = vim.api.nvim_create_autocmd +local yank_group = augroup('HighlightYank', {}) + +function R(name) + require("plenary.reload").reload_module(name) +end + +vim.filetype.add({ + extension = { + templ = 'templ', + } +}) + +autocmd('TextYankPost', { + group = yank_group, + pattern = '*', + callback = function() + vim.highlight.on_yank({ + higroup = 'IncSearch', + timeout = 40, + }) + end, +}) + +autocmd({ "BufWritePre" }, { + group = ThePrimeagenGroup, + pattern = "*", + command = [[%s/\s\+$//e]], +}) + +autocmd('LspAttach', { + group = ThePrimeagenGroup, + callback = function(e) + local opts = { buffer = e.buf } + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float({ focusable = true }) end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + --vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + end +}) +-- 1 +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp", { clear = true }), + callback = function(args) + -- 2 + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = args.buf, + callback = function() + print("Formatting before save") + vim.lsp.buf.format { async = false, id = args.data.client_id } + end, + }) + end +}) + +vim.g.netrw_browse_split = 0 +vim.g.netrw_banner = 0 +vim.g.netrw_winsize = 25 +vim.cmd([[colorscheme gruvbox]]) + +local harpoon = require("harpoon") + +-- REQUIRED +harpoon:setup() + +-- basic telescope configuration +local conf = require("telescope.config").values +local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require("telescope.pickers").new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }):find() +end + +vim.keymap.set("n", "gl", function() toggle_telescope(harpoon:list()) end, + { desc = "Open harpoon window" }) + +vim.keymap.set("n", "gg", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) +vim.keymap.set("n", "ga", function() harpoon:list():add() end) +vim.keymap.set("n", "csn", function() harpoon:list():next() end) diff --git a/nvim/lua/theprimeagen/lazy/cloak.lua b/nvim/lua/theprimeagen/lazy/cloak.lua new file mode 100644 index 0000000..2dd083f --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/cloak.lua @@ -0,0 +1,26 @@ +return { + "laytan/cloak.nvim", + config = function() + require("cloak").setup({ + enabled = true, + cloak_character = "*", + -- The applied highlight group (colors) on the cloaking, see `:h highlight`. + highlight_group = "Comment", + patterns = { + { + -- Match any file starting with ".env". + -- This can be a table to match multiple file patterns. + file_pattern = { + ".env*", + "wrangler.toml", + ".dev.vars", + }, + -- Match an equals sign and any character after it. + -- This can also be a table of patterns to cloak, + -- example: cloak_pattern = { ":.+", "-.+" } for yaml files. + cloak_pattern = "=.+" + }, + }, + }) + end +} diff --git a/nvim/lua/theprimeagen/lazy/colors.lua b/nvim/lua/theprimeagen/lazy/colors.lua new file mode 100644 index 0000000..b607bb8 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/colors.lua @@ -0,0 +1,89 @@ +function ColorMyPencils(color) + color = color or "rose-pine-moon" + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + +return { + + { + "erikbackman/brightburn.vim", + }, + + { + "folke/tokyonight.nvim", + lazy = false, + opts = {}, + config = function() + ColorMyPencils() + end + }, + { + "ellisonleao/gruvbox.nvim", + name = "gruvbox", + config = function() + require("gruvbox").setup({ + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = false, + bold = true, + italic = { + strings = false, + emphasis = false, + comments = false, + operators = false, + folds = false, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }) + end, + }, + { + "folke/tokyonight.nvim", + config = function() + require("tokyonight").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` + transparent = true, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + comments = { italic = false }, + keywords = { italic = false }, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = "dark", -- style for sidebars, see below + floats = "dark", -- style for floating windows + }, + }) + end + }, + + { + "rose-pine/neovim", + name = "rose-pine", + config = function() + require('rose-pine').setup({ + disable_background = true, + styles = { + italic = false, + }, + }) + end + }, + + +} diff --git a/nvim/lua/theprimeagen/lazy/fugitive.lua b/nvim/lua/theprimeagen/lazy/fugitive.lua new file mode 100644 index 0000000..e02ccfa --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/fugitive.lua @@ -0,0 +1,38 @@ +return { + "tpope/vim-fugitive", + config = function() + vim.keymap.set("n", "gs", vim.cmd.Git) + + local ThePrimeagen_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {}) + + local autocmd = vim.api.nvim_create_autocmd + autocmd("BufWinEnter", { + group = ThePrimeagen_Fugitive, + pattern = "*", + callback = function() + if vim.bo.ft ~= "fugitive" then + return + end + + local bufnr = vim.api.nvim_get_current_buf() + local opts = {buffer = bufnr, remap = false} + vim.keymap.set("n", "k", function() + vim.cmd.Git('push') + end, opts) + + -- rebase always + vim.keymap.set("n", "K", function() + vim.cmd.Git({'pull', '--rebase'}) + end, opts) + + -- NOTE: It allows me to easily set the branch i am pushing and any tracking + -- needed if i did not set the branch up correctly + -- vim.keymap.set("n", "", ":Git push -u origin ", opts); + end, + }) + + + vim.keymap.set("n", "gu", "diffget //2") + vim.keymap.set("n", "gh", "diffget //3") + end +} diff --git a/nvim/lua/theprimeagen/lazy/harpoon.lua b/nvim/lua/theprimeagen/lazy/harpoon.lua new file mode 100644 index 0000000..b61681f --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/harpoon.lua @@ -0,0 +1,5 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" } +} diff --git a/nvim/lua/theprimeagen/lazy/init.lua b/nvim/lua/theprimeagen/lazy/init.lua new file mode 100644 index 0000000..77c2158 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/init.lua @@ -0,0 +1,10 @@ +return { + + { + "nvim-lua/plenary.nvim", + name = "plenary" + }, + + "eandrju/cellular-automaton.nvim", +} + diff --git a/nvim/lua/theprimeagen/lazy/lexima.lua b/nvim/lua/theprimeagen/lazy/lexima.lua new file mode 100644 index 0000000..3058902 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/lexima.lua @@ -0,0 +1,3 @@ +return { + "cohama/lexima.vim", +} diff --git a/nvim/lua/theprimeagen/lazy/lsp.lua b/nvim/lua/theprimeagen/lazy/lsp.lua new file mode 100644 index 0000000..eaf3f8c --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/lsp.lua @@ -0,0 +1,258 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + 'neovim/nvim-lspconfig', + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "saadparwaiz1/cmp_luasnip", + "L3MON4D3/LuaSnip", + "j-hui/fidget.nvim", + "b0o/schemastore.nvim", + }, + config = function() + local cmp = require('cmp') + local luasnip = require 'luasnip' + + local cmp_lsp = require("cmp_nvim_lsp") + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + cmp_lsp.default_capabilities() + ) + + require("fidget").setup({}) + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + --"rust_analyzer", + "ts_ls", + "sqlls", + "jsonls", + "angularls", + "clangd", + "html", + "pyright", + "biome", + }, + handlers = { + function(server_name) + require("lspconfig")[server_name].setup { + capabilities = capabilities + } + end, + zls = function() + local lspconfig = require("lspconfig") + lspconfig.zls.setup({ + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, + }) + vim.g.zig_fmt_parse_errors = 0 + vim.g.zig_fmt_autosave = 0 + end, + ["lua_ls"] = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup { + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "Lua 5.1" }, + diagnostics = { + globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, + } + } + } + } + end, + ["biome"] = function() + local lspconfig = require("lspconfig") + lspconfig.biome.setup({ + capabilities = capabilities, + root_dir = lspconfig.util.root_pattern("biome.json"), + single_file_support = true, + settings = { + biome = { + enable = true, + -- Lint on save + diagnostics = { + enable = true, + }, + -- Format on save + formatting = { + enable = true, + }, + }, + }, + }) + end, + ["html"] = function() + local lspconfig = require("lspconfig") + lspconfig.html.setup { + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "Lua 5.1" }, + diagnostics = { + globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, + } + } + } + } + end, + ["ts_ls"] = function() + local lspconfig = require("lspconfig") + local function filter(arr, fn) + if type(arr) ~= "table" then + return arr + end + + local filtered = {} + for k, v in pairs(arr) do + if fn(v, k, arr) then + table.insert(filtered, v) + end + end + + return filtered + end + + local function filterReactDTS(value) + return string.match(value.targetUri, '%.d.ts') == nil + end + lspconfig.ts_ls.setup { + handlers = { + ['textDocument/definition'] = function(err, result, method, ...) + if vim.tbl_islist(result) and #result > 1 then + local filtered_result = filter(result, filterReactDTS) + return vim.lsp.handlers['textDocument/definition'](err, filtered_result, method, ...) + end + + vim.lsp.handlers['textDocument/definition'](err, result, method, ...) + end + }, + capabilities = capabilities, + settings = { + typescript = { + enable_inlay_hints = true, + enable_snippets = true, + inlayHints = { + parameterNames = { + enabled = "all", + }, + parameterTypes = { enabled = true }, + variableTypes = { enabled = true }, + propertyDeclarationTypes = { enabled = true }, + functionLikeReturnTypes = { enabled = true }, + enumMemberValues = { enabled = true }, + }, + }, + }, + } + end, + ["rust_analyzer"] = function() end, + --["rust_analyzer"] = function() + -- local lspconfig = require("lspconfig") + -- lspconfig.rust_analyzer.setup { + -- capabilities = capabilities, + -- settings = { + -- ["rust-analyzer"] = { + -- formatting = { + -- enable = true, + -- formatOnType = false, + -- } + -- } + -- } + -- } + --end, + ["sqlls"] = function() + local lspconfig = require("lspconfig") + lspconfig.sqlls.setup { + capabilities = capabilities, + settings = { + sql = { + connections = { + { + driver = "postgres", + dataSourceName = "host=localhost port=5432 user=myuser password=mypassword dbname=mydb sslmode=disable", + }, + }, + }, + }, + } + end, + ["jsonls"] = function() + local lspconfig = require("lspconfig") + lspconfig.jsonls.setup { + capabilities = capabilities, + settings = { + json = { + schemas = require('schemastore').json.schemas(), + validate = { enable = true }, + }, + }, + } + end, + ["angularls"] = function() + local lspconfig = require("lspconfig") + lspconfig.angularls.setup { + capabilities = capabilities, + root_dir = lspconfig.util.root_pattern("angular.json"), + } + end, + ["clangd"] = function() + local lspconfig = require("lspconfig") + lspconfig.clangd.setup { + capabilities = capabilities, + filetypes = { "swift", "c", "cpp", "objective-c", "objective-cpp" }, + root_dir = lspconfig.util.root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", "compile_commands.json", "Package.swift", ".git"), + } + end, + } + }) + + local cmp_select = { behavior = cmp.SelectBehavior.Select } + + cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + }) + }) + + vim.diagnostic.config({ + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + }) + end +} diff --git a/nvim/lua/theprimeagen/lazy/luasnip.lua b/nvim/lua/theprimeagen/lazy/luasnip.lua new file mode 100644 index 0000000..b91542d --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/luasnip.lua @@ -0,0 +1,24 @@ +return { + "L3MON4D3/LuaSnip", + event = "LspAttach", + version = "v2.*", + build = "make install_jsregexp", + dependencies = { + "rafamadriz/friendly-snippets", + "benfowler/telescope-luasnip.nvim", + }, + config = function(_, opts) + if opts then require("luasnip").config.setup(opts) end + vim.tbl_map( + function(type) require("luasnip.loaders.from_" .. type).lazy_load() end, + { "vscode", "snipmate", "lua" } + ) + local ls = require("luasnip") + ls.filetype_extend("typescript", { "tsx" }) + ls.filetype_extend("typescriptreact", { "html" }) + ls.filetype_extend("html", { "typescriptreact" }) + ls.filetype_extend("typescript", { "tsdoc" }) + require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./snippets" } }) + end, +} diff --git a/nvim/lua/theprimeagen/lazy/rustaceannvim.lua b/nvim/lua/theprimeagen/lazy/rustaceannvim.lua new file mode 100644 index 0000000..82ee568 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/rustaceannvim.lua @@ -0,0 +1,5 @@ +return { + 'mrcjkb/rustaceanvim', + version = '^5', + lazy = false, +} diff --git a/nvim/lua/theprimeagen/lazy/telescope.lua b/nvim/lua/theprimeagen/lazy/telescope.lua new file mode 100644 index 0000000..f24c823 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/telescope.lua @@ -0,0 +1,44 @@ +return { + "nvim-telescope/telescope.nvim", + + tag = "0.1.5", + + dependencies = { + "nvim-lua/plenary.nvim" + }, + + config = function() + require('telescope').setup({ + file_ignore_patterns = { + "node_modules/.*", + "%.env", + "yarn.lock", + "package-lock.json", + "package%-lock.json", + "lazy-lock.json", + "init.sql", + "target/.*", + ".git/.*", + ".mod.rs*", + }, + }) + + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'gr', builtin.lsp_references, {}) + vim.keymap.set('n', 'pf', builtin.find_files, {}) + vim.keymap.set('n', 'pa', builtin.git_files, {}) + vim.keymap.set('n', 'pw', function() + local word = vim.fn.expand("") + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'pWs', function() + local word = vim.fn.expand("") + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'f', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end) + vim.keymap.set('n', 'pg', builtin.live_grep, {}) + vim.keymap.set('n', 'vh', builtin.help_tags, {}) + end +} diff --git a/nvim/lua/theprimeagen/lazy/treesitter.lua b/nvim/lua/theprimeagen/lazy/treesitter.lua new file mode 100644 index 0000000..ec93563 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/treesitter.lua @@ -0,0 +1,50 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = { + "vimdoc", "javascript", "typescript", "c", "lua", "rust", + "jsdoc", "bash", "html", "tsx", "css", "yaml" + }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on "syntax" being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = { "markdown" }, + }, + autotag = { + enable = true, + filetypes = { + 'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx', + 'rescript', + 'css', 'lua', 'xml', 'php', 'markdown', "yml" + }, + }, + }) + + local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() + treesitter_parser_config.templ = { + install_info = { + url = "https://github.com/vrischmann/tree-sitter-templ.git", + files = { "src/parser.c", "src/scanner.c" }, + branch = "master", + }, + } + + vim.treesitter.language.register("templ", "templ") + end +} diff --git a/nvim/lua/theprimeagen/lazy/trouble.lua b/nvim/lua/theprimeagen/lazy/trouble.lua new file mode 100644 index 0000000..b3c8b0a --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/trouble.lua @@ -0,0 +1,23 @@ +return { + { + "folke/trouble.nvim", + config = function() + require("trouble").setup({ + icons = false, + }) + + vim.keymap.set("n", "o", function() + require("trouble").toggle() + end) + + vim.keymap.set("n", "[t", function() + require("trouble").next({skip_groups = true, jump = true}); + end) + + vim.keymap.set("n", "]t", function() + require("trouble").previous({skip_groups = true, jump = true}); + end) + + end + }, +} diff --git a/nvim/lua/theprimeagen/lazy/undotree.lua b/nvim/lua/theprimeagen/lazy/undotree.lua new file mode 100644 index 0000000..020848c --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/undotree.lua @@ -0,0 +1,9 @@ + +return { + "mbbill/undotree", + + config = function() + vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + end +} + diff --git a/nvim/lua/theprimeagen/lazy/vimbegood.lua b/nvim/lua/theprimeagen/lazy/vimbegood.lua new file mode 100644 index 0000000..8338dd5 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/vimbegood.lua @@ -0,0 +1,12 @@ +return { + "theprimeagen/vim-be-good", + + dependencies = { + "nvim-lua/plenary.nvim" + }, + + config = function() + end +} + + diff --git a/nvim/lua/theprimeagen/lazy/zenmode.lua b/nvim/lua/theprimeagen/lazy/zenmode.lua new file mode 100644 index 0000000..3b20707 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy/zenmode.lua @@ -0,0 +1,37 @@ + +return { + "folke/zen-mode.nvim", + config = function() + vim.keymap.set("n", "zz", function() + require("zen-mode").setup { + window = { + width = 90, + options = { } + }, + } + require("zen-mode").toggle() + vim.wo.wrap = false + vim.wo.number = true + vim.wo.rnu = true + ColorMyPencils() + end) + + + vim.keymap.set("n", "zZ", function() + require("zen-mode").setup { + window = { + width = 80, + options = { } + }, + } + require("zen-mode").toggle() + vim.wo.wrap = false + vim.wo.number = false + vim.wo.rnu = false + vim.opt.colorcolumn = "0" + ColorMyPencils() + end) + end +} + + diff --git a/nvim/lua/theprimeagen/lazy_init.lua b/nvim/lua/theprimeagen/lazy_init.lua new file mode 100644 index 0000000..1c50d52 --- /dev/null +++ b/nvim/lua/theprimeagen/lazy_init.lua @@ -0,0 +1,17 @@ +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("lazy").setup({ + spec = "theprimeagen.lazy", + change_detection = { notify = false } +}) diff --git a/nvim/lua/theprimeagen/remap.lua b/nvim/lua/theprimeagen/remap.lua new file mode 100644 index 0000000..5ac18c8 --- /dev/null +++ b/nvim/lua/theprimeagen/remap.lua @@ -0,0 +1,91 @@ +vim.g.mapleader = " " +vim.keymap.set("n", "t", function() vim.cmd("Ex") end) +vim.keymap.set("n", "q", ":qa") +vim.keymap.set("n", "q", + [[lua if #vim.api.nvim_list_wins() > 1 then vim.cmd('close') else vim.cmd('qa') end]]) +vim.keymap.set("n", "l", "l") +vim.keymap.set("n", "h", "h") +vim.keymap.set("n", "k", "k") +vim.keymap.set("n", "j", "j") + + + +-- Mapping leader v followed by l to split to the left +vim.keymap.set("n", "vl", [[vertical leftabove splitw]]) + + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") +vim.keymap.set("n", "zig", "LspRestart") + +--vim.keymap.set("n", "vwm", function() +-- require("vim-with-me").StartVimWithMe() +--end) +--vim.keymap.set("n", "svwm", function() +-- require("vim-with-me").StopVimWithMe() +--end) + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({ "n", "v" }, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({ "n", "v" }, "d", [["_d]]) + +-- This is going to get me cancelled +vim.keymap.set("i", "", "") + +vim.keymap.set("n", "Q", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +--vim.keymap.set("n", "", "cnextzz") +--vim.keymap.set("n", "", "cprevzz") +--vim.keymap.set("n", "k", "lnextzz") +--vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +vim.keymap.set( + "n", + "ee", + "oif err != nil {}Oreturn err" +) + +vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); +vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); + +vim.keymap.set("n", "", function() + vim.cmd("so") +end) + +-- Yank into system clipboard +vim.keymap.set({ 'n', 'v' }, 'y', '"+y') -- yank motion +vim.keymap.set({ 'n', 'v' }, 'Y', '"+Y') -- yank line + +-- Delete into system clipboard +vim.keymap.set({ 'n', 'v' }, 'd', '"+d') -- delete motion +vim.keymap.set({ 'n', 'v' }, 'D', '"+D') -- delete line + +-- Paste from system clipboard +vim.keymap.set('n', 'p', '"+p') -- paste after cursor +vim.keymap.set('n', 'P', '"+P') -- paste before cursor + +--Harpoon +---- Write (save current file) +vim.keymap.set("n", "w", ":w", { desc = "Write current file" }) + +-- Write all (save all open buffers) +vim.keymap.set("n", "W", ":wall", { desc = "Write all buffers" }) + +-- Write and quit all +vim.keymap.set("n", "Q", ":wqall", { desc = "Write and quit all" }) diff --git a/nvim/lua/theprimeagen/set.lua b/nvim/lua/theprimeagen/set.lua new file mode 100644 index 0000000..1811670 --- /dev/null +++ b/nvim/lua/theprimeagen/set.lua @@ -0,0 +1,34 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.opt.wrap = false +vim.opt.breakindent = true +vim.opt.breakindentopt = "shift:11" + +vim.opt.smartindent = true + + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80" +vim.g.lazyvim_prettier_needs_config = false