♻️ Continuing to move to fish and/or be distracted
This commit is contained in:
parent
1ede53da1d
commit
6b38765a23
6 changed files with 103 additions and 14 deletions
16
README.md
16
README.md
|
@ -1,7 +1,21 @@
|
|||
# dotfiles
|
||||
|
||||
mar does dotfiles
|
||||
|
||||
## Sources
|
||||
# post install
|
||||
|
||||
Set iTerm2 to use the preferences file, if applicable.
|
||||
|
||||
## tmux
|
||||
|
||||
```fish
|
||||
tmux attach || tmux new -s main
|
||||
sudo ln -s ~/.tmux/plugins/tmux-open-nvim/scripts/ton /usr/local/bin/ton
|
||||
```
|
||||
`<ctrl-a I>` to install plugins.
|
||||
|
||||
## 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/)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
. "$DOT/homebrew/brew_utils.sh"
|
||||
|
||||
brew_install "Github CLI" "gh"
|
||||
brew_install "Gitmoji" "gitmoji"
|
59
homebrew/brew_utils
Normal file
59
homebrew/brew_utils
Normal file
|
@ -0,0 +1,59 @@
|
|||
#!/user/bin/env fish
|
||||
|
||||
source "$DOT/script/utils"
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
function brew_prefix
|
||||
set -f path (brew --prefix 2>/dev/null)
|
||||
|
||||
if [ -n $path ]
|
||||
printf '%s' "$path"
|
||||
return 0
|
||||
else
|
||||
print_error "Homebrew (get prefix)"
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
function brew_tap
|
||||
brew tap "$argv[1]" &>/dev/null
|
||||
end
|
||||
|
||||
function brew_update
|
||||
execute "brew update" "Homebrew (update)"
|
||||
end
|
||||
|
||||
function brew_upgrade
|
||||
execute "brew upgrade" "Homebrew (upgrade)"
|
||||
end
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
function brew_install
|
||||
set -f formula_readable_name $argv[1]
|
||||
set -f formula $argv[2]
|
||||
set -f arguments $argv[3]
|
||||
set -f tap_value $argv[4]
|
||||
|
||||
# Check that Homebrew is installed
|
||||
if ! cmd_exists "brew"
|
||||
print_error "$formula_readable_name ('Homebrew' is not installed)"
|
||||
end
|
||||
|
||||
# If 'brew tap' needs to be executed, check if it executed correctly.
|
||||
if [ -n "$tap_value"]
|
||||
if ! brew_tap "$tap_value"
|
||||
print_error "$formula_readable_name ('brew tap $tap_value' failed)"
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
# Install the formula.
|
||||
if brew list "$formula" &>/dev/null
|
||||
print_success "$formula_readable_name"
|
||||
else
|
||||
execute "brew install $formula $arguments" \
|
||||
"$formula_readable_name"
|
||||
end
|
||||
end
|
0
homebrew/os/pref.sh
Executable file
0
homebrew/os/pref.sh
Executable file
|
@ -81,7 +81,12 @@ function link_file
|
|||
mkdir -p (string replace -r '\/[^\/]+$' '' "$dst")
|
||||
end
|
||||
|
||||
ln -s "$src" "$dst" &> /dev/null
|
||||
if string match -e '.hardlink' "$src" &> /dev/null
|
||||
ln "$src" "$dst" &> /dev/null
|
||||
else
|
||||
ls -s "$src" "$dst" &> /dev/null
|
||||
end
|
||||
|
||||
print_success "Linked $src to $dst"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,10 @@ set -g @plugin 'tmux-plugins/tpm'
|
|||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
set -g @plugin 'Morantron/tmux-fingers'
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# catppuccin
|
||||
set -g @catppuccin_flavour 'mocha'
|
||||
|
||||
|
@ -27,18 +31,31 @@ set -g @catppuccin_directory_text "#{pane_current_path}"
|
|||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Remap prefix.
|
||||
unbind C-b
|
||||
set-option -g prefix C-a
|
||||
bind-key C-a send-prefix
|
||||
|
||||
# Vi copy mode.
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||
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}"
|
||||
# Better split commands.
|
||||
bind | split-window -h -c "#{pane_current_path}" # cmd-| in iTerm2
|
||||
bind - split-window -v -c "#{pane_current_path}" # cmd-- in iTerm2
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
bind-key J resize-pane -D
|
||||
bind-key K resize-pane -U
|
||||
bind-key H resize-pane -L
|
||||
bind-key L resize-pane -R
|
||||
# Vi-like resizing.
|
||||
bind-key j resize-pane -D # cmd-j in iTerm2
|
||||
bind-key k resize-pane -U # cmd-k in iTerm2
|
||||
bind-key h resize-pane -L # cmd-h in iTerm2
|
||||
bind-key l resize-pane -R # cmd-l in iTerm2
|
||||
|
||||
# Easy reload config.
|
||||
bind r source-file ~/.tmux.conf
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
Loading…
Reference in a new issue