From 3fa4250efa3ea2b614c346971ce016cfb6e5f054 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 11 Jun 2017 13:48:46 +0200 Subject: Made lightline fancier --- vimrc-full | 140 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'vimrc-full') diff --git a/vimrc-full b/vimrc-full index df6f346..5e1b77b 100644 --- a/vimrc-full +++ b/vimrc-full @@ -167,44 +167,32 @@ set laststatus=2 | " required by AirLine, set background=light | Plug 'itchyny/lightline.vim' -" let g:lightline = { -" \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, -" \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, -" \ 'tabline': { -" \ 'left': [ ['tabs'] ], -" \ 'right': [ [ 'close' ] ] -" \ } -" \ } +Plug 'daviesjamie/vim-base16-lightline' Plug 'taohex/lightline-buffer' -" use lightline-buffer in lightline -let g:lightline = { - \ 'colorscheme': 'PaperColor_light', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'gitbranch', 'readonly' ] ], - \ 'right': [ [ 'lineinfo' ], - \ [ 'percent' ], - \ [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ] ], - \ }, - \ 'tabline': { - \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], - \ 'right': [ [ 'close' ], ], - \ }, - \ 'component_expand': { - \ 'buffercurrent': 'lightline#buffer#buffercurrent2', - \ }, - \ 'component_type': { - \ 'buffercurrent': 'tabsel', - \ }, - \ 'component_function': { - \ 'bufferbefore': 'lightline#buffer#bufferbefore', - \ 'bufferafter': 'lightline#buffer#bufferafter', - \ 'bufferinfo': 'lightline#buffer#bufferinfo', - \ 'filetype': 'MyFiletype', - \ 'fileformat': 'MyFileformat', - \ 'gitbranch': 'fugitive#head', - \ }, - \ } + +" lightline-buffer ui settings +" replace these symbols with ascii characters if your environment does not support unicode +let g:lightline_buffer_logo = ' ' +let g:lightline_buffer_readonly_icon = '' +let g:lightline_buffer_modified_icon = '✭' +let g:lightline_buffer_git_icon = ' ' +let g:lightline_buffer_ellipsis_icon = '..' +let g:lightline_buffer_expand_left_icon = '◀ ' +let g:lightline_buffer_expand_right_icon = ' ▶' +let g:lightline_buffer_active_buffer_left_icon = '' +let g:lightline_buffer_active_buffer_right_icon = '' +let g:lightline_buffer_separator_icon = ' ' + +" lightline-buffer function settings +let g:lightline_buffer_show_bufnr = 1 +let g:lightline_buffer_rotate = 0 +let g:lightline_buffer_fname_mod = ':t' +let g:lightline_buffer_excludes = ['vimfiler'] +let g:lightline_buffer_maxflen = 30 +let g:lightline_buffer_maxfextlen = 3 +let g:lightline_buffer_minflen = 16 +let g:lightline_buffer_minfextlen = 3 +let g:lightline_buffer_reservelen = 20 function! MyFiletype() return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : '' @@ -214,33 +202,45 @@ function! MyFileformat() return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : '' endfunction +function! MyBranchname() + return winwidth(0) > 70 ? fugitive#statusline() : '' +endfunction + +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, + \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly' ] ], + \ 'right': [ [ 'lineinfo' ], + \ [ 'percent' ], + \ [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ] ], + \ }, + \ 'tabline': { + \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], + \ 'right': [ [ 'close' ], ], + \ }, + \ 'component_expand': { + \ 'buffercurrent': 'lightline#buffer#buffercurrent2', + \ }, + \ 'component_type': { + \ 'buffercurrent': 'tabsel', + \ }, + \ 'component_function': { + \ 'bufferbefore': 'lightline#buffer#bufferbefore', + \ 'bufferafter': 'lightline#buffer#bufferafter', + \ 'bufferinfo': 'lightline#buffer#bufferinfo', + \ 'filetype': 'MyFiletype', + \ 'fileformat': 'MyFileformat', + \ 'gitbranch': 'MyBranchname', + \ }, + \ } -" lightline-buffer ui settings -" replace these symbols with ascii characters if your environment does not support unicode -let g:lightline_buffer_logo = ' ' -let g:lightline_buffer_readonly_icon = '' -let g:lightline_buffer_modified_icon = '✭' -let g:lightline_buffer_git_icon = ' ' -let g:lightline_buffer_ellipsis_icon = '..' -let g:lightline_buffer_expand_left_icon = '◀ ' -let g:lightline_buffer_expand_right_icon = ' ▶' -let g:lightline_buffer_active_buffer_left_icon = '' -let g:lightline_buffer_active_buffer_right_icon = '' -let g:lightline_buffer_separator_icon = ' ' -" lightline-buffer function settings -let g:lightline_buffer_show_bufnr = 1 -let g:lightline_buffer_rotate = 0 -let g:lightline_buffer_fname_mod = ':t' -let g:lightline_buffer_excludes = ['vimfiler'] -let g:lightline_buffer_maxflen = 30 -let g:lightline_buffer_maxfextlen = 3 -let g:lightline_buffer_minflen = 16 -let g:lightline_buffer_minfextlen = 3 -let g:lightline_buffer_reservelen = 20 @@ -253,7 +253,7 @@ let g:lightline_buffer_reservelen = 20 " let g:airline_powerline_fonts = 1 | " let g:airline_skip_empty_sections = 1 | " let g:airline_extensions = [] | -" +" " let g:airline#extensions#tabline#enabled = 1 | " let g:airline#extensions#tabline#left_alt_sep = '' | " let g:airline#extensions#tabline#left_sep = '' | @@ -265,19 +265,19 @@ let g:lightline_buffer_reservelen = 20 " let g:airline#extensions#tabline#show_buffers = 1 | " let g:airline#extensions#tabline#show_tabs = 0 | " let g:airline#extensions#tabline#ignore_bufadd_pat = '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree|preview|^$' -" +" " let g:airline_extensions#branch#enabled = 1 | " let g:airline_extensions#whitespace#enabled = 0 | " airlines whitespace check is slow :/ " let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] -" +" " if has('python') " let g:airline_extensions#syntastic#enabled = 1 | " let g:airline_extensions#ycm#enabled = 1 | " endif -" +" " let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend " let g:airline#extensions#tagbar#enabled = 0 | -" +" " " AIRLINE_Theme: " Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme " let base16colorspace=256 | @@ -329,7 +329,7 @@ if has("python") let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 " let g:syntastic_quiet_messages = {"type":"style"} - " + " " E221: multiple spaces before Operator let g:syntastic_python_flake8_args = '--max-complexity=10 --max-line-length=120 --exclude venv --doctests --exit-zero --ignore=E221' " filter ( = do not display) style/formatting errors and warnings @@ -388,7 +388,7 @@ function! ExtendColorTheme() " highlight Normal ctermbg=NONE ctermfg=black highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE - highlight! Pmenu ctermbg=LightYellow ctermfg=blue + highlight! Pmenu ctermbg=LightYellow ctermfg=blue highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold highlight! link PmenuSbar Pmenu @@ -519,7 +519,7 @@ if !has('nvim') | " settings which have been removed from neovim set ttyscroll=100 | " improves speed for terminal vim, incomp. with nvim set ttyfast | " improves speed for terminal vim (incomp. with nvim) " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim - " + " let g:loaded_ruby_provider = 1 " disable ruby support let g:loaded_python_provider = 1 " disable pthon3 endif @@ -661,7 +661,7 @@ if has("autocmd") let @q = ":cex [] | bufdo vimgrepadd /foo/g % | cw" " change to the current working directory (p like pwd) - let @p = ":lcd %:p:h" + let @p = ":lcd %:p:h" let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" @@ -710,8 +710,8 @@ nnoremap r :syntax sync fromstart " INSERT_MODE_MAPPINGS: " default copy&paste insert key binding (just in insert mode, so it doesn't conflict " with visual block mode)- would have been nice, but collides with c-w for digraphs -" inoremap + -" +" inoremap + +" inoremap :w " NEOVIM_SPECIFIC: -- cgit v1.2.3