From 080fe6528f5ba493ed33215c1f42cd92a741286f Mon Sep 17 00:00:00 2001 From: Pat Garrity Date: Mon, 11 May 2026 21:05:06 -0500 Subject: [PATCH] Lots of changes! --- .config/nvim/init.lua | 3 --- .config/nvim/lua/keymap.lua | 6 +++++ .config/nvim/lua/plugin_management.lua | 12 +++------ .config/nvim/lua/plugins/metals.lua | 1 - .config/nvim/lua/plugins/treesitter.lua | 34 ------------------------- .zshrc | 28 ++++++++++++++++++-- 6 files changed, 36 insertions(+), 48 deletions(-) delete mode 100644 .config/nvim/lua/plugins/treesitter.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 554c846..9e7a946 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -19,6 +19,3 @@ require('colorscheme') -- Setup autocmd for metals - metals is a little weird and needs to load itself. -- The plugin that's loaded just makes metals code available in the first place. require('plugins/metals') - --- Setup treesitter, select the configs to load, etc. -require('plugins/treesitter') diff --git a/.config/nvim/lua/keymap.lua b/.config/nvim/lua/keymap.lua index cd56982..5048372 100644 --- a/.config/nvim/lua/keymap.lua +++ b/.config/nvim/lua/keymap.lua @@ -57,3 +57,9 @@ map('n', '[c', 'lua vim.diagnostic.jump({ count = -1, float = true })', map('n', ']c', 'lua vim.diagnostic.jump({ count = 1, float = true })', { desc = 'next diagnostic' }) map('n', 'ls', ':Telescope lsp_document_symbols', { desc = 'Browse Document Symbols' }) map('n', 'ld', ':Telescope lsp_dynamic_workspace_symbols', { desc = 'Browse Definitions' }) + +-------------------------------------------------------------------------------- +-- Alignment +-------------------------------------------------------------------------------- +map('x', 'ga', '(EasyAlign)', { desc = 'Easy Alignment' }) +map('n', 'ga', '(EasyAlign)', { desc = 'Easy Alignment' }) diff --git a/.config/nvim/lua/plugin_management.lua b/.config/nvim/lua/plugin_management.lua index b46e152..560c884 100644 --- a/.config/nvim/lua/plugin_management.lua +++ b/.config/nvim/lua/plugin_management.lua @@ -126,14 +126,6 @@ require("lazy").setup({ } }, - -- Treesitter: Neovim bindings for the Tree-sitter parser generator tool and - -- incremental parsing library. - -- ------------------------------------------------------------------------- - { - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate' - }, - -- Neovim-native LSP Implementation -- -- Some languages are supported elsewhere via plugins that know how to @@ -349,4 +341,8 @@ require("lazy").setup({ -- i3 configuration syntax -- ------------------------------------------------------------------------- 'mboughaba/i3config.vim', + + -- Alignment support via `ga` in normal and visual selection mode. + -- ------------------------------------------------------------------------- + 'junegunn/vim-easy-align', }) diff --git a/.config/nvim/lua/plugins/metals.lua b/.config/nvim/lua/plugins/metals.lua index 305644a..dc114cc 100644 --- a/.config/nvim/lua/plugins/metals.lua +++ b/.config/nvim/lua/plugins/metals.lua @@ -1,7 +1,6 @@ -- Note that Metals _does not use nvim-lspconfig_. -- It still uses the nvim LSP, however. - -- Autocmd that will actually be in charging of starting the whole thing local nvim_metals_group = vim.api.nvim_create_augroup( 'nvim-metals', diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index 5abc075..0000000 --- a/.config/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,34 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- One of "all", "maintained", or a list of languages - ensure_installed = { - "bash", "scala", "yaml", "css", "javascript", "lua", "hcl", "json", - "toml", "sql", "python", "gitcommit", "gitignore", "html" - }, - - -- This will be populated after load. - modules = {}, - - -- Only enable if CLI treesitter is installed. - auto_install = false, - - -- Install languages synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- List of parsers to ignore installing - ignore_install = { }, - - highlight = { - enable = true, - disable = {}, - -- 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 = false, - }, - - indent = { - enable = false - } -} diff --git a/.zshrc b/.zshrc index 7dfd165..e269ece 100644 --- a/.zshrc +++ b/.zshrc @@ -37,6 +37,9 @@ export FZF_CTRL_R_OPTS=" --color header:italic --header 'Press CTRL-Y to copy command into clipboard'" +# Enable ZSH Completion +autoload -Uz compinit && compinit + # ============================================================================= # Allow for menu-style tab completion. # ============================================================================= @@ -147,9 +150,28 @@ else echo $SSH_AGENT_PID > $ssh_agent_pid_file fi +# ============================================================================= +# Custom Functions +# ============================================================================= + +# This function helps get back to the git root, which is really commonly useful +# when deep in a source directory. Aliased to `gr`. +function jump-to-git-root { + local git_root="$(git rev-parse --show-toplevel 2>/dev/null)" + if [[ -z $git_root ]]; then + >&2 echo 'Not a Git repo!' + return 1 + fi + local current_pwd=$(pwd) + OLDPWD=$current_pwd + cd $git_root +} + # ============================================================================= # Aliases # ============================================================================= +alias gr=jump-to-git-root + if command -v eza > /dev/null 2>&1; then alias ls='eza' alias ll='eza -l' @@ -199,9 +221,10 @@ fi # ============================================================================= zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash -fpath=(~/.zsh $fpath) -autoload -Uz compinit && compinit +# This directory contains _git, a git completion script. +# We _also_ need the BASH one that is referenced above. +fpath=(~/.zsh $fpath) # ============================================================================= # Initialize Starship @@ -213,3 +236,4 @@ eval "$(starship init zsh)" # This must be the last item in this file. # ============================================================================= source $local_install_dir/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +eval "$(atuin init zsh)"