From 237a3de3af104667f31320d762eca24a0468fd28 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 30 Nov 2022 11:41:42 +0000 Subject: [PATCH] Rebase new changes, and fish conf --- config/general/config.fish | 9 --- config/vim/setup-vim-plug.vim | 7 ++ config/zsh/.zshrc | 95 ++++++++++++++---------- scripts/macos-setup/macos-preferences.sh | 3 + symlinks.yaml | 2 +- 5 files changed, 68 insertions(+), 48 deletions(-) delete mode 100644 config/general/config.fish diff --git a/config/general/config.fish b/config/general/config.fish deleted file mode 100644 index f81856e..0000000 --- a/config/general/config.fish +++ /dev/null @@ -1,9 +0,0 @@ - -if status is-interactive - # Commands to run in interactive sessions can go here -end - -# If starship is installed, initialize it -if type -q starship - starship init fish | source -end diff --git a/config/vim/setup-vim-plug.vim b/config/vim/setup-vim-plug.vim index 5d189d5..78808f4 100644 --- a/config/vim/setup-vim-plug.vim +++ b/config/vim/setup-vim-plug.vim @@ -1,3 +1,10 @@ +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Sets up all Vim / Neovim Plugins via Vim Plug " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Installs and imports Vim Plug, updates and loads listed plugins " +" For more info, see docs at: https://github.com/lissy93/dotfiles " +" Licensed under MIT (C) Alicia Sykes 2022 " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set paths for plug.vim and directory for plugins if has('nvim') diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 5a6b45c..8387b75 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -1,66 +1,85 @@ +###################################################################### +# ~/.config/zsh/.zshrc # +###################################################################### +# Instructions to be executed when a new ZSH session is launched # +# Imports all plugins, aliases, helper functions, and configurations # +# # +# After editing, re-source .zshrc for new changes to take effect # +# For docs and more info, see: https://github.com/lissy93/dotfiles # +###################################################################### +# Licensed under MIT (C) Alicia Sykes 2022 # +###################################################################### # Directory for all-things ZSH config zsh_dir=${${ZDOTDIR}:-$HOME/.config/zsh} -utils_dir=~/.config/utils +utils_dir="${XDG_CONFIG_HOME}/utils" # If not running interactively, don't do anything [[ $- != *i* ]] && return -# Import alias files -source ${zsh_dir}/aliases/general.zsh -source ${zsh_dir}/aliases/git.zsh -source ${zsh_dir}/aliases/node-js.zsh -source ${zsh_dir}/aliases/flutter.zsh -source ${zsh_dir}/aliases/alias-tips.zsh +# Source all ZSH config files (if present) +if [[ -d $zsh_dir ]]; then + # Import alias files + source ${zsh_dir}/aliases/general.zsh + source ${zsh_dir}/aliases/git.zsh + source ${zsh_dir}/aliases/node-js.zsh + source ${zsh_dir}/aliases/flutter.zsh + source ${zsh_dir}/aliases/alias-tips.zsh -# Setup Antigen, and import plugins -source ${zsh_dir}/helpers/setup-antigen.zsh -source ${zsh_dir}/helpers/import-plugins.zsh -source ${zsh_dir}/helpers/misc-stuff.zsh + # Setup Antigen, and import plugins + source ${zsh_dir}/helpers/setup-antigen.zsh + source ${zsh_dir}/helpers/import-plugins.zsh + source ${zsh_dir}/helpers/misc-stuff.zsh -# Configure ZSH stuff -source ${zsh_dir}/lib/colors.zsh -source ${zsh_dir}/lib/cursor.zsh -source ${zsh_dir}/lib/history.zsh -source ${zsh_dir}/lib/surround.zsh -source ${zsh_dir}/lib/completion.zsh -source ${zsh_dir}/lib/term-title.zsh -source ${zsh_dir}/lib/navigation.zsh -source ${zsh_dir}/lib/expansions.zsh -source ${zsh_dir}/lib/key-bindings.zsh + # Configure ZSH stuff + source ${zsh_dir}/lib/colors.zsh + source ${zsh_dir}/lib/cursor.zsh + source ${zsh_dir}/lib/history.zsh + source ${zsh_dir}/lib/surround.zsh + source ${zsh_dir}/lib/completion.zsh + source ${zsh_dir}/lib/term-title.zsh + source ${zsh_dir}/lib/navigation.zsh + source ${zsh_dir}/lib/expansions.zsh + source ${zsh_dir}/lib/key-bindings.zsh +fi # Import utility functions -source ${utils_dir}/transfer.sh -source ${utils_dir}/matrix.sh -source ${utils_dir}/hr.sh -source ${utils_dir}/web-search.sh -source ${utils_dir}/am-i-online.sh -source ${utils_dir}/welcome-banner.sh -source ${utils_dir}/color-map.sh +if [[ -d $utils_dir ]]; then + source ${utils_dir}/transfer.sh + source ${utils_dir}/matrix.sh + source ${utils_dir}/hr.sh + source ${utils_dir}/web-search.sh + source ${utils_dir}/am-i-online.sh + source ${utils_dir}/welcome-banner.sh + source ${utils_dir}/color-map.sh +fi # Import P10k config for command prompt, run `p10k configure` or edit [[ ! -f ${zsh_dir}/.p10k.zsh ]] || source ${zsh_dir}/.p10k.zsh -# Add Brew to path, if installed and on MacOS -if [ "$(uname -s)" = "Darwin" ] && [[ -d /opt/homebrew/bin ]]; then +# MacOS-specific services +if [ "$(uname -s)" = "Darwin" ]; then + # Add Brew to path, if it's installed + if [[ -d /opt/homebrew/bin ]]; then export PATH=/opt/homebrew/bin:$PATH -fi + fi -# If using iTerm on MacOS, import the shell integration -if [ "$(uname -s)" = "Darwin" ] && [[ -f "${XDG_CONFIG_HOME}/zsh/.iterm2_shell_integration.zsh" ]]; then - source ${XDG_CONFIG_HOME}/iterm/shell-integration.zsh -fi + # If using iTerm, import the shell integration if availible + if [[ -f "${XDG_CONFIG_HOME}/zsh/.iterm2_shell_integration.zsh" ]]; then + source "${XDG_CONFIG_HOME}/zsh/.iterm2_shell_integration.zsh" + fi -# And Android SDK to path, if within Library direcroty -if [ "$(uname -s)" = "Darwin" ] && [[ -d "${HOME}/Library/Android/" ]]; then + # Append the Android SDK locations to path + if [[ -d "${HOME}/Library/Android/" ]]; then export PATH="${HOME}/Library/Android/sdk/emulator:${PATH}" export ANDROID_HOME="${HOME}/Library/Android/sdk" export ANDROID_SDK_ROOT="${HOME}/Library/Android/sdk" export ANDROID_AVD_HOME="${ANDROID_SDK_ROOT}/tools/emulator" export NODE_BINARY="/usr/local/bin/node" + fi fi -# If not running in nested shell, then show welcome message :) +# If not running in nested shell, then show nice welcome message :) if [[ "${SHLVL}" -lt 2 ]] && [[ -z "$SKIP_WELCOME" ]]; then welcome fi diff --git a/scripts/macos-setup/macos-preferences.sh b/scripts/macos-setup/macos-preferences.sh index f5911fc..2d145c1 100755 --- a/scripts/macos-setup/macos-preferences.sh +++ b/scripts/macos-setup/macos-preferences.sh @@ -379,6 +379,9 @@ log_section "Dock and Launchpad" log_msg "Set dock position to left-hand side" defaults write com.apple.dock orientation left +log_msg "Remove default apps from the dock" +defaults write com.apple.dock persistent-apps -array + log_msg "Add highlight effect to dock stacks" defaults write com.apple.dock mouse-over-hilite-stack -bool true diff --git a/symlinks.yaml b/symlinks.yaml index 050ad9b..57f81ae 100644 --- a/symlinks.yaml +++ b/symlinks.yaml @@ -18,8 +18,8 @@ ${XDG_CONFIG_HOME}/vim: config/vim ${XDG_CONFIG_HOME}/nvim: config/vim ${XDG_CONFIG_HOME}/tmux: config/tmux + ${XDG_CONFIG_HOME}/fish: config/fish - ${XDG_CONFIG_HOME}/fish/config.fish: config/config.fish ${XDG_DATA_HOME}/tmux/tpm: lib/tpm ${XDG_DATA_HOME}/tmux/plugins/tpm: lib/tpm