tmux updates

This commit is contained in:
Noah Masur 2020-07-27 13:00:26 -04:00
parent 5f063ed497
commit 11ecc5bd5e
7 changed files with 134 additions and 30 deletions

View File

@ -366,7 +366,7 @@ shell:
args:
- --login
- --init-command
- tmux
- tmux a -t noah || tmux new -s noah
# Startup directory
#
@ -589,7 +589,8 @@ shell:
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
key_bindings:
- { key: F, mods: Option, action: ToggleSimpleFullscreen }
- { key: F, mods: Super, action: ToggleSimpleFullscreen }
- { key: A, mods: Super, chars: "\x02" }
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }

View File

@ -32,6 +32,8 @@ if status --is-interactive
# Individual features
pyenv
notes
aws
# Use `starship` prompt
starship init fish | source

View File

@ -0,0 +1,8 @@
#!/usr/bin/local/fish
function aws --description "AWS bindings"
function unsetaws --description "Clear AWS credentials environment variables"
set -e AWS_ACCESS_KEY_ID
set -e AWS_SECRET_ACCESS_KEY
end
end

View File

@ -0,0 +1,18 @@
#!/usr/local/bin/fish
function notes --description "Notes functions"
function journal --description "Create today's journal"
set today (date -j +"%Y-%m-%d_%a")
set today_journal $HOME/Documents/notes/journal/$today.md
if [ -f $today_journal ]
echo "Already exists."
else
set yesterday (date -jv "-1d" +"%Y-%m-%d_%a")
set tomorrow (date -jv "+1d" +"%Y-%m-%d_%a")
printf "[[journal/$yesterday|Previous]] - [[calendar|Index]] - [[journal/$tomorrow|Next]]\n\n---\n\n # Tasks\n\n\n# Log\n\n\n# Communication\n\n---\n\n# Meetings\n\n" > $today_journal
echo "New journal added."
end
end
end

View File

@ -7,14 +7,16 @@ colorscheme gruvbox " Installed in autoload/ and colors/
set number " Show line numbers
set relativenumber " Relative numbers instead of absolute
set expandtab " Tabs into spaces
set shiftwidth=4 "
set softtabstop=4 "
set shiftwidth=4 " Amount to shift with > key
set softtabstop=4 " Amount to shift with TAB key
set ignorecase " Ignore case when searching
set smartcase " Check case when using capitals in search
set incsearch " Search while typing
set pastetoggle=<F3>
set visualbell
set clipboard+=unnamedplus " Uses system clipboard for yanking
" Remember last position
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
@ -24,7 +26,7 @@ endif
let g:terraform_align=1
let g:terraform_remap_spacebar=1
" line type
" Line type
let &t_ti.="\e[1 q"
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"

23
tmux/gitmux.conf.symlink Normal file
View File

@ -0,0 +1,23 @@
tmux:
symbols:
branch: '⎇ '
hashprefix: ':'
ahead: ↑·
behind: ↓·
staged: '● '
conflict: '✖ '
modified: '✚ '
untracked: '… '
stashed: '⚑ '
clean: ✔
styles:
state: '#[fg=red,bold]'
branch: '#[fg=red,bold]'
remote: '#[fg=colour239]'
staged: '#[fg=green,bold]'
conflict: '#[fg=red,bold]'
modified: '#[fg=red,bold]'
untracked: '#[fg=magenta,bold]'
stashed: '#[fg=cyan,bold]'
clean: '#[fg=green,bold]'
layout: [remote, ' ', flags]

View File

@ -1,17 +1,11 @@
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
# Remap prefix to Control + space
set -g prefix C-space
bind C-space send-prefix
#unbind C-b
#set -g prefix C-space
#bind C-space send-prefix
# Keep plenty of history for scrollback
set -g history-limit 100000
# Upgrade colors
#set -g default-terminal "screen-256color"
# Remove delay for entering copy mode
set-option -sg escape-time 0
@ -19,27 +13,83 @@ set-option -sg escape-time 0
bind \\ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# Status bar
set -g status-interval 2
set -g status-right-length 59
set -g renumber-windows on
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-option -g status-position bottom
# Move between panes with vi keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Copy mode works as Vim
bind Escape copy-mode
bind C-[ copy-mode
bind p paste-buffer
# Vi-style scrollback with prefix + C-[
set-window-option -g mode-keys vi
# Use v to trigger selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
# Use y to yank current selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Enable mouse mode
set -g mouse on
# Status bar
set -g status-interval 10 # Seconds between refreshes
set -g renumber-windows on
set-option -g base-index 1 # Set 1 for first window (easier to type)
set-window-option -g pane-base-index 1 # Set 1 for first pane (easier to type)
set-option -g status-position bottom
################################
## COLORSCHEME: gruvbox dark
set-option -g status "on"
# Default statusbar color
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
# Default window title colors
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
# Default window with an activity alert
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
# Active window title colors
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
# Pane border
set-option -g pane-active-border-style fg=colour250 #fg2
set-option -g pane-border-style fg=colour237 #bg1
# Message infos
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
# Writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# Pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# Clock
set-window-option -g clock-mode-colour colour109 #blue
# Bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
# Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-justify "left"
set-option -g status-left-style none
set-option -g status-left-length "80"
set-option -g status-right-style none
set-option -g status-right-length "80"
set-window-option -g window-status-separator ""
set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]"
set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248] #(gitmux -cfg .gitmux.conf '#{pane_current_path}')"
set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I #[fg=colour239, bg=colour214, bold] #W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]"
set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]"