From 82889456087fa5f7f9362a24a5763fda85be24dd Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 17 Nov 2024 14:32:18 +0000 Subject: [PATCH] feat(zsh): Manually manage plugins without omz --- .config/nvim/.options/obsidian.all.lua | 2 +- mac/Microsoft.PowerShell_profile.ps1 | 4 +-- zsh/alias.zsh | 7 ++++- zsh/config.zsh | 37 +++++++++++--------------- zsh/update.sh | 13 +++++++++ 5 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 zsh/update.sh diff --git a/.config/nvim/.options/obsidian.all.lua b/.config/nvim/.options/obsidian.all.lua index f0cbf04..467db7e 100644 --- a/.config/nvim/.options/obsidian.all.lua +++ b/.config/nvim/.options/obsidian.all.lua @@ -12,7 +12,7 @@ return { opts = { workspaces = { { - name = "All", + name = "Obsidian", path = "~/Obsidian", }, }, diff --git a/mac/Microsoft.PowerShell_profile.ps1 b/mac/Microsoft.PowerShell_profile.ps1 index d5ed456..e0f906c 100644 --- a/mac/Microsoft.PowerShell_profile.ps1 +++ b/mac/Microsoft.PowerShell_profile.ps1 @@ -6,8 +6,8 @@ $DOTFILES = "$HOME/.dotfiles" ### Load Configs ### -Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_} -Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_} +Get-ChildItem -Path $DOTFILES/powershell -Filter *.ps1 | ForEach-Object {. $_} +Get-ChildItem -Path $DOTFILES/powershell_private -Filter *.ps1 | ForEach-Object {. $_} ## Aliases ### diff --git a/zsh/alias.zsh b/zsh/alias.zsh index a37837c..9387842 100644 --- a/zsh/alias.zsh +++ b/zsh/alias.zsh @@ -1,6 +1,7 @@ # PowerShell Equivalent # alias ni=touch alias cls=clear +alias ii=open # Dev # alias g++='g++ -std=c++2b' # Set the default C++ standard to C++20 @@ -9,10 +10,11 @@ alias cl='clang -std=c99' alias clpp='clang++ -std=c++2b' alias python=python3 # Set the default Python version to Python 3 alias py=python # Alias for Python +alias pip=pip3 # Alias for pip alias bashcfg="nvim ~/.bashrc" alias zshcfg="nvim ~/.zshrc" alias shcfg=zshcfg -alias reload="source ~/.zshrc" +alias reload="source $ZDOTDIR/.zshrc" alias nvimrc="nvim $XDG_CONFIG_HOME/nvim/" alias ohmyzsh="code ~/.oh-my-zsh" alias pulldots="cd $DOTFILES && git pull" @@ -27,6 +29,9 @@ alias pymkenv="conda create --name" alias v=nvim alias c=code +# lsd # +alias ls='lsd -a' +alias l='lsd -lah' # Misc # alias cf=cfiles diff --git a/zsh/config.zsh b/zsh/config.zsh index d29813e..a0d14a5 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -1,29 +1,22 @@ -### ZSH Config ### +# ZSH Config # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH -export ZSH="$ZDOTDIR/ohmyzsh" -ZSH_THEME="avit" -# DISABLE_MAGIC_FUNCTIONS="true" -# DISABLE_LS_COLORS="true" -# DISABLE_AUTO_TITLE="true" -# 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" HIST_STAMPS="yyyy-mm-dd" -plugins=(git web-search jsontools z vi-mode zsh-syntax-highlighting zsh-autosuggestions) -source $ZSH/oh-my-zsh.sh -source .private.env.sh +# plugins=(git web-search jsontools z vi-mode zsh-syntax-highlighting zsh-autosuggestions) -# export MANPATH="/usr/local/man:$MANPATH" -# export LANG= "en_US.UTF-8" +# Plugins (Manually Managed) # +# $ZDOTDIR/plugins -# Use XDG Base Directory Specification +source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source $ZDOTDIR/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source $ZDOTDIR/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh + +# Tools Related Environment Variables # + +PAGER="less" +EDITOR="nvim" +VISUAL="nvim" + +# Use XDG Base Directory Specification # # ~/.dotnet -> $XDG_DATA_HOME/dotnet export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet diff --git a/zsh/update.sh b/zsh/update.sh new file mode 100644 index 0000000..3c660ae --- /dev/null +++ b/zsh/update.sh @@ -0,0 +1,13 @@ +# $DOTFILES/zsh/update.sh + +# This file won't be sourced by zsh by default +# Use `source` to run this file for updating plugins + +# Plugins # +# Auto `git pull` on $ZDOTDIR/plugins +for plugin in $ZDOTDIR/plugins/*; do + if [ -d "$plugin" ]; then + cd $plugin + git pull --quiet --no-edit + fi +done