From ba00b66415e219a3a4ef0b469d9bc01eb83fc3b5 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 11 Jun 2017 10:50:50 +0200 Subject: Fancier lightline --- vimrc-full | 98 +++++++++++++++++++++++++++++++++++++++++++------------ ycm_extra_conf.py | 27 --------------- 2 files changed, 78 insertions(+), 47 deletions(-) diff --git a/vimrc-full b/vimrc-full index 50d5c25..df6f346 100644 --- a/vimrc-full +++ b/vimrc-full @@ -167,25 +167,82 @@ 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 'taohex/lightline-buffer' +" use lightline-buffer in lightline let g:lightline = { - \ 'colorscheme': 'PaperColor_light', - \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, - \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'gitbranch', 'readonly' ] ], - \ 'right': [ [ 'lineinfo' ], - \ [ 'percent' ], - \ [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ] ] - \ }, - \ 'component_function': { - \ 'gitbranch': 'fugitive#head' - \ }, - \ 'tabline': { - \ 'left': [ ['tabs'] ], - \ 'right': [ [ 'close' ] ] - \ } - \ } + \ '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', + \ }, + \ } + +function! MyFiletype() + return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : '' +endfunction + +function! MyFileformat() + return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : '' +endfunction + + + + +" 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 + + " Plug 'vim-airline/vim-airline' | " beautification of the mode line " let g:airline_section_c = "%F" | " was: %F @@ -652,8 +709,9 @@ 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). -inoremap + +" with visual block mode)- would have been nice, but collides with c-w for digraphs +" inoremap + +" inoremap :w " NEOVIM_SPECIFIC: diff --git a/ycm_extra_conf.py b/ycm_extra_conf.py index 3c2b399..7a1828f 100644 --- a/ycm_extra_conf.py +++ b/ycm_extra_conf.py @@ -1,4 +1,3 @@ -<<<<<<< Updated upstream def FlagsForFile(filename, **kwargs): return { 'flags': [ @@ -20,29 +19,3 @@ def FlagsForFile(filename, **kwargs): } # vim:set et sw=4 ts=4 tw=120: -======= -import os -import ycm_core - -def FlagsForFile( filename, **kwargs ): - return { - 'flags': [ - '-Wall', - '-Wextra', - '-Werror', - '-Wno-long-long', - '-Wno-variadic-macros', - '-fexceptions', - '-ferror-limit=10000', - '-DNDEBUG', - '-std=c99', - '-x', 'c', - '-D_GNU_SOURCE', - '-I.', - '-I', '/usr/include/' - ], - 'do_cache': True, - } - -# vim:set et sw=2 ts=2 tw=120: ->>>>>>> Stashed changes -- cgit v1.2.3