From e8a156fbaada6eabf83e53eca7adf91a5901ceb0 Mon Sep 17 00:00:00 2001 From: nold Date: Tue, 20 Apr 2021 13:14:16 +0200 Subject: [PATCH] More Powerline[-Shell] & Solarized integration --- bashrc | 33 ++++++++++++++++++++++++++++++--- setup.sh | 2 +- tmux.conf | 18 +++++++++--------- vimrc | 20 ++++++++++++++++++-- 4 files changed, 58 insertions(+), 15 deletions(-) diff --git a/bashrc b/bashrc index 11a584e..a7962f9 100644 --- a/bashrc +++ b/bashrc @@ -38,14 +38,41 @@ else function prompt_callback { REPO=$(git remote -v | sed -r 's/^origin.*\/(.*)\ .*/\1/' | head -1) - gp_set_window_title "$REPO($GIT_BRANCH)" + tmux_title "$REPO($GIT_BRANCH)" } fi PYVERSION=$(python3 --version | grep -Eo '[0-9]\.[0-9]') -if [ -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 +if [ -f $HOME/.venv/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh ]; then + 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 +set +x # LS_COLORS eval $(dircolors -b $HOME/.dircolors) diff --git a/setup.sh b/setup.sh index a8f9a3f..24d8916 100755 --- a/setup.sh +++ b/setup.sh @@ -20,7 +20,7 @@ done # Install powerline if possible if which pip3 ; then - pip3 install -U -r requirements.txt + pip3 install --user -U -r requirements.txt else [ ! -d ~/.bash-git-prompt ] && git clone https://github.com/nold360/bash-git-prompt.git ~/.bash-git-prompt fi diff --git a/tmux.conf b/tmux.conf index c0b65e5..58e46a7 100644 --- a/tmux.conf +++ b/tmux.conf @@ -5,7 +5,7 @@ set -g prefix C-a bind C-a send-prefix ## Default is 'screen' -set -sg default-terminal 'screen-16color' +set -sg default-terminal 'screen-256color' set -sg escape-time 1 set -sg set-clipboard on set -g history-limit 100000 @@ -22,24 +22,24 @@ set -g status-justify left set -g status-interval 1 set -g status-left-length 20 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-left '⣿ ' +set -g status-left '' set -g set-titles on set -g set-titles-string '#T' setw -g allow-rename off setw -g automatic-rename on setw -g automatic-rename-format '#T' -setw -g window-status-format '⡇[#I]#{=120:window_name} ⡇' -setw -g window-status-current-format ' *#{=120:window_name}* ' -set-window-option -g window-status-current-attr bold +setw -g window-status-format ' #I  #{=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 #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-separator '' set -g bell-action current -set -g bell-on-alert off +#set -g bell-on-alert off setw -g monitor-activity on set -g visual-activity 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 # active window title colors -set-window-option -g window-status-current-fg white -set-window-option -g window-status-current-bg '#00AA0E' +set-window-option -g window-status-current-fg black +set-window-option -g window-status-current-bg yellow #set-window-option -g window-status-current-attr bright # pane border diff --git a/vimrc b/vimrc index ffb5a07..f9e2d8f 100644 --- a/vimrc +++ b/vimrc @@ -10,6 +10,7 @@ Plugin 'altercation/vim-colors-solarized' Plugin 'scrooloose/nerdtree' Plugin 'vim-syntastic/syntastic' Plugin 'farmergreg/vim-lastplace.git' +Plugin 'yggdroot/indentline' call vundle#end() " required filetype plugin indent on " required " @@ -55,7 +56,7 @@ hi Search guibg=lightRed " ------------------------------------ Colors / Theme ------------------------------------------- let g:solarized_visibility = "high" let g:solarized_contrast = "high" -let g:solarized_termcolors = 256 +"let g:solarized_termcolors = 256 colorscheme solarized augroup CursorLine @@ -74,12 +75,23 @@ map :NERDTreeToggle nnoremap " ------------------------------------ AirLine ------------------------------------------- -let g:airline_theme='badwolf' +let g:airline_theme='solarized' let g:airline#extensions#tabline#enabled = 1 "let g:airline#extensions#tabline#left_sep = ' ' "let g:airline#extensions#tabline#left_alt_sep = '|' "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------------------------------------------- set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} @@ -112,6 +124,10 @@ let g:gitgutter_max_signs = 500 " default value let g:gitgutter_realtime = 1 let g:gitgutter_eager = 1 +" ------------------------------------ Indent Line ------------------------------------------- +let g:indentLine_color_term = 0 +"let g:indentLine_char_list = ['|', '¦', '┆', '┊'] + " ------------------------------------ Whitespace Highlighting ------------------------------------------- autocmd ColorScheme * highlight ExtraWhitespaces ctermbg=red guibg=red "" Extra Whitespace Highlighting