alte statusline gegen lightline ausgetauscht

This commit is contained in:
Michael Grote 2021-05-31 20:51:51 +02:00
parent 4c668ff541
commit d8a6685034

82
.vimrc
View file

@ -1,73 +1,5 @@
" leader key
:let mapleader = ","
" statusline
" https://www.tdaly.co.uk/projects/vim-statusline-generator/
set laststatus=2
set statusline=
set statusline+=%{StatuslineMode()}
set statusline+=\
set statusline+=|
set statusline+=\
set statusline+=%F
set statusline+=\
set statusline+=|
set statusline+=\
set statusline+=%{b:gitbranch}
set statusline+=%=
set statusline+=%{strlen(&fenc)?&fenc:'none'}
set statusline+=\
set statusline+=|
set statusline+=\
set statusline+=%y
set statusline+=\
set statusline+=|
set statusline+=\
set statusline+=%{strftime(\"%H:%M\")}
set statusline+=%9*
set statusline+=%1*
hi User9 ctermbg=black ctermfg=white guibg=black guifg=white
hi User1 ctermbg=black ctermfg=darkgray guibg=black guifg=darkgray
function! StatuslineMode()
let l:mode=mode()
if l:mode==#"n"
return "NORMAL"
elseif l:mode==?"v"
return "VISUAL"
elseif l:mode==#"i"
return "INSERT"
elseif l:mode==#"R"
return "REPLACE"
elseif l:mode==?"s"
return "SELECT"
elseif l:mode==#"t"
return "TERMINAL"
elseif l:mode==#"c"
return "COMMAND"
elseif l:mode==#"!"
return "SHELL"
endif
endfunction
function! StatuslineGitBranch()
let b:gitbranch=""
if &modifiable
try
let l:dir=expand('%:p:h')
let l:gitrevparse = system("git -C ".l:dir." rev-parse --abbrev-ref HEAD")
if !v:shell_error
let b:gitbranch="(".substitute(l:gitrevparse, '\n', '', 'g').") "
endif
catch
endtry
endif
endfunction
augroup GetGitBranch
autocmd!
autocmd VimEnter,WinEnter,BufEnter * call StatuslineGitBranch()
augroup END
" Vundle
set nocompatible
@ -80,6 +12,8 @@ call vundle#begin('~/.vim/plugged')
Plugin 'VundleVim/Vundle.vim' "muss immer der erste eintrag sein
Plugin 'nestorsalceda/vim-strip-trailing-whitespaces'
" entferne trailing whitespaces
Plugin 'itchyny/lightline.vim'
" statusline
Plugin 'sheerun/vim-polyglot'
"languagepack
Plugin 'Xuyuanp/nerdtree-git-plugin'
@ -119,6 +53,18 @@ let g:AutoPairsShortcutToggle = '<C-P>'
" Toogle Auto-Pairs mit Strg+P
" zur Autovervollständigung von Klammern
"
" lightline/statusline
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
" NERDtree + nerdtree-sync
"https://github.com/preservim/nerdtree
let NERDTreeShowHidden = 1 " Show hidden files