From 5d47f01f94ef508033a41ebcfc3de989755fd3ca Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sat, 23 Jun 2018 01:10:55 +0200 Subject: Improved UI consistency --- after/syntax/c.vim | 1 + bashrc | 10 ++++++++-- vimrc-full | 21 +++++++++++---------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/after/syntax/c.vim b/after/syntax/c.vim index 9ffe0ae..f4b1de9 100644 --- a/after/syntax/c.vim +++ b/after/syntax/c.vim @@ -19,6 +19,7 @@ syn region cBlock start=/{/ end=/}/ transparent " syn region myCComment start="/\*" end="\*/" fold keepend transparent + " let b:current_syntax = "c" " let g:polyglot_disabled = ['c/c++'] " unlet s:ft diff --git a/bashrc b/bashrc index d0ac36c..04f32fb 100644 --- a/bashrc +++ b/bashrc @@ -11,8 +11,14 @@ export MANPAGER='vim -c":set noswapfile|%!col -b" -c":file man|:setlocal filetype=man buftype=nowrite readonly nonumber nolist signcolumn=no" -' # man() { /bin/vim ":enew:0read !groffer --pager='cat' --tty $1 col -bx :set filetype=man buftype=nowrite readonlygg" -; } -alias git='git -c color.ui=false' -export GIT_PAGER='vim -c":set noswapfile filetype=git buftype=nowrite readonly nolist nonumber signcolumn=no|:file git" -' +# alias git='git -c color.ui=false' +# export GIT_DIFF_OPTS="--no-color" + + + +git config --global --replace-all color.pager 0 +git config --global --replace-all core.pager 'vim -c":set noswapfile filetype=git buftype=nowrite readonly nolist nonumber signcolumn=no|:file git" -' +# export GIT_PAGER='' # alias git="TERM=dumb git" diff --git a/vimrc-full b/vimrc-full index ca36df7..6e29373 100644 --- a/vimrc-full +++ b/vimrc-full @@ -906,6 +906,7 @@ autocmd FileType c,cpp,objc map = :pyf /usr/share/clang/clang-format.py command BuffersToArg :exec ':args '.join(map(range(0, bufnr('$')), 'fnameescape(fnamemodify(bufname(v:val), ":."))')) command BufToArg :argadd %:. +command Gbranch call setqflist([], 'r', {'title':'Git branch selector','items':map(systemlist("git branch"), {_, p->{'filename':'branch','module': fnamemodify(p, ':.')}})}) "======================================================================================================================= call plug#end() | " all plugins are getting loaded on this line, don't remove! @@ -1044,14 +1045,14 @@ if empty(argv()) " from the list of recent files: make absolute paths, filter out files not " contained in cwd and finally filter out directories and non-files... autocmd StdinReadPre * let s:std_in=1 - autocmd VimEnter * if !exists("s:std_in") | call setqflist([], 'r', + autocmd VimEnter * if !exists("s:std_in") | call setloclist(0, [], 'r', \ { \ 'title':'Recently used files in directory: '.getcwd(), \ 'items':map(filter(filter( \ map(copy(v:oldfiles), \ {_, p->expand(p)}), 'v:val =~ "'.getcwd().'/"'), 'filereadable(v:val)'), \ {_, p->{'filename': fnamemodify(p, ':.')}}) - \ }) | copen | only + \ }) | lopen | only endif command Vimls @@ -1156,8 +1157,8 @@ augroup status \ ."%{winbufnr(0).' '.nr2char(0xe621)}" \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" \ ."%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')\ }" - \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ ''\ :\ fnamemodify(getcwd(),\ ':~').nr2char(0xf44a))}\ " - \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ b:term_title\ :\ bufname('%'))\ }" + \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " + \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ b:term_title\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" \ ."%#".l:invert_group."#" \ ."%{nr2char(0xE0B4)\ }" \ .'' @@ -1182,9 +1183,10 @@ augroup status let l:invert_group = CreateInvertGroup(a:highlight_group) return '' \ ."%#".a:highlight_group."#" - \ ."%3(\ %)" + \ ."%3( \ %)" + \ ."%{getcwd(-1)}" \ ."%{nr2char(0xe621)}" - \ ."%(%{v:servername}\ %{v:this_session}%)" + \ ."%(\ \ %{fugitive#head()}\ %)" \ ."%#".l:invert_group."#" \ ."%{nr2char(0xE0B4)\ }" \ .'' @@ -1193,7 +1195,8 @@ augroup status \ ."%#".l:invert_group."#" \ ."%{nr2char(0xE0B6)}" \ ."%#".a:highlight_group."#" - \ ."%(\ \ %{fugitive#head()}\ %)" + \ ."%3(\ %)" + \ ."%(%{v:servername}\ %{v:this_session}%)" \ ."%{nr2char(0xe621)}" \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" \ ."%##" @@ -1212,10 +1215,8 @@ augroup status set tabline=%!UpdateTabline(g:group_tabline) endfunction " apply colors from the loaded colorscheme... - call ApplyColorScheme() - " when changing the colorscheme also apply new colors to the statusbar... - autocmd ColorScheme * call ApplyColorScheme() + autocmd VimEnter,ColorScheme * call ApplyColorScheme() autocmd WinEnter * setlocal statusline=%!UpdateStatus(g:group_active) autocmd WinLeave * setlocal statusline< -- cgit v1.2.3