diff --git a/README.md b/README.md index b4b4193..1f57f29 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,4 @@ mar does dotfiles ## Sources [oh-my-zsh git](https://kapeli.com/cheat_sheets/Oh-My-Zsh_Git.docset/Contents/Resources/Documents/index) [git-prevision](https://gist.github.com/TheCodeArtist/a90978ebca0ff6743036) +[iTerm2 keymaps for tmux](https://web.archive.org/web/20230921160724/https://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-tmux/) diff --git a/fish/.config/fish/config.fish.symlink b/fish/.config/fish/config.fish.symlink index 3543625..83e1309 100644 --- a/fish/.config/fish/config.fish.symlink +++ b/fish/.config/fish/config.fish.symlink @@ -31,7 +31,7 @@ for file in (string match -r '^.*\/path.fish$' $config_files) end # Load everything else, except completion. -for file in (string match -v -r '^.*\/(path|completion)\.fish$' $config_files) +for file in (string match -v -r '^.*\/(path|completion|install)\.fish$' $config_files) source $file end diff --git a/git/.gitconfig.symlink b/git/.gitconfig.symlink index 5ef39f3..572fa14 100644 --- a/git/.gitconfig.symlink +++ b/git/.gitconfig.symlink @@ -1,7 +1,4 @@ -# vim:set ft=toml sw=4 : - -[alias] - prevision = nevermind = +# vim:set ft=gitconfig : [color] diff = always diff --git a/git/install.fish b/git/install.fish new file mode 100755 index 0000000..b52c8e9 --- /dev/null +++ b/git/install.fish @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +. "$DOT/homebrew/brew_utils.sh" + +brew_install "Github CLI" "gh" +brew_install "Gitmoji" "gitmoji" diff --git a/git/install.sh b/git/install.sh index 5738159..76647e9 100755 --- a/git/install.sh +++ b/git/install.sh @@ -1,9 +1,5 @@ -#!/usr/bin/env bash -# vim:set ft=bash: +#!/usr/bin/env sh -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../homebrew/brew_utils.sh" +. "$DOT/homebrew/brew_utils.sh" brew_install "Git" "git" -brew_install "Github CLI" "gh" -brew_install "Gitmoji" "gitmoji" diff --git a/homebrew/brew.sh b/homebrew/brew.sh index 23c9412..8260f3c 100755 --- a/homebrew/brew.sh +++ b/homebrew/brew.sh @@ -1,8 +1,6 @@ -#!/usr/bin/env bash -# vim:set ft=bash: +#!/usr/bin/env sh -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../script/utils.sh" +. "$DOT/script/utils.sh" ################################################################################ # Install # @@ -10,10 +8,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \ install() { - if test ! $(which brew); then + if test ! "$(which brew)"; then NONINTERACTIVE=1 \ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \ - &> /dev/null + >/dev/null 2>&1 print_result $? "Install" fi @@ -25,18 +23,18 @@ install() add_to_path() { - if command -v brew &> /dev/null; then + if command -v brew >/dev/null 2>&1; then return fi HARDWARE="$(uname -m)" prefix="" - if [[ "$(uname)" == "Linux" ]]; then + if [ "$(uname)" = "Linux" ]; then prefix="/home/linuxbrew/.linuxbrew" - elif [[ "$HARDWARE" == "arm64" ]]; then + elif [ "$HARDWARE" = "arm64" ]; then prefix="/opt/homebrew" - elif [[ "$HARDWARE" == "x86_64" ]]; then + elif [ "$HARDWARE" = "x86_64" ]; then prefix="/usr/local" else print_error "Homebrew is only supported on macOS Intel/ARM or Linux!" @@ -44,7 +42,7 @@ add_to_path() PATH="$prefix/bin:$PATH" - command -v brew &> /dev/null + command -v brew >/dev/null 2>&1 print_result $? "Add to PATH" } diff --git a/homebrew/brew_utils.sh b/homebrew/brew_utils.sh index e6c931c..74c5607 100644 --- a/homebrew/brew_utils.sh +++ b/homebrew/brew_utils.sh @@ -1,13 +1,12 @@ -#!/user/bin/env bash +#!/user/bin/env sh -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../script/utils.sh" +. "$DOT/script/utils.sh" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - brew_prefix() { - local path="" + path="" if path="$(brew --prefix 2>/dev/null)"; then printf "%s" "$path" @@ -20,7 +19,7 @@ brew_prefix() brew_tap() { - brew tap "$1" &>/dev/null + brew tap "$1" >/dev/null 2>&1 } brew_update() @@ -37,10 +36,10 @@ brew_upgrade() brew_install() { - declare -r FORMULA_READABLE_NAME="$1" - declare -r FORMULA="$2" - declare -r ARGUMENTS="$3" - declare -r TAP_VALUE="$4" + readonly FORMULA_READABLE_NAME="$1" + readonly FORMULA="$2" + readonly ARGUMENTS="$3" + readonly TAP_VALUE="$4" # Check that Homebrew is installed. @@ -51,7 +50,7 @@ brew_install() # If 'brew tap' needs to be executed, check if it executed correctly. - if [[ -n "$TAP_VALUE" ]]; then + if [ -n "$TAP_VALUE" ]; then if ! brew_tap "$TAP_VALUE"; then print_error "$FORMULA_READABLE_NAME ('brew tap $TAP_VALUE' failed)" return 1 @@ -61,7 +60,7 @@ brew_install() # Install the specified formula. # shellcheck disable=SC2086 - if brew list "$FORMULA" &>/dev/null; then + if brew list "$FORMULA" >/dev/null 2>&1; then print_success "$FORMULA_READABLE_NAME" else execute "brew install $FORMULA $ARGUMENTS" \ diff --git a/script/bootstrap.sh b/script/bootstrap.sh index 75d6b10..9f0d376 100755 --- a/script/bootstrap.sh +++ b/script/bootstrap.sh @@ -244,6 +244,8 @@ main() "$DOT/homebrew/brew.sh" + "$DOT/git/install.sh" + "$DOT/fish/install.sh" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tmux/.tmux.conf.copy b/tmux/.tmux.conf.copy index b5b2df5..89bb2e0 100644 --- a/tmux/.tmux.conf.copy +++ b/tmux/.tmux.conf.copy @@ -35,6 +35,11 @@ bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel bind | split-window -h -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}" +bind-key J resize-pane -D +bind-key K resize-pane -U +bind-key H resize-pane -L +bind-key L resize-pane -R + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Install tpm if not already installed.