alte statusline gegen lightline ausgetauscht
This commit is contained in:
parent
4c668ff541
commit
d8a6685034
1 changed files with 14 additions and 68 deletions
82
.vimrc
82
.vimrc
|
@ -1,73 +1,5 @@
|
||||||
" leader key
|
" leader key
|
||||||
:let mapleader = ","
|
: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
|
" Vundle
|
||||||
set nocompatible
|
set nocompatible
|
||||||
|
@ -80,6 +12,8 @@ call vundle#begin('~/.vim/plugged')
|
||||||
Plugin 'VundleVim/Vundle.vim' "muss immer der erste eintrag sein
|
Plugin 'VundleVim/Vundle.vim' "muss immer der erste eintrag sein
|
||||||
Plugin 'nestorsalceda/vim-strip-trailing-whitespaces'
|
Plugin 'nestorsalceda/vim-strip-trailing-whitespaces'
|
||||||
" entferne trailing whitespaces
|
" entferne trailing whitespaces
|
||||||
|
Plugin 'itchyny/lightline.vim'
|
||||||
|
" statusline
|
||||||
Plugin 'sheerun/vim-polyglot'
|
Plugin 'sheerun/vim-polyglot'
|
||||||
"languagepack
|
"languagepack
|
||||||
Plugin 'Xuyuanp/nerdtree-git-plugin'
|
Plugin 'Xuyuanp/nerdtree-git-plugin'
|
||||||
|
@ -119,6 +53,18 @@ let g:AutoPairsShortcutToggle = '<C-P>'
|
||||||
" Toogle Auto-Pairs mit Strg+P
|
" Toogle Auto-Pairs mit Strg+P
|
||||||
" zur Autovervollständigung von Klammern
|
" 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
|
" NERDtree + nerdtree-sync
|
||||||
"https://github.com/preservim/nerdtree
|
"https://github.com/preservim/nerdtree
|
||||||
let NERDTreeShowHidden = 1 " Show hidden files
|
let NERDTreeShowHidden = 1 " Show hidden files
|
||||||
|
|
Loading…
Reference in a new issue