1
0
Fork 0

vimplugrc: back to solarized, some experiments for lightline; zshrc: new prompt in town

This commit is contained in:
Von Random 2019-11-22 18:55:06 +03:00
parent 13dc4b614f
commit 9a1d22d18b
2 changed files with 31 additions and 16 deletions

View file

@ -12,8 +12,9 @@ Plug 'junegunn/vim-plug'
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align' Plug 'junegunn/vim-easy-align'
Plug 'lifepillar/vim-solarized8'
Plug 'lifepillar/vim-gruvbox8'
Plug 'mhinz/vim-signify' Plug 'mhinz/vim-signify'
Plug 'NLKNguyen/papercolor-theme'
Plug 'sheerun/vim-polyglot' Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
@ -41,7 +42,17 @@ nmap <Leader>ft :Filetypes<CR>
" lightline " lightline
set noshowmode set noshowmode
let g:lightline = {} let g:solarized_termcolors = 16
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'keymap' ],
\ [ 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component': {
\ 'keymap': '%k'
\ }
\ }
let g:lightline.separator = { 'left': "\ue0b0", 'right': "\ue0b2" } let g:lightline.separator = { 'left': "\ue0b0", 'right': "\ue0b2" }
let g:lightline.subseparator = { 'left': "\ue0b1", 'right': "\ue0b3" } let g:lightline.subseparator = { 'left': "\ue0b1", 'right': "\ue0b3" }
@ -50,6 +61,10 @@ let g:vimwiki_list = [{'path': '$HOME/vimwiki/', 'syntax': 'markdown', 'ext': '.
" color theme " color theme
if $TERM !~ '^linux' if $TERM !~ '^linux'
let g:solarized_use16 = 1
let g:solarized_italics = 1
let g:solarized_extra_hi_groups = 1
set bg=light set bg=light
colorscheme PaperColor colorscheme solarized8
endif endif

26
zshrc
View file

@ -71,13 +71,13 @@ bindkey -s '^j' '^atime ^m' # ctrl + j
bindkey '^x^e' edit-command-line bindkey '^x^e' edit-command-line
# }}} # }}}
# {{{ prompt # {{{ prompt
prompt_ln1='[ %(!.%F{red}.%F{blue})%n%f %m:%d ]'
prompt_ln2=$'\n%(!.%F{red}.%F{blue})$>%f '
prompt_state_file="/tmp/zsh_gitstatus_$$.tmp" prompt_state_file="/tmp/zsh_gitstatus_$$.tmp"
prompt_ln1='%K{white}%F{black}[ %F{%(!.red.blue)}%n%F{black}@%m %F{green}%2~%F{black} '
prompt_ln2=']%f%k '
PROMPT="$prompt_ln1$prompt_ln2" PROMPT="$prompt_ln1$prompt_ln2"
PROMPT2='%_%(!.%F{red}.%F{blue})>%f ' PROMPT2='%K{white}%F{black}[ %_ ]%f%k '
PROMPT3='?%(!.%F{red}.%F{blue})#%f ' PROMPT3='%K{white}%F{black}[ ?# ]%f%k '
PROMPT4='+%N:%i%(!.%F{red}.%F{blue})>%f ' PROMPT4='%K{white}%F{black}[ +%N:%i ]%f%k '
precmd.title() { precmd.title() {
case $TERM in case $TERM in
(screen*) printf '\033k%s\033\' ${HOST%%.*};; (screen*) printf '\033k%s\033\' ${HOST%%.*};;
@ -104,21 +104,21 @@ precmd.git() {
typeset branch_info full_status git_status= IFS= typeset branch_info full_status git_status= IFS=
typeset staged_count=0 unstaged_count=0 untracked_count=0 unmerged_count=0 typeset staged_count=0 unstaged_count=0 untracked_count=0 unmerged_count=0
branch_info=$(git rev-parse --abbrev-ref HEAD)
while read line; do while read line; do
[[ $line[1,2] == '##' ]] && branch_info=$line[4,-1]
[[ $line[1,2] == '??' ]] && (( untracked_count++ )) [[ $line[1,2] == '??' ]] && (( untracked_count++ ))
[[ $line[1,2] =~ .[MD] ]] && (( unstaged_count++ )) [[ $line[1,2] =~ .[MD] ]] && (( unstaged_count++ ))
[[ $line[1,2] =~ [MDARC]. ]] && (( staged_count++ )) [[ $line[1,2] =~ [MDARC]. ]] && (( staged_count++ ))
[[ $line[1,2] =~ [ADU]{2} ]] && (( unmerged_count++ )) [[ $line[1,2] =~ [ADU]{2} ]] && (( unmerged_count++ ))
done <<< $raw_status done <<< $raw_status
(( unstaged_count )) && git_status+="%F{yellow}~$unstaged_count" (( unstaged_count )) && git_status+="%F{3}~$unstaged_count"
(( staged_count )) && git_status+="%F{blue}+$staged_count" (( staged_count )) && git_status+="%F{4}+$staged_count"
(( untracked_count )) && git_status+="%F{red}-$untracked_count" (( untracked_count )) && git_status+="%F{1}-$untracked_count"
(( unmerged_count )) && git_status+="%F{magenta}*$unmerged_count" (( unmerged_count )) && git_status+="%F{5}*$unmerged_count"
[[ -z $git_status ]] && git_status="%F{green}ok" [[ -z $git_status ]] && git_status="%F{2}ok"
printf ' { %s \ue0a0 %s%%f }' $branch_info $git_status > $prompt_state_file printf '\ue0a0 %s:%s%%F{black} ' $branch_info[1,16] $git_status > $prompt_state_file
} }
precmd.prompt() { precmd.prompt() {
PROMPT="$prompt_ln1$1$prompt_ln2" PROMPT="$prompt_ln1$1$prompt_ln2"
@ -130,7 +130,7 @@ precmd.git_update() {
precmd() { precmd() {
precmd.title precmd.title
if precmd.is_git_repo; then if precmd.is_git_repo; then
precmd.prompt $' { \ue0a0 }' precmd.prompt $'\ue0a0 '
precmd.git_update &! precmd.git_update &!
else else
precmd.prompt precmd.prompt