More Powerline[-Shell] & Solarized integration
This commit is contained in:
parent
9f5e86de4a
commit
e8a156fbaa
4 changed files with 58 additions and 15 deletions
33
bashrc
33
bashrc
|
@ -38,14 +38,41 @@ else
|
||||||
|
|
||||||
function prompt_callback {
|
function prompt_callback {
|
||||||
REPO=$(git remote -v | sed -r 's/^origin.*\/(.*)\ .*/\1/' | head -1)
|
REPO=$(git remote -v | sed -r 's/^origin.*\/(.*)\ .*/\1/' | head -1)
|
||||||
gp_set_window_title "$REPO($GIT_BRANCH)"
|
tmux_title "$REPO($GIT_BRANCH)"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYVERSION=$(python3 --version | grep -Eo '[0-9]\.[0-9]')
|
PYVERSION=$(python3 --version | grep -Eo '[0-9]\.[0-9]')
|
||||||
if [ -f /usr/local/lib/python${PYVERSION}/dist-packages/powerline/bindings/bash/powerline.sh ]; then
|
if [ -f $HOME/.venv/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh ]; then
|
||||||
source /usr/local/lib/python${PYVERSION}/dist-packages/powerline/bindings/bash/powerline.sh
|
export VIRTUAL_ENV="$HOME/.venv"
|
||||||
|
export PATH=$VIRTUAL_ENV/bin:$PATH
|
||||||
|
# powerline-daemon -q
|
||||||
|
POWERLINE_BASH_CONTINUATION=1
|
||||||
|
POWERLINE_BASH_SELECT=1
|
||||||
|
|
||||||
|
function _update_ps1() {
|
||||||
|
if git log --oneline -n1 &>/dev/null ; then
|
||||||
|
REPO=$(git remote -v | sed -r 's/^origin.*\/(.*)\ .*/\1/' | sed 's/.git$//'| head -1)
|
||||||
|
BRANCH=$(git branch --show-current)
|
||||||
|
tmux_title "$REPO($BRANCH)"
|
||||||
|
else
|
||||||
|
tmux_title "$(hostname)"
|
||||||
|
fi
|
||||||
|
PS1=$(powerline-shell $?)
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
|
||||||
|
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# source $HOME/.venv/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh
|
||||||
|
elif [ -f ~/.local/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh ] ; then
|
||||||
|
#source ~/.local/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh
|
||||||
|
echo no
|
||||||
|
elif [ -f /usr/local/lib/python${PYVERSION}/dist-packages/powerline/bindings/bash/powerline.sh ]; then
|
||||||
|
source /usr/local/lib/python${PYVERSION}/dist-packages/powerline/bindings/bash/powerline.sh
|
||||||
fi
|
fi
|
||||||
|
set +x
|
||||||
|
|
||||||
# LS_COLORS
|
# LS_COLORS
|
||||||
eval $(dircolors -b $HOME/.dircolors)
|
eval $(dircolors -b $HOME/.dircolors)
|
||||||
|
|
2
setup.sh
2
setup.sh
|
@ -20,7 +20,7 @@ done
|
||||||
|
|
||||||
# Install powerline if possible
|
# Install powerline if possible
|
||||||
if which pip3 ; then
|
if which pip3 ; then
|
||||||
pip3 install -U -r requirements.txt
|
pip3 install --user -U -r requirements.txt
|
||||||
else
|
else
|
||||||
[ ! -d ~/.bash-git-prompt ] && git clone https://github.com/nold360/bash-git-prompt.git ~/.bash-git-prompt
|
[ ! -d ~/.bash-git-prompt ] && git clone https://github.com/nold360/bash-git-prompt.git ~/.bash-git-prompt
|
||||||
fi
|
fi
|
||||||
|
|
18
tmux.conf
18
tmux.conf
|
@ -5,7 +5,7 @@ set -g prefix C-a
|
||||||
bind C-a send-prefix
|
bind C-a send-prefix
|
||||||
|
|
||||||
## Default is 'screen'
|
## Default is 'screen'
|
||||||
set -sg default-terminal 'screen-16color'
|
set -sg default-terminal 'screen-256color'
|
||||||
set -sg escape-time 1
|
set -sg escape-time 1
|
||||||
set -sg set-clipboard on
|
set -sg set-clipboard on
|
||||||
set -g history-limit 100000
|
set -g history-limit 100000
|
||||||
|
@ -22,24 +22,24 @@ set -g status-justify left
|
||||||
set -g status-interval 1
|
set -g status-interval 1
|
||||||
set -g status-left-length 20
|
set -g status-left-length 20
|
||||||
set -g status-right-length 30
|
set -g status-right-length 30
|
||||||
set -g status-right ' ⡇ #h ⣿'
|
set -g status-right '#[fg=black, bg=yellow] #h '
|
||||||
#set -g status-right '#(eval ~/bin/tmux-airline `tmux display -p "#{client_width}"`)'
|
#set -g status-right '#(eval ~/bin/tmux-airline `tmux display -p "#{client_width}"`)'
|
||||||
set -g status-left '⣿ '
|
set -g status-left ''
|
||||||
|
|
||||||
set -g set-titles on
|
set -g set-titles on
|
||||||
set -g set-titles-string '#T'
|
set -g set-titles-string '#T'
|
||||||
setw -g allow-rename off
|
setw -g allow-rename off
|
||||||
setw -g automatic-rename on
|
setw -g automatic-rename on
|
||||||
setw -g automatic-rename-format '#T'
|
setw -g automatic-rename-format '#T'
|
||||||
setw -g window-status-format '⡇[#I]#{=120:window_name} ⡇'
|
setw -g window-status-format ' #I #{=120:window_name} '
|
||||||
setw -g window-status-current-format ' *#{=120:window_name}* '
|
setw -g window-status-current-format ' #I #{=120:window_name} #[fg=yellow, bg=black]'
|
||||||
set-window-option -g window-status-current-attr bold
|
#set-window-option -g window-status-current-attr bold
|
||||||
#setw -g window-status-format '/ #I:#P #{=120:window_name} |#F \'
|
#setw -g window-status-format '/ #I:#P #{=120:window_name} |#F \'
|
||||||
#setw -g window-status-current-format '/ #I:#P #{=120:window_name} |#F \'
|
#setw -g window-status-current-format '/ #I:#P #{=120:window_name} |#F \'
|
||||||
setw -g window-status-separator ''
|
setw -g window-status-separator ''
|
||||||
|
|
||||||
set -g bell-action current
|
set -g bell-action current
|
||||||
set -g bell-on-alert off
|
#set -g bell-on-alert off
|
||||||
setw -g monitor-activity on
|
setw -g monitor-activity on
|
||||||
set -g visual-activity off
|
set -g visual-activity off
|
||||||
set -g visual-bell off
|
set -g visual-bell off
|
||||||
|
@ -111,8 +111,8 @@ set-window-option -g window-status-bg default
|
||||||
#set-window-option -g window-status-attr dim
|
#set-window-option -g window-status-attr dim
|
||||||
|
|
||||||
# active window title colors
|
# active window title colors
|
||||||
set-window-option -g window-status-current-fg white
|
set-window-option -g window-status-current-fg black
|
||||||
set-window-option -g window-status-current-bg '#00AA0E'
|
set-window-option -g window-status-current-bg yellow
|
||||||
#set-window-option -g window-status-current-attr bright
|
#set-window-option -g window-status-current-attr bright
|
||||||
|
|
||||||
# pane border
|
# pane border
|
||||||
|
|
20
vimrc
20
vimrc
|
@ -10,6 +10,7 @@ Plugin 'altercation/vim-colors-solarized'
|
||||||
Plugin 'scrooloose/nerdtree'
|
Plugin 'scrooloose/nerdtree'
|
||||||
Plugin 'vim-syntastic/syntastic'
|
Plugin 'vim-syntastic/syntastic'
|
||||||
Plugin 'farmergreg/vim-lastplace.git'
|
Plugin 'farmergreg/vim-lastplace.git'
|
||||||
|
Plugin 'yggdroot/indentline'
|
||||||
call vundle#end() " required
|
call vundle#end() " required
|
||||||
filetype plugin indent on " required
|
filetype plugin indent on " required
|
||||||
"
|
"
|
||||||
|
@ -55,7 +56,7 @@ hi Search guibg=lightRed
|
||||||
" ------------------------------------ Colors / Theme -------------------------------------------
|
" ------------------------------------ Colors / Theme -------------------------------------------
|
||||||
let g:solarized_visibility = "high"
|
let g:solarized_visibility = "high"
|
||||||
let g:solarized_contrast = "high"
|
let g:solarized_contrast = "high"
|
||||||
let g:solarized_termcolors = 256
|
"let g:solarized_termcolors = 256
|
||||||
colorscheme solarized
|
colorscheme solarized
|
||||||
|
|
||||||
augroup CursorLine
|
augroup CursorLine
|
||||||
|
@ -74,12 +75,23 @@ map <C-n> :NERDTreeToggle<CR>
|
||||||
nnoremap <C-V> <C-W><C-V>
|
nnoremap <C-V> <C-W><C-V>
|
||||||
|
|
||||||
" ------------------------------------ AirLine -------------------------------------------
|
" ------------------------------------ AirLine -------------------------------------------
|
||||||
let g:airline_theme='badwolf'
|
let g:airline_theme='solarized'
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
let g:airline#extensions#tabline#enabled = 1
|
||||||
"let g:airline#extensions#tabline#left_sep = ' '
|
"let g:airline#extensions#tabline#left_sep = ' '
|
||||||
"let g:airline#extensions#tabline#left_alt_sep = '|'
|
"let g:airline#extensions#tabline#left_alt_sep = '|'
|
||||||
"let g:airline#extensions#tabline#formatter = 'default'
|
"let g:airline#extensions#tabline#formatter = 'default'
|
||||||
|
|
||||||
|
" powerline symbols
|
||||||
|
let g:airline_symbols = {}
|
||||||
|
let g:airline_left_sep = ''
|
||||||
|
let g:airline_left_alt_sep = ''
|
||||||
|
let g:airline_right_sep = ''
|
||||||
|
let g:airline_right_alt_sep = ''
|
||||||
|
let g:airline_symbols.branch = ''
|
||||||
|
let g:airline_symbols.readonly = ''
|
||||||
|
let g:airline_symbols.linenr = '☰'
|
||||||
|
let g:airline_symbols.maxlinenr = ''
|
||||||
|
|
||||||
" ------------------------------------ SynTastic-------------------------------------------
|
" ------------------------------------ SynTastic-------------------------------------------
|
||||||
set statusline+=%#warningmsg#
|
set statusline+=%#warningmsg#
|
||||||
set statusline+=%{SyntasticStatuslineFlag()}
|
set statusline+=%{SyntasticStatuslineFlag()}
|
||||||
|
@ -112,6 +124,10 @@ let g:gitgutter_max_signs = 500 " default value
|
||||||
let g:gitgutter_realtime = 1
|
let g:gitgutter_realtime = 1
|
||||||
let g:gitgutter_eager = 1
|
let g:gitgutter_eager = 1
|
||||||
|
|
||||||
|
" ------------------------------------ Indent Line -------------------------------------------
|
||||||
|
let g:indentLine_color_term = 0
|
||||||
|
"let g:indentLine_char_list = ['|', '¦', '┆', '┊']
|
||||||
|
|
||||||
" ------------------------------------ Whitespace Highlighting -------------------------------------------
|
" ------------------------------------ Whitespace Highlighting -------------------------------------------
|
||||||
autocmd ColorScheme * highlight ExtraWhitespaces ctermbg=red guibg=red
|
autocmd ColorScheme * highlight ExtraWhitespaces ctermbg=red guibg=red
|
||||||
"" Extra Whitespace Highlighting
|
"" Extra Whitespace Highlighting
|
||||||
|
|
Loading…
Reference in a new issue