Browse Source

tmux: customize status bar, GUI bindings (Alt)

red-hat-laptop
Kevin Mok 5 years ago
parent
commit
f0824e5b9f
Signed by: Kevin-Mok GPG Key ID: AEA75288DC135CF5
  1. 2
      .chezmoiignore
  2. 4
      dot_config/fish/config.fish.tmpl
  3. 3
      dot_config/fish/functions/man-vim.fish
  4. 7
      dot_config/fish/functions/refresh-config.fish
  5. 17
      dot_config/i3/config.tmpl
  6. 8
      dot_config/i3blocks/i3blocks.conf.tmpl
  7. 151
      dot_tmux.conf.tmpl
  8. 3
      dot_vimrc.tmpl
  9. 34
      key_aliases.tmpl
  10. 3
      key_dirs.tmpl
  11. 2
      key_files.tmpl
  12. 2
      scripts/executable_vim-man
  13. 5
      txt/todo.md

2
.chezmoiignore

@ -1,6 +1,6 @@
README.md
{{ if .gui }}
{{ if not .gui }}
.config/i3/
.config/i3blocks/
.config/mpv/

4
dot_config/fish/config.fish.tmpl

@ -75,7 +75,6 @@ end
abbr ab "abbr"
abbr abe "abbr -e"
abbr rf "chezmoi apply && sync-shortcuts && source ~/.config/fish/key_abbr.fish > /dev/null"
abbr rfc "chezmoi apply && source ~/.config/fish/config.fish"
abbr xf "fish_config"
abbr f. "cd .."
@ -106,9 +105,10 @@ abbr grmb "git-delete-branch"
# ]]] git #
abbr hs "scan-history"
abbr hst "$EDITOR ~/.local/share/fish/fish_history"
abbr mt "math"
abbr mat "math"
abbr pgr "grep-pdf"
abbr pgrf "grep-pdf-file"
abbr rf "refresh-config"
abbr rs "redshift-set"
abbr shrm "shred-rm"
abbr thes "thesaurus"

3
dot_config/fish/functions/man-vim.fish

@ -0,0 +1,3 @@
function man-vim
nvim -c ":Man $argv[1]" -c "only"
end

7
dot_config/fish/functions/refresh-config.fish

@ -0,0 +1,7 @@
function refresh-config
chezmoi apply
and sync-shortcuts
and source ~/.config/fish/key_abbr.fish > /dev/null
and tmux source-file ~/.tmux.conf
and fish
end

17
dot_config/i3/config.tmpl

@ -135,7 +135,7 @@ bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
@ -241,18 +241,15 @@ bindsym shift+x kill
# backgrounds [[[ #
set $make_st_script "/home/kevin/st/make-st.sh"
# test
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
bindsym Control+$mod+q exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/editing") && $make_st_script
bindsym Control+$mod+w exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing") && $make_st_script
bindsym Control+$mod+z exec feh --bg-fill ~/Pictures/Backgrounds/dim/black.jpg
{{ else }}
bindsym $mod+q exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/editing") && $make_st_script
bindsym $mod+w exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing") && $make_st_script
# bindsym $mod+w exec ~/linux-config/scripts/bg-chooser
{{ end }}
bindsym $mod+r exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/editing") && $make_st_script
bindsym $mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/non-editing") && $make_st_script
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
bindsym Control+$mod+z exec feh --bg-fill ~/Pictures/Backgrounds/dim/black.jpg
{{ end }}
# ]]] backgrounds #
@ -352,8 +349,8 @@ set $ws15 "15"
# ws bindings [[[ #
bindsym $mod+h workspace prev
bindsym $mod+l workspace next
# bindsym $mod+h workspace prev
# bindsym $mod+l workspace next
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2

8
dot_config/i3blocks/i3blocks.conf.tmpl

@ -68,10 +68,10 @@ WIDTH=220
# sys.monitoring [[[ #
{{ if eq .chezmoi.fullHostname "nzxt" }}
[wifi]
label=
instance=wlp4s0
interval=10
# [wifi]
# label=
# instance=wlp4s0
# interval=10
[temperature]
label=

151
dot_tmux.conf.tmpl

@ -8,24 +8,25 @@ set-option -g prefix C-Space
bind-key C-Space send-prefix
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# clear rename prompt
bind-key , command-prompt "rename-window '%%'"
# ]]] #
# panes[[[
bind h split-window -h
bind v split-window -v
set -s escape-time 0
unbind '"'
unbind %
# vim-tmux-navigator[[[
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
{{ if .gui }}
bind v split-window -v
# ]]] #
{{ if .gui }}# [[[
bind-key , command-prompt "rename-session '%%'"
bind-key -n M-d detach
# panes [[[ #
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
@ -36,7 +37,35 @@ bind-key -T copy-mode-vi M-j select-pane -D
bind-key -T copy-mode-vi M-k select-pane -U
bind-key -T copy-mode-vi M-l select-pane -R
bind-key -T copy-mode-vi M-\ select-pane -l
{{ else }}
bind-key -n M-Enter split-window -h
# bind-key -n M-v split-window -h
bind-key -n M-q kill-pane
# ]]] panes #
# windows [[[ #
bind-key -n M-w new-window
bind x kill-window
bind-key -n M-a command-prompt "rename-window '%%'"
# bind-key , command-prompt "rename-window '%%'"
bind-key -n M-p previous-window
bind-key -n M-n next-window
bind-key -n C-S-[ swap-window -t -1
bind-key -n C-S-] swap-window -t +1
# ]]] windows #
bind-key -n M-c copy-mode
# ]]]
{{ else }}# [[[
# panes [[[ #
bind-key -n C-Left if-shell "$is_vim" "send-keys C-Left" "select-pane -L"
bind-key -n C-Down if-shell "$is_vim" "send-keys C-Down" "select-pane -D"
bind-key -n C-Up if-shell "$is_vim" "send-keys C-Up" "select-pane -U"
@ -47,13 +76,6 @@ bind-key -T copy-mode-vi C-Down select-pane -D
bind-key -T copy-mode-vi C-Up select-pane -U
bind-key -T copy-mode-vi C-Right select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
{{ end }}
# ]]]
# kill panes without confirmation
bind-key x kill-pane
bind-key & kill-window
# switch panes using Alt-arrow without prefix
# bind -n C-Down select-pane -D
@ -61,18 +83,105 @@ bind-key & kill-window
# bind -n C-Left select-pane -L
# bind -n C-l select-pane -R
bind h split-window -h
bind-key x kill-pane
# ]]] panes #
bind-key -n C-Left previous-window
bind-key -n C-Right next-window
bind-key & kill-window
{{ end }}# ]]]
# status bar [[[ #
#
# Powerline Double Cyan - Tmux Theme
# Created by Jim Myhrberg <contact@jimeh.me>.
#
# Inspired by vim-powerline: https://github.com/Lokaltog/powerline
#
# Requires terminal to be using a powerline compatible font, find one here:
# https://github.com/Lokaltog/powerline-fonts
#
# Status update interval
set -g status-interval 60
# Basic status bar colors
set -g status-style fg=colour240,bg=colour233
# Left side of status bar[[[
set -g status-left-style bg=colour233,fg=colour243
set -g status-left-length 40
# set -g status-left "#[fg=colour233,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]"
# set -g status-left "#[fg=colour233,bg=colour39,bold] #S:#P #[fg=colour39,bg=colour233,nobold]"
set -g status-left "#[fg=colour233,bg=colour240] #S #[fg=colour240,bg=colour235] #P #[fg=colour235,bg=colour233]"
# ]]]
# Right side of status bar[[[
set -g status-right-style bg=colour233,fg=colour243
set -g status-right-length 150
# set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour39,bg=colour240]#[fg=colour233,bg=colour39,bold] #H "
set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %a-%d-%m #[fg=colour39,bg=colour240]"
# ]]]
# Window status
set -g window-status-format " #I:#W#F "
set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour81,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]"
# Current window status
set -g window-status-current-style bg=colour39,fg=colour235
# Window with activity status
set -g window-status-activity-style bg=colour233,fg=colour245
# Window separator
set -g window-status-separator ""
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-style bg=default,fg=colour238
# Active pane border
set -g pane-active-border-style bg=default,fg=colour39
# Pane number indicator
set -g display-panes-colour colour233
set -g display-panes-active-colour colour245
# Clock mode
set -g clock-mode-colour colour39
set -g clock-mode-style 24
# Message
set -g message-style bg=colour39,fg=black
# Command message
set -g message-command-style bg=colour233,fg=black
# Mode
set -g mode-style bg=colour39,fg=colour232
# ]]] status bar #
# plugins [[[
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/double/blue'
# set -g @plugin 'jimeh/tmux-themepack'
# set -g @themepack 'powerline/double/blue'
set -g @plugin 'christoomey/vim-tmux-navigator'
run -b '~/.tmux/plugins/tpm/tpm'
# ]]] plugins #
# vim: fdm=marker ft=tmux.go-template

3
dot_vimrc.tmpl

@ -363,7 +363,8 @@ nnoremap <leader>l Vgq
" format this and next line
nnoremap <leader>ll Vjgq
" move cursor to middle of line
nnoremap <leader>m :call cursor(0, len(getline('.'))/2)<CR>
" nnoremap <leader>m :call cursor(0, len(getline('.'))/2)<CR>
nnoremap <leader>m :vert Man
" apply normal command to selection
vnoremap <leader>n q:anorm
nnoremap <leader>nt :NERDTree<CR>

34
key_aliases.tmpl

@ -30,7 +30,7 @@ mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
b "bat"
ba "bat *"
grep "grep --color=auto -n"
grr "grep -r"
grpr "grep -r"
# pk "pkill -f"
cld "colordiff -wy --suppress-common-lines"
@ -77,6 +77,7 @@ ll "lsd -al"
l "ls -a"
ll "ls -al"
{{ end }}
cwd "echo (pwd) | xclip -selection clipboard"
smv "sudo mv"
f "cd"
fz "fzf"
@ -183,7 +184,9 @@ xpk "pkg list-installed | awk -F/ '{print \$1}' > ~/{{ .chezmoi.os }}-config/txt
# ]]] pkg management #
py "python"
pyt "pytest -vv"
# pyt "printf '\033c' && pytest -vvs"
pyt "clear && tmux clear-history && pytest -vvs"
pyts "clear && tmux clear-history && pytest -vv"
pyu "python -m unittest"
pipi "pip install"
spipi "sudo pip install"
@ -224,13 +227,14 @@ kd "killall Discord && killall Discord && killall slack"
kt "killall thunderbird"
mp "mpv --volume=50"
mra "man ranger"
mt "minetest"
n "nvim"
p3 "python3"
pdft "pdftotext"
pipes "pipes.sh -t 3"
py "python"
r "ranger"
rg "printf '\033c' && rg"
rgc "printf '\033c' && rg"
rx "redshift -x"
sn "sudo nvim"
# sw "swex"
@ -289,6 +293,8 @@ wt "watson status"
# git [[[ #
g "git"
gi "git init"
gib "git init --bare"
gstr "git config credential.helper store"
gstrp "git config credential.helper store && git push"
@ -300,6 +306,9 @@ gba "git branch --no-merged && echo '' && git branch --merged"
gbu "git branch --no-merged"
gbm "git branch --merged"
gsm "git submodule add"
gsmp "git submodule foreach git pull"
gmg "git merge"
gmgt "git mergetool"
@ -345,11 +354,14 @@ gsl "git shortlog"
gcln "git clone"
gs "git status -u"
gf "git fetch origin"
gcho "git checkout"
gchon "git checkout -b"
gchom "git checkout master"
gch "git checkout"
gchn "git checkout -b"
gchm "git checkout master"
gchnw "git checkout -b wip"
gchw "git checkout wip"
gchfh "git checkout HEAD --"
grom "git reset --hard origin/master"
gheadm1 "git reset --hard HEAD~1"
# show files in git repo
@ -528,6 +540,16 @@ jr "java -cp \"$CLASSPATH:out\""
# 263
wl6 "watson log --all --project=263 --tag=a3"
wr6 "watson report --all --project=263 --tag=a3"
z6 "zathura --fork ~/school/263/Introduction-to-Algorithms-CLRs/Introduction\ to\ Algorithms\ -\ 3rd\ Edition.pdf"
pd3 "pdflatex a3"
# ]]] school #
# games [[[ #
mtc "minetestserver --gameid minetest --worldname Creative --terminal"
mth "minetestserver --gameid minetest --worldname Hevin --config hevin.conf --terminal"
mtt "minetestserver --gameid minimal --worldname Test --terminal"
# mtrsy "rsync -vr .minetest/ /mnt/linux-files/.minetest/"
# ]]] games #

3
key_dirs.tmpl

@ -85,4 +85,5 @@ al1 ~/school/algorithms/w1-union-find
# ]]] sch #
pk /home/kevin/Downloads/gba/mgba/pokemon/emerald/1
mtd ~/.minetest
pk ~/Downloads/gba/mgba/pokemon/emerald/1

2
key_files.tmpl

@ -63,3 +63,5 @@ wt ~/.config/watson/state.tmp
# ]]] 309 #
# ]]] sch #
mta ~/.minetest/mods/custom_aliases/init.lua

2
scripts/executable_vim-man

@ -1,4 +1,4 @@
#!/bin/bash
man_choice=$(apropos . | awk '{ print $1 }' | dmenu -i)
nvim -c ":Man $man_choice" -c "resize 100"
nvim -c ":Man $man_choice" -c "only"

5
txt/todo.md

@ -1,3 +1,7 @@
- tmux keybindings
- rename session/window
- detach
- suckless
- dwm
- layout
@ -12,4 +16,3 @@
- scripts
- copy sync-shortcut
- YCM
Loading…
Cancel
Save