diff --git a/.config/nvim/.options/obsidian.all.lua b/.config/nvim/.options/obsidian.all.lua index 0529135..4fa477d 100644 --- a/.config/nvim/.options/obsidian.all.lua +++ b/.config/nvim/.options/obsidian.all.lua @@ -1,22 +1,22 @@ -return { - "epwalsh/obsidian.nvim", - version = "*", -- recommended, use latest release instead of latest commit - lazy = true, - ft = "markdown", - dependencies = { - -- Required. - "nvim-lua/plenary.nvim", - - -- see below for full list of optional dependencies 👇 - }, - opts = { - workspaces = { - { - name = "All", - path = "~/Obsidian", - }, - }, - - -- see below for full list of options 👇 - }, -} \ No newline at end of file +return { + "epwalsh/obsidian.nvim", + version = "*", -- recommended, use latest release instead of latest commit + lazy = true, + ft = "markdown", + dependencies = { + -- Required. + "nvim-lua/plenary.nvim", + + -- see below for full list of optional dependencies 👇 + }, + opts = { + workspaces = { + { + name = "Obsidian", + path = "~/Obsidian", + }, + }, + + -- see below for full list of options 👇 + }, +} diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index fa3ba79..e94c541 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -1,39 +1,61 @@ -# $XDG_CONFIG_HOME/tmux/tmux.conf -# ln -sf $DOTFILES/.config/tmux/tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf -# Prefix -# ----------------- -set-option -g prefix C-x -unbind C-b -bind C-x send-prefix - -# Index -# ----------------- -set -g base-index 1 -set -g pane-base-index 1 - -# History -# ----------------- -set -g history-limit 4096 - -# Reload Config -# ----------------- -bind r source-file ~/.tmux.conf \; display "Reloaded Config" - -# Vi Mode -# ----------------- -set -g status-keys vi -set-window-option -g mode-keys vi - -# Windows Management -# ----------------- -bind | split-window -h -unbind '"' -bind - split-window -v -unbind % -bind h select-pane -L -bind n select-pane -D -bind e select-pane -U -bind i select-pane -R - - - +# $XDG_CONFIG_HOME/tmux/tmux.conf +# ln -sf $DOTFILES/.config/tmux/tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf + +# Prefix +# ----------------- +set-option -g prefix C-a +unbind C-b +bind C-a send-prefix + +# Options +set-option -g mouse on +set-option -g default-terminal "screen-256color" +set-option -g allow-rename on +set-option -g alternate-screen on +set-option -g visual-activity on +set-option -g pane-border-style fg=colour244 +set-option -g pane-activity-border-style fg=colour239 + +# Index +# ----------------- +set -g base-index 1 +set -g pane-base-index 1 + +# History +# ----------------- +set -g history-limit 4096 + +# Reload Config +# ----------------- +bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded Config" + +# Vi Mode +# ----------------- +set -g status-keys vi +set-window-option -g mode-keys vi + +# Windows Management +# ----------------- +bind | split-window -h +unbind '"' +bind - split-window -v +unbind % +bind h select-pane -L +bind n select-pane -D +bind e select-pane -U +bind i select-pane -R +bind -r H resize-pane -L 5 +bind -r N resize-pane -D 5 +bind -r E resize-pane -U 5 +bind -r I resize-pane -R 5 +bind C-h select-window -t :- +bind C-l select-window -t :+ +bind ` resize-pane -Z + +# Status Bar +# ----------------- +set -g status-position top +set-option -g status-bg black +set-option -g status-fg white +set-option -g status-left '#[fg=green][#S] ' +setw -g window-status-current-format '#[fg=colour236,bg=colour39] #I #W ' diff --git a/mac/Microsoft.PowerShell_profile.ps1 b/mac/Microsoft.PowerShell_profile.ps1 index e51f72c..386b296 100644 --- a/mac/Microsoft.PowerShell_profile.ps1 +++ b/mac/Microsoft.PowerShell_profile.ps1 @@ -1,24 +1,24 @@ -# $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1 -# ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1 -### Variables ### - -$DOTFILES = "$HOME\.dotfiles" - -### Load Configs ### - -Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_} -Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_} - -## Aliases ### - -# PowerShell Equivalents # - -# Set-Alias "curl" "Invoke-WebRequest" -# Set-Alias "man" "Get-Help" -Set-Alias "kill" "Stop-Process" -Set-Alias "open" "Invoke-Item" # Use ii instead of open - -# Dev # - -${function:zshcfg} = { nvim ~/.zshrc } -${function:bashcfg} = { nvim ~/.bashrc } \ No newline at end of file +# $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1 +# ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1 +### Variables ### + +$DOTFILES = "$HOME/.dotfiles" + +### Load Configs ### + +Get-ChildItem -Path $DOTFILES/powershell -Filter *.ps1 | ForEach-Object {. $_} +Get-ChildItem -Path $DOTFILES/powershell_private -Filter *.ps1 | ForEach-Object {. $_} + +## Aliases ### + +# PowerShell Equivalents # + +# Set-Alias "curl" "Invoke-WebRequest" +# Set-Alias "man" "Get-Help" +Set-Alias "kill" "Stop-Process" +Set-Alias "open" "Invoke-Item" # Use ii instead of open + +# Dev # + +${function:zshcfg} = { nvim ~/.zshrc } +${function:bashcfg} = { nvim ~/.bashrc } diff --git a/setup/mac_setup.sh b/setup/mac_setup.sh index 78ea0d0..770fa92 100644 --- a/setup/mac_setup.sh +++ b/setup/mac_setup.sh @@ -277,4 +277,7 @@ duti -s com.jetbrains.rider .csproj all duti -s com.jetbrains.rider .fsproj all # Video -> IINA duti -s com.colliderli.iina .mp4 all -duti -s com.colliderli.iina .mkv all \ No newline at end of file +duti -s com.colliderli.iina .mkv all + +mkdir -p $DOTFILES/powershell_private +touch $ZDOTDIR/.private.env.sh \ No newline at end of file diff --git a/zsh/alias.zsh b/zsh/alias.zsh index 5c59223..73d5579 100644 --- a/zsh/alias.zsh +++ b/zsh/alias.zsh @@ -1,45 +1,50 @@ -# PowerShell Equivalent # -alias ni=touch -alias cls=clear - -# Dev # -alias g++='g++ -std=c++2b' # Set the default C++ standard to C++20 -alias gcc='gcc -std=c99' # Set the default C standard to C99 -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 bashcfg="nvim ~/.bashrc" -alias zshcfg="nvim ~/.zshrc" -alias shcfg=zshcfg -alias reload="source ~/.zshrc" -alias nvimrc="nvim $XDG_CONFIG_HOME/nvim/" -alias ohmyzsh="code ~/.oh-my-zsh" -alias pulldots="cd $DOTFILES && git pull" - -# Conda # -alias pyact="conda activate" -alias pydact="conda deactivate" -alias pylsenv="conda env list" -alias pymkenv="conda create --name" - -# Editors # -alias v=nvim -alias c=code - -# Misc # -alias cf=cfiles - -# Functions # -mkcd() { - mkdir -p -- "$0" && cd -P -- "$1" -} -cdls(){ - cd $1 && ls -} -tc(){ - touch $1 && code $1 -} -tv(){ - touch $1 && nvim $1 -} \ No newline at end of file +# 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 +alias gcc='gcc -std=c99' # Set the default C standard to C99 +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 $ZDOTDIR/.zshrc" +alias nvimrc="nvim $XDG_CONFIG_HOME/nvim/" +alias ohmyzsh="code ~/.oh-my-zsh" +alias pulldots="cd $DOTFILES && git pull" + +# Conda # +alias pyact="conda activate" +alias pydact="conda deactivate" +alias pylsenv="conda env list" +alias pymkenv="conda create --name" + +# Editors # +alias v=nvim +alias c=code + +# lsd # +alias ls='lsd -a' +alias l='lsd -lah' +# Misc # +alias cf=cfiles + +# Functions # +mkcd() { + mkdir -p -- "$0" && cd -P -- "$1" +} +cdls(){ + cd $1 && ls +} +tc(){ + touch $1 && code $1 +} +tv(){ + touch $1 && nvim $1 +} diff --git a/zsh/config.zsh b/zsh/config.zsh index accdf15..3beb84a 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -1,77 +1,70 @@ -### 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 - -# export MANPATH="/usr/local/man:$MANPATH" -# export LANG= "en_US.UTF-8" - -# Use XDG Base Directory Specification - -# ~/.azure/ -> $XDG_DATA_HOME/azure/ -export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure -# ~/.cgdb/ -> $XDG_CONFIG_HOME/cgdb/ -export CGDB_DIR="$XDG_CONFIG_HOME"/cgdb -# ~/.nv -> $XDG_CACHE_HOME/nv (CUDA) -# macOS does not have Cuda; Check if CUDA is installed -if [ "$(uname)" != "Darwin" ] && [ -d "/usr/local/cuda" ]; then - export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv -fi -# ~/.docker -> $XDG_CONFIG_HOME/docker -export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker -# ~/.dotnet -> $XDG_DATA_HOME/dotnet -export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet -# ~/.gnupg -> $XDG_CONFIG_HOME/gnupg -export GNUPGHOME="$XDG_DATA_HOME"/gnupg -# ~/go -> $XDG_DATA_HOME/go -export GOPATH="$XDG_DATA_HOME"/go -# ~/.juliaup/ -> $XDG_DATA_HOME/julia/ -export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH" -# Check if node is installed -if command -v node > /dev/null; then - # ~/.node_repl_history -> $XDG_STATE_HOME/node/repl_history - export NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/repl_history - # ~/.ts_node_repl_history -> $XDG_STATE_HOME/node/ts_node_repl_history - export TS_NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/ts_node_repl_history - # ~/.npmrc -> $XDG_CONFIG_HOME/npm/npmrc - export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc - # ~/.npm -> $XDG_CACHE_HOME/npm - export NPM_CONFIG_INIT_MODULE="$XDG_CONFIG_HOME"/npm/config/npm-init.js - export NPM_CONFIG_CACHE="$XDG_CACHE_HOME"/npm - export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR"/npm -fi -# ~/.python_history -> $XDG_DATA_HOME/python/history -# Works only with Python 3.13.0a3 and later -export PYTHON_HISTORY="$XDG_DATA_HOME"/python/history -# ~/.tldrc/ -> $XDG_CACHE_HOME/tldr -export TLDR_CACHE_DIR="$XDG_CACHE_HOME"/tldr -# ~/.w3m -> $XDG_DATA_HOME/w3m -export W3M_DIR="$XDG_DATA_HOME"/w3m -# ~/.wakatime.cfg -> $XDG_CONFIG_HOME/wakatime.cfg -# ~/.wakatime/ -> $XDG_CONFIG_HOME/wakatime/ -export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime" -# ~/.wget-hsts -> $XDG_DATA_HOME/wget-hsts -alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' -# ~/.z -> $XDG_DATA_HOME/z -export _Z_DATA="$XDG_DATA_HOME/z" -# ~/.zcompdump* -> $XDG_CACHE_HOME/zsh/zcompdump* -compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" -# ~/.zsh_history -> $XDG_STATE_HOME/zsh/history -export HISTFILE="$XDG_STATE_HOME"/zsh/history \ No newline at end of file +# ZSH Config # +export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH +HIST_STAMPS="yyyy-mm-dd" +# plugins=(git web-search jsontools z vi-mode zsh-syntax-highlighting zsh-autosuggestions) + +# Plugins (Manually Managed) # +# $ZDOTDIR/plugins + +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 # + +# ~/.azure/ -> $XDG_DATA_HOME/azure/ +export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure +# ~/.cgdb/ -> $XDG_CONFIG_HOME/cgdb/ +export CGDB_DIR="$XDG_CONFIG_HOME"/cgdb +# ~/.nv -> $XDG_CACHE_HOME/nv (CUDA) +# macOS does not have Cuda; Check if CUDA is installed +if [ "$(uname)" != "Darwin" ] && [ -d "/usr/local/cuda" ]; then + export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv +fi +# ~/.docker -> $XDG_CONFIG_HOME/docker +export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker +# ~/.dotnet -> $XDG_DATA_HOME/dotnet +export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet +# ~/.gnupg -> $XDG_CONFIG_HOME/gnupg +export GNUPGHOME="$XDG_DATA_HOME"/gnupg +# ~/go -> $XDG_DATA_HOME/go +export GOPATH="$XDG_DATA_HOME"/go +# ~/.juliaup/ -> $XDG_DATA_HOME/julia/ +export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH" +# Check if node is installed +if command -v node > /dev/null; then + # ~/.node_repl_history -> $XDG_STATE_HOME/node/repl_history + export NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/repl_history + # ~/.ts_node_repl_history -> $XDG_STATE_HOME/node/ts_node_repl_history + export TS_NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/ts_node_repl_history + # ~/.npmrc -> $XDG_CONFIG_HOME/npm/npmrc + export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc + # ~/.npm -> $XDG_CACHE_HOME/npm + export NPM_CONFIG_INIT_MODULE="$XDG_CONFIG_HOME"/npm/config/npm-init.js + export NPM_CONFIG_CACHE="$XDG_CACHE_HOME"/npm + export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR"/npm +fi +# ~/.python_history -> $XDG_DATA_HOME/python/history +# Works only with Python 3.13.0a3 and later +export PYTHON_HISTORY="$XDG_DATA_HOME"/python/history +# ~/.tldrc/ -> $XDG_CACHE_HOME/tldr +export TLDR_CACHE_DIR="$XDG_CACHE_HOME"/tldr +# ~/.w3m -> $XDG_DATA_HOME/w3m +export W3M_DIR="$XDG_DATA_HOME"/w3m +# ~/.wakatime.cfg -> $XDG_CONFIG_HOME/wakatime.cfg +# ~/.wakatime/ -> $XDG_CONFIG_HOME/wakatime/ +export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime" +# ~/.wget-hsts -> $XDG_DATA_HOME/wget-hsts +alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' +# ~/.z -> $XDG_DATA_HOME/z +export _Z_DATA="$XDG_DATA_HOME/z" +# ~/.zcompdump* -> $XDG_CACHE_HOME/zsh/zcompdump* +compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" +# ~/.zsh_history -> $XDG_STATE_HOME/zsh/history +export HISTFILE="$XDG_STATE_HOME"/zsh/history 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