diff --git a/.github/README.md b/.github/README.md index 6d06e36..3e5dbba 100644 --- a/.github/README.md +++ b/.github/README.md @@ -25,6 +25,7 @@ - [Aliases](#aliases) - [Packages](#packages) - [System Preferences](#system-preferences) + - [Config Files](#config-files) - [ZSH](#zsh) - [Vim](#vim) - [Tmux](#tmux) @@ -899,9 +900,29 @@ If you choose to run any of these scripts, take care to read it through first, t --- +### Config Files + +All config files are located in [`./config/`](https://github.com/Lissy93/dotfiles/tree/master/config/). + +Configurations for ZSH, Tmux, Vim, and a few others are in dedicated sub-directories (covered in the section below). While all other, small config files are located in the [`./config/general`](https://github.com/Lissy93/dotfiles/tree/master/config/general) direcroty, and include: + +- [`.bashrc`](https://github.com/Lissy93/dotfiles/blob/master/config/general/.bashrc) +- [`.curlrc`](https://github.com/Lissy93/dotfiles/blob/master/config/general/.curlrc) +- [`.gemrc`](https://github.com/Lissy93/dotfiles/blob/master/config/general/.gemrc) +- [`.gitconfig`](https://github.com/Lissy93/dotfiles/blob/master/config/general/.gitconfig) +- [`.gitignore_global`](https://github.com/Lissy93/dotfiles/blob/master/config/general/.gitignore_global) +- [`.wgetrc`](https://github.com/Lissy93/dotfiles/blob/master/config/general/.wgetrc) +- [`dnscrypt-proxy.toml`](https://github.com/Lissy93/dotfiles/blob/master/config/general/dnscrypt-proxy.toml) +- [`gpg.conf`](https://github.com/Lissy93/dotfiles/blob/master/config/general/gpg.conf) +- [`starship.toml`](https://github.com/Lissy93/dotfiles/blob/master/config/general/starship.toml) + +--- + ### ZSH -// TODO +[ZSH](https://www.zsh.org/) (or Z shell) is a UNIX command interpriter (shell), similar to and compatible with Korn shell (KSH). Compared to Bash, it includes many useful features and enchanements, notably in the CLI editor, advanced behaviour customization options, filename globbing, recursive path expansion, completion, and it's easyily extandable through plugins. For more info about ZSH, see the [Introduction to ZSH Docs](https://zsh.sourceforge.io/FAQ/zshfaq01.html). + +My ZSH config is located in [`config/zsh/`](https://github.com/Lissy93/dotfiles/tree/master/config/zsh) --- 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/config/zsh/README.txt b/config/zsh/README.txt new file mode 100644 index 0000000..f6b9511 --- /dev/null +++ b/config/zsh/README.txt @@ -0,0 +1,36 @@ +Lissy93/Dotfiles - ZSH Config ⚙️ +------------------------------- + +> My configuration files for Z Shell + +config/zsh/ +├── .p10k.zsh Configuration for the PowerLevel10K ZSH prompt +├── .zlogin Startup tasks, executed when the shell is launched +├── .zlogout Cleanup tasks, executed when the shell is exited +├── .zshenv Core environmental variables, used to configure file locations for dotfiles +├── .zshrc Entry point for ZSH config, here all the other files are imported +├── aliases/ +│ ├── alias-tips.zsh Shows hint when there's an available short-hand alias for a command +│ ├── flutter.zsh Aliases, shortcuts and helper functions for Flutter development +│ ├── general.zsh General aliases and short functions for common CLI tasks +│ ├── git.zsh Aliases, shortcuts and helper functions for working with Git +│ └── node-js.zsh Aliases, shortcuts and helper functions for JS/ Node.js development +├── helpers/ +│ ├── import-plugins.zsh Installation, updating and importing of all ZSH plugins, via Antigen +│ ├── misc-stuff.zsh +│ └── setup-antigen.zsh Installs, and sets up Antigen, which is used for plugin management +└── lib/ + ├── colors.zsh Define colors for listing various file types + ├── completion.zsh Configure completion and fuzzy matching settings + ├── cursor.zsh Set cursor color, behaviour and key bindings + ├── expansions.zsh Expands all glob expressions, subcommands and aliases + ├── history.zsh Configure history settings, file size, age, etc + ├── key-bindings.zsh Set key bindings, and keyboard shortcuts + ├── navigation.zsh Settings for jumping around directories + ├── surround.zsh Match parentheses/quotes around strings + └── term-title.zsh Show current command as terminal title (Xterm) + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Full source and documentation: https://github.com/Lissy93/dotfiles ┃ +┃ Licensed under MIT (C) Alicia Sykes 2022 ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 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 733d8dd..4e5dc69 100644 --- a/symlinks.yaml +++ b/symlinks.yaml @@ -18,7 +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: config/config.fish + ${XDG_CONFIG_HOME}/fish: config/fish + ${XDG_DATA_HOME}/tmux/tpm: lib/tpm ${XDG_DATA_HOME}/tmux/plugins/tpm: lib/tpm