set rtp+=~/.vim/bundle/Vundle.vim " Initialize directories { function!InitializeDirectories() let parent = $HOME let prefix = 'vim' let dir_list = { \ 'backup': 'backupdir', \ 'views': 'viewdir', \ 'swap': 'directory', \ 'undo': 'undodir',}
" To specify a different directory in which to place the vimbackup, " vimviews, vimundo, and vimswap files/directories, add the following to " your .vimrc.before.local file: " let g:spf13_consolidated_directory = <full path to desired directory> " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/' let common_dir = parent . '/.' . prefix
for [dirname, settingname] in items(dir_list) let directory = common_dir . dirname . '/' ifexists("*mkdir") if !isdirectory(directory) callmkdir(directory) endif endif if !isdirectory(directory) echo"Warning: Unable to create backup directory: " . directory echo"Try: mkdir -p " . directory else let directory = substitute(directory, " ", "\\\\ ", "g") exec "set " . settingname . "=" . directory endif endfor endfunction call InitializeDirectories() " }
" set foldmarker={,} " set foldlevel=0 " set foldmethod=marker
filetype plugin indenton" Automatically detect file types. syntaxsync minlines=10000" when jump to line, highlight brokes syntaxon" Syntax highlighting set mouse=a" Automatically enable mouse usage set mousehide " Hide the mouse cursor while typing scriptencoding utf-8
set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility set virtualedit=onemore " Allow for cursor beyond last character sethistory=1000" Store a ton of history (default is 20) " }
" Formatting { set wrap " wrap long lines set textwidth=0" soft wrap "set linebreak " soft wrap set nolist " set autoindent " Indent at the same level of the previous line setshiftwidth=2" Use indents of 4 spaces set expandtab " Tabs are spaces, not tabs set tabstop=2" An indentation every four columns set softtabstop=2" Let backspace delete indent "autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre <buffer> if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif " }
" UI { set backspace=indent,eol,start " Backspace for dummies set linespace=0" No extra spaces between rows setnumber" Line numbers on set showmatch " Show matching brackets/parenthesis set incsearch " Find as you type search set hlsearch " Highlight search terms set wildmenu " Show list instead of just completing set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all. set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too set scrolljump=5" Lines to scroll when cursor leaves screen set scrolloff=3" Minimum lines to keep above and below cursor set foldenable " Auto fold code set splitright " Puts new vsplit windows to the right of the current set splitbelow " Puts new split windows to the bottom of the current setlist set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace " }
set clipboard=unnamed,unnamedplus " yy to clipboard
" undo { set backup setundofile" So is persistent undo ... set undolevels=1000" Maximum number of changes that can be undone set undoreload=10000" Maximum number lines to save for undo on a buffer reload " }
set laststatus=2
" highlight { highlight clear SignColumn " SignColumn should match background highlight clear LineNr " Current line number row will have same background color in relative mode hi Normal ctermbg=None "hi CursorLine cterm=NONE ctermbg=darkgray ctermfg=black guibg=#004488 guifg=white set cursorline " Highlight current line hi CursorLine cterm=NONE ctermbg=darkgray ctermfg=white guibg=#004488 guifg=white set cursorcolumn " Highlight current line hi CursorColumn cterm=NONE ctermbg=darkgray ctermfg=white guibg=#004488 guifg=white hi Visual ctermbg=white ctermfg=black guibg=Grey " }