Skip to content

Instantly share code, notes, and snippets.

@akiomik
Created January 13, 2013 12:54
Show Gist options
  • Select an option

  • Save akiomik/4523945 to your computer and use it in GitHub Desktop.

Select an option

Save akiomik/4523945 to your computer and use it in GitHub Desktop.
[vim][vi][tmux][zsh]tmuxのステータスをpowerlineっぽくしてzshのviモードを使いやすくする
function zle-line-init zle-keymap-select {
vimode="${${KEYMAP/vicmd/NORMAL}/(main|viins)/INSERT}"
# update status line
if [ -n "$TMUX" ]; then
# tmux
if [ $vimode = "NORMAL" ]; then
statbg="colour236"
statfg="colour247"
statl1bg="colour240"
statl1fg="colour231"
statl2bg="colour148"
statl2fg="colour22"
statr1bg="colour240"
statr1fg="colour247"
statr2bg="colour252"
statr2fg="colour236"
else
statbg="colour24"
statfg="colour117"
statl1bg="colour31"
statl1fg="colour231"
statl2bg="colour231"
statl2fg="colour23"
statr1bg="colour31"
statr1fg="colour117"
statr2bg="colour117"
statr2fg="colour23"
fi
tmux set -g status-bg ${statbg} > /dev/null
tmux set -g status-fg ${statfg} > /dev/null
statl1="#[bg=${statl1bg}, fg=${statl1fg}] #H "
statl1a="#[bg=${statbg}, fg=${statl1bg}]⮀"
statl2="#[bg=${statl2bg}, fg=${statl2fg}] $vimode "
statl2a="#[bg=${statl1bg}, fg=${statl2bg}]⮀"
tmux set -g status-left "${statl2}${statl2a}${statl1}${statl1a}" > /dev/null
statr1="#[bg=${statr1bg}, fg=${statr1fg}] #($HOME/.battery) "
statr1a="#[bg=${statbg}, fg=${statr1bg}]⮂"
statr2="#[bg=${statr2bg}, fg=${statr2fg}] %Y-%m-%d(%a) %H:%M "
statr2a="#[bg=${statr1bg}, fg=${statr2bg}]⮂"
tmux set -g status-right "${statr1a}${statr1}${statr2a}${statr2}" > /dev/null
else
# zsh
showmode $vimode
fi
}
zle -N zle-line-init
zle -N zle-keymap-select
@ron813c
Copy link
Copy Markdown

ron813c commented Jan 18, 2013

Samsun Install g

@ron813c
Copy link
Copy Markdown

ron813c commented Jan 22, 2013

Finish Roooting galaxy s3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment