From a92f9e9ceb9b59b0227654f4dd87d8a8be5756e2 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Wed, 16 Aug 2017 00:04:20 +0200 Subject: finally dropped airline completely and cleaned a lot --- vimrc-full | 163 +++++++++++++++++++------------------------------------------ 1 file changed, 51 insertions(+), 112 deletions(-) diff --git a/vimrc-full b/vimrc-full index 2a9cf88..08e140e 100644 --- a/vimrc-full +++ b/vimrc-full @@ -1,24 +1,48 @@ -" vim: iskeyword+=\:,\!,\<,\>,\-,\& +" vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\!,\<,\>,\-,\& + set textwidth=120 | " better done with modeline set ts=4 sts=4 sw=4 expandtab | " better done with a modeline +set redrawtime=1000 | " Timeout in milliseconds for redrawing the display / CTRL+L to retry " scripts from the default vim installation, which do not get loaded by default, but are useful. -source $VIMRUNTIME/macros/editexisting.vim +silent ":runtime macros/editexisting.vim" -"======================================================================================================================= -" SETTINGS: -"======================================================================================================================= +if has("multi_byte") + scriptencoding utf-8 | " tell vim that we are using utf-8 here + set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) + set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those + + set fillchars+=fold:\— | " + set fillchars+=vert:\│ | " cool vertical split char + set fillchars+=diff:\ | " a whitespace gets used here + + set listchars= | " initialize empty listchars + set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) + set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) + + set listchars+=tab:⮁\ | " symbols used when using :set list (which displays non-printable chars) + set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) + " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) + " set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) + set showbreak+=› | " symbol used in the beginning of a wrapped line + set list +" set fillchars+=stlnc:\― | " +end + +" ======================================================================================================================= +" SETTINGS: +" ======================================================================================================================= set noautochdir | " When on, Vim will change the current working directory set breakindent | " Every wrapped line will continue visually indented set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) set cmdheight=2 | " sets the command line's height set complete+=d | " scan current and included files for defined name or macro set complete+=i | " scan current and included files for completions +set colorcolumn= | " not used, because we have a :match directive for textwidth set concealcursor=nc | " limits the display of concealed text to normal and command mode set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) set confirm | " asks 'do you want to save?' set cpoptions+=P | " makes :w filename set the current buffer to filename -set guicursor=a:block-blinkon100 set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) set hlsearch | " highlights all search matches (not as performant!) set ignorecase smartcase | " search with ignorecase by default, but use case sensitive search when one captical char is contained @@ -45,7 +69,6 @@ set nowrap | " but do not (by default) wrap long lines around set number | " turn line numbers on/off (performance decreases when they are shown) set pumheight=8 | " Determines the maximum number of items to show in the popup menu for set path+=** | " allow recursive searches for files -set redrawtime=100 | " The time in milliseconds for redrawing the display. " set restorescreen | " restores the console after exiting vim " set shada+=n~/.vim/shada | " shada file to use set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge @@ -59,9 +82,6 @@ set showtabline=2 | " 0: never, 1: only if there are at least two ta set winwidth=30 | " keep NERDTreeWindow at least this size set winminwidth=0 | " (and all other windows, so TODO: watch out) set tags+=../tags -" set textwidth=100 | " line length (80 used to be default, but...) -" set colorcolumn= | " not used, because we have a :match directive for textwidth -set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) set updatetime=80 | " updates the screen more often set viminfo+=% | " restore buffer list set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against @@ -75,6 +95,16 @@ set equalalways | " do not evenly size windows when opening new or set nocursorline | " turn visual cursor line off (improves performance) "======================================================================================================================= +if has('persistent_undo') + set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) + + if isdirectory('/dev/shm') + set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undos + elseif isdirectory('/tmp/') + set undodir=/tmp/ + endif +endif + " START: LOADING PLUGINS " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ call plug#begin() @@ -105,12 +135,6 @@ Plug 'chriskempson/base16-vim' | " not just one high quality color scheme Plug 'mtth/scratch.vim' nnoremap :ScratchPreview -" VIM_ROOTER: | " Unobtrusive scratch window -" autocmd BufEnter * lcd %:p:h | " Plugin vim-rooter get used instead (which is much more sane as well) -Plug 'airblade/vim-rooter' | " makes :lcd changes to projects (git-)root (code-completion, gf, grep, find) -let g:rooter_targets="/,*.c,*.h" | " only use rooter for C, not LaTeX or anything else -" Vim rooter can be replaced by :Gcd provided by fugitive :) - " BUFEXPLORER: | " a buffer to list all buffers has the advantage, that default /-searches work in there Plug 'jlanzarotta/bufexplorer' nnoremap :ToggleBufExplorer @@ -196,24 +220,6 @@ let g:lightline_buffer_minflen = 16 let g:lightline_buffer_minfextlen = 3 let g:lightline_buffer_reservelen = 20 -" function! MyFiletype() -" if(exists('b:filetype')) -" return b:filetype -" else -" return &filetype -" endfunction -" autocmd BufEnter * let b:filetype = winwidth(0) > 70 ? (strlen(&filetype) ? WebDevIconsGetFileTypeSymbol() . ':' . &filetype : 'no ft') : '' -" -" function! MyFileformat() -" return exists('b:fileformat') ? b:fileformat : &fileformat -" endfunction -" autocmd BufEnter * let b:fileformat = winwidth(0) > 70 ? WebDevIconsGetFileFormatSymbol() . ':' . &fileformat : '' -" -" function! MyBranchname() -" return exists('b:branchname') ? b:branchname : '' -" endfunction -" autocmd BufEnter * let b:branchname = winwidth(0) > 70 ? fugitive#statusline() : '' - let g:lightline = { \ 'colorscheme': 'Tomorrow_Night_Bright', \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, @@ -247,52 +253,6 @@ let g:lightline = { \ }, \ } -" lightline#palette() - -" Plug 'vim-airline/vim-airline' | " beautification of the mode line -" let g:airline_section_c = "%F" | " was: %F -" let g:airline_detect_modified = 1 | -" let g:airline_detect_paste = 0 | -" let g:airline_exclude_preview = 0 | -" let g:airline_inactive_collapse = 1 | -" 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 = '' | -" let g:airline#extensions#tabline#right_alt_sep = '' | -" let g:airline#extensions#tabline#right_sep = '' | -" let g:airline#extensions#tabline#fnamemod = ':t' | " let airline just show the filename without its path -" let g:airline#extensions#tabline#disable_refresh = 1 | " refresh airline on bufadd ? -" let g:airline#extensions#tabline#enabled = 1 | -" 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 | -" let g:airline_theme='base16' | " specifies which colorscheme should airline uses -" let g:airline#themes#base16#constant = 0 | -" " let g:solarized_base16 = 1 -" " let g:airline_base16_improved_contrast = 1 -" " let g:airline_theme='badcat' | " specifies which colorscheme should airline uses -" " let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses - " Autocompleter: ===================================== if has("python") " YouCompleteMe: ===================================================================================================== @@ -427,13 +387,14 @@ endif - "======================================================================================================================= " GENERAL: "======================================================================================================================= if filereadable("/bin/bash") set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here +elseif filereadable("/usr/local/bin/bash") + set shell=/usr/local/bin/bash endif @@ -449,7 +410,6 @@ set thesaurus+=/home/max/.vim/thesaurus/php.txt set dictionary=/usr/share/dict/cracklib-small set complete+=k " make default completer respect the dictionary -" set fillchars+=stlnc:\― | " if has('autocmd') @@ -459,27 +419,6 @@ if has('autocmd') endif "======================================================================================================================= -if has("multi_byte") - scriptencoding utf-8 | " tell vim that we are using utf-8 here - set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) - set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those - - set fillchars+=fold:\— | " - set fillchars+=vert:\│ | " cool vertical split char - set fillchars+=diff:\ | " a whitespace gets used here - - set listchars= | " initialize empty listchars - set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) - set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) - - set listchars+=tab:⮁\ | " symbols used when using :set list (which displays non-printable chars) - set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) - " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) - " set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) - set showbreak+=› | " symbol used in the beginning of a wrapped line - set list -end - if has('cscope') " compiled with cscope support? " http://vim.wikia.com/wiki/Cscope set cscopetag | " CTRL-] uses cscope first, then ctags @@ -500,6 +439,7 @@ endif " GUI_VERSION: if has("gui_running") + set guicursor=a:block-blinkon100 set browsedir=buffer set toolbar+=text set guiheadroom=0 @@ -674,14 +614,13 @@ if has("autocmd") let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" - source $VIMRUNTIME/menu.vim - set wildmenu - set cpo-=< - set wcm= - map :emenu if has('menu') - + source $VIMRUNTIME/menu.vim + set wildmenu + set cpo-=< + set wcm= + map :emenu menu &Chdir.Git\ root \ :Gcd:pwd @@ -818,9 +757,9 @@ endif " avoids openin an empty buffer when restoring bufferlist from viminfo... -if argc() == 0 - autocmd VimEnter * nested :silent bun -endif +" if argc() == 0 +" autocmd VimEnter * nested :silent bun +" endif " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main " Enable omni completion. " autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS -- cgit v1.2.3