From 7ad4fe235070eaea0e5c86ec81b7bd9c2df8c06f Mon Sep 17 00:00:00 2001 From: Joshua Finch Date: Fri, 7 Feb 2025 13:12:53 -0600 Subject: [PATCH] Altering the neovim config for LSP plugin load order and adding the prettier LSP for reference (even though mason-lspconfig doesn't load it) Chaning the zshrc template for better handling of include files, adding support for easily extending include files, changing the loaded plugins to better support currently work flows and minor cleanup of the plugin download. --- nvim/lua/plugins.lua | 2 +- nvim/lua/plugins/mason.lua | 1 + nvim/lua/settings.lua | 2 +- zshrc | 64 +++++++++++++++++++++----------------- 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 01ca3ab..fcb167b 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -14,8 +14,8 @@ end vim.opt.rtp:prepend(lazypath) require('lazy').setup({ - require('plugins/lspconfig'), require('plugins/mason'), + require('plugins/lspconfig'), require('plugins/gruvbox'), require('plugins/comment'), require('plugins/dap'), diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 8438886..0ef080e 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -50,6 +50,7 @@ return { -- 'jdtls', -- java 'lua_ls', 'marksman', -- markdown + -- 'prettier', 'pylsp', 'rust_analyzer', -- 'snyk', diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 2dccf3f..f74353b 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -9,7 +9,7 @@ vim.opt.fillchars = 'fold: ' -- Sets the vim.opt.foldcolumn = '0' -- Disables the foldcolumn vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' -- Uses Treesitter to determine where code folding should occur vim.opt.foldlevel = 10 -- Sets the initial level at which folds will be closed -vim.opt.foldlevelstart = 2 -- Sets the initial fold level +vim.opt.foldlevelstart = 4 -- Sets the initial fold level vim.opt.foldmethod = 'expr' -- Attempt to use the syntax of a file to set folds. vim.opt.foldnestmax = 4 -- Maximum level of fold nesting vim.opt.formatoptions = 'cqrto' -- Allow auto insertion of comment lines when using o or O on a comment. diff --git a/zshrc b/zshrc index e0d2ecc..6a2d800 100644 --- a/zshrc +++ b/zshrc @@ -7,19 +7,12 @@ then sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" fi -if [ ! -d $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions ] -then - git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions -fi - +### ZSH Configuration # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" ZSH_THEME="fb-custom" -# 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" @@ -27,37 +20,51 @@ HYPHEN_INSENSITIVE="true" # Uncomment one of the following lines to change the auto-update behavior zstyle ':omz:update' mode reminder frequency 14 +# Plugins +# Install the zsh-autosuggestions plugin if it doesn't exist +if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] +then + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions +fi + plugins=( + aws copypath dotenv git history zsh-autosuggestions - virtualenvwrapper + virtualenv + virtualenvwrapper # Used for autoloading project .venvs ) +# Load Oh My ZSH source $ZSH/oh-my-zsh.sh -# User configuration -# You may need to manually set your language environment -export LANG=en_US.UTF-8 -export LC_ALL=en_US.UTF-8 +# ZSH options +setopt NO_clobber # Do not clobber files by default +setopt hist_ignore_all_dups # Replace old history with the newest call to an identical call +setopt hist_ignore_space # Remove history lines that start with spaces + +### User configuration +export EDITOR=nvim # Paths to prepend to system path -path=($GOPATH/bin - $HOME/.cargo/bin - $HOME/.local/bin - $path) +path=( + $GOPATH/bin + $HOME/.cargo/bin + $HOME/.local/bin + $path +) +# Autoload keychain for ssh-agent handling if it is installed if command -v keychain &> /dev/null then eval $(keychain --eval --quiet --nogui --noask) fi -setopt NO_clobber -setopt hist_ignore_all_dups -setopt hist_ignore_space - +### Custom functions +# Timing function for checking zsh load speed timezsh() { shell=$SHELL for i in $(seq 1 10) @@ -68,16 +75,17 @@ timezsh() { done } -if [ ! -f "$HOME/.zsh_aliases" ] -then - touch $HOME/.zsh_aliases -fi - +### Environment specific include files include_files=( "$HOME/.zsh_aliases" + "$HOME/.zsh_exports" ) -for file in $include_files -do +for file in $include_files; do + if [ ! -f $file ] + then + touch $file + fi + source $file done