Git abbreviations, new tmux bindings

This commit is contained in:
Joseph Ferano 2020-11-19 03:00:30 +07:00
parent da83aef72e
commit 8fb6a726b5
5 changed files with 76 additions and 21 deletions

View File

@ -34,8 +34,8 @@ window:
# Blank space added around the window in pixels. This padding is scaled # Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides. # by DPI and the specified value is always added at both opposing sides.
padding: padding:
x: 0 x: 2
y: 0 y: 2
# Spread additional padding evenly around the terminal content. # Spread additional padding evenly around the terminal content.
#dynamic_padding: true #dynamic_padding: true
@ -136,7 +136,7 @@ font:
#style: Bold Italic #style: Bold Italic
# Point size # Point size
size: 11.0 size: 10.0
# Offset is the extra space around each character. `offset.y` can be thought of # Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing. # as modifying the line spacing, and `offset.x` as modifying the letter spacing.
@ -252,7 +252,7 @@ custom_cursor_colors: true
# #
# Window opacity as a floating point number from `0.0` to `1.0`. # Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque. # The value `0.0` is completely transparent and `1.0` is opaque.
background_opacity: 0.75 background_opacity: 1
#selection: #selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"

View File

@ -1,10 +1,11 @@
set -g fish_user_paths $fish_user_paths ~/bin ~/.cargo/bin ~/.local/bin set -g fish_user_paths $fish_user_paths ~/bin ~/.cargo/bin ~/.local/bin
set -g MANPAGER "sh -c 'col -bx | bat -l man -p'" set -g MANPAGER "sh -c 'col -bx | bat -l man -p'"
set EDITOR vi set EDITOR vim
set -U FZF_COMPLETE 0 set -U FZF_COMPLETE 0
set -U FZF_LEGACY_KEYBINDINGS 0 set -U FZF_LEGACY_KEYBINDINGS 0
set -U FZF_DEFAULT_OPTS "--height 40% --reverse --border" set -U FZF_DEFAULT_OPTS "--height 40% --reverse --border"
set -g DISPLAY (cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
source ~/.config/fish/dircolors.fish source ~/.config/fish/dircolors.fish
source ~/.config/fish/marks.fish source ~/.config/fish/marks.fish
@ -22,6 +23,48 @@ alias lc "exa -1 --group-directories-first"
alias lt "exa -l --sort=modified" alias lt "exa -l --sort=modified"
alias vi "vim -u ~/.vimrc.basic" alias vi "vim -u ~/.vimrc.basic"
# git
abbr -a -g gs "git status --untracked-files"
abbr -a -g gl "git lop -10"
abbr -a -g gll "git lol -15"
abbr -a -g glp "git lfs pull"
abbr -a -g glm "gss git merge ; glp"
abbr -a -g ga "git add"
abbr -a -g gch "git checkout"
abbr -a -g gchm "git checkout master"
abbr -a -g gchb "git checkout -b"
abbr -a -g gd "git diff"
abbr -a -g gdh "git diff HEAD"
abbr -a -g gm "git merge"
abbr -a -g gms "git merge --squash"
abbr -a -g gb "git branch"
abbr -a -g gba "git branch -a"
abbr -a -g gf "git fetch"
abbr -a -g gr "git rebase"
abbr -a -g gc "git commit"
abbr -a -g gcm "git commit -m"
abbr -a -g gcau "git commit --author"
abbr -a -g gcam "git commit -am"
abbr -a -g ga "git add"
abbr -a -g gaa "git add -A"
abbr -a -g gpl "git pull"
abbr -a -g gp "git push"
abbr -a -g gpd "git push -d origin"
abbr -a -g gpu "git push -u origin"
abbr -a -g gpr "git remote prune origin"
abbr -a -g grh "git reset --hard"
abbr -a -g gcl "git clean -fd"
abbr -a -g gst "git stash"
abbr -a -g gsl "git stash list"
abbr -a -g gsp "git stash pop"
abbr -a -g gsu "git submodule update"
abbr -a -g glom "git lop -10 origin/master"
abbr -a -g gmom "git merge origin/master"
abbr -a -g gmm "git merge master"
abbr -a -g gss "env GIT_LFS_SKIP_SMUDGE=1"
alias xdg-open wsl-open alias xdg-open wsl-open
alias dotfiles "git --git-dir=$HOME/.dotfiles --work-tree=$HOME" alias dotfiles "git --git-dir=$HOME/.dotfiles --work-tree=$HOME"

View File

@ -1,3 +1,4 @@
# Copy path to file to windows path
function cw function cw
set -l wpath (wslpath -a -w (readlink -f "$argv[1]")) set -l wpath (wslpath -a -w (readlink -f "$argv[1]"))
echo Copied \"$wpath\" to clipboard echo Copied \"$wpath\" to clipboard

View File

@ -1,3 +1,4 @@
# Copy a windows path to clipboard
function w2u function w2u
set -l wpath (wslpath "$argv[1]") set -l wpath (wslpath "$argv[1]")
echo Copied \"$wpath\" to clipboard echo Copied \"$wpath\" to clipboard

View File

@ -20,14 +20,13 @@ unbind Left
unbind Right unbind Right
unbind Up unbind Up
unbind Down unbind Down
unbind [
bind C-s send-prefix bind C-s send-prefix
bind r source-file ~/.tmux.conf \; display "config reloaded" bind r source-file ~/.tmux.conf \; display "config reloaded"
bind v split-window -h -c '#{pane_current_path}' bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}' bind s split-window -v -c '#{pane_current_path}'
bind X confirm-before -p "kill-window #W? (y/n)" kill-window bind X confirm-before -p "kill-window #W? (y/n)" kill-window
bind n switch-client -n
bind p switch-client -p
bind \; command-prompt bind \; command-prompt
bind o if-shell '[ #{pane_index} = 1 ]' \ bind o if-shell '[ #{pane_index} = 1 ]' \
'last-pane ; swap-pane -dt 1' \ 'last-pane ; swap-pane -dt 1' \
@ -52,20 +51,31 @@ bind -n C-k select-pane -U
bind -n C-l select-pane -R bind -n C-l select-pane -R
bind -n C-S-Left swap-window -t -1 \; previous-window bind -n C-S-Left swap-window -t -1 \; previous-window
bind -n C-S-Right swap-window -t +1 \; next-window bind -n C-S-Right swap-window -t +1 \; next-window
bind -n M-0 select-window -t :=0 # bind -n M-1 select-window -t :=1
bind -n M-1 select-window -t :=1 # bind -n M-2 select-window -t :=2
bind -n M-2 select-window -t :=2 # bind -n M-3 select-window -t :=3
bind -n M-3 select-window -t :=3 # bind -n M-4 select-window -t :=4
bind -n M-4 select-window -t :=4 # bind -n M-5 select-window -t :=5
bind -n M-5 select-window -t :=5 # bind -n M-6 select-window -t :=6
bind -n M-6 select-window -t :=6 # bind -n M-7 select-window -t :=7
bind -n M-7 select-window -t :=7 # bind -n M-8 select-window -t :=8
bind -n M-8 select-window -t :=8 # bind -n M-9 select-window -t :=9
bind -n M-9 select-window -t :=10 bind -n F1 select-window -t :=1
bind -n F2 select-window -t :=2
bind -n F3 select-window -t :=3
bind -n F4 select-window -t :=4
bind -n F5 select-window -t :=5
bind -n F6 select-window -t :=6
bind -n F7 select-window -t :=7
bind -n F8 select-window -t :=8
bind -n F9 select-window -t :=9
bind -n M-l next-window bind -n M-l next-window
bind -n M-h previous-window bind -n M-h previous-window
bind -n M-k send-keys C-l bind -n M-k send-keys C-l
bind -n M-Space resize-pane -Z bind -n M-m resize-pane -Z
bind -n M-n switch-client -n
bind -n M-p switch-client -p
bind -n M-i copy-mode
set -g status-position top set -g status-position top
set -g status-justify centre set -g status-justify centre
@ -77,10 +87,10 @@ set -g status-right '#[bg=cyan] %H:%M #[bg=green] %A, %e %b %Y '
set -g status-left-length 100 set -g status-left-length 100
# set -g window-style 'fg=colour248,bg=colour233' # set -g window-style 'fg=colour248,bg=colour233'
set -g window-style 'fg=colour248,bg=black' set -g window-style 'fg=colour248,bg=colour235'
set -g window-active-style 'fg=colour255,bg=colour236' set -g window-active-style 'fg=colour255,bg=colour236'
set -g pane-border-style 'fg=colour235,bg=default' set -g pane-border-style 'fg=colour244,bg=colour235'
set -g pane-active-border-style 'fg=white,bg=default' set -g pane-active-border-style 'fg=colour244,bg=colour235'
set -g @resurrect-capture-pane-contents 'on' set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes 'ranger' set -g @resurrect-processes 'ranger'