" Light backgrounds hurt my eyes. set background=dark let mapleader = " " let $NVIM_TUI_ENABLE_TRUE_COLOR=1 " True gui colors in terminal " I speel gud, but I mkae tyops all the tiem. set spelllang=en_gb " VI est mortuus. Vim vivat. set nocompatible " May as well... set mouse=a set clipboard=unnamedplus " Syntax coloring is a set of guideposts. syntax on filetype on filetype plugin on filetype indent on set synmaxcol=255 set grepprg=grep\ -nH\ $* if filereadable("/usr/bin/rg") set grepprg=rg\ --vimgrep set grepformat^=%f:%l:%c:%m endif " 4-column tabs is the One True Way. set ts=4 sw=4 sts=4 " ... But some people have a hard time being consistent. set list listchars=tab:>-,trail:- " I can't count. set number " Fold settings {{{ set foldenable set foldclose=all " Close folds if you leave them in any way set foldcolumn=1 " Show the foldcolumn set foldlevel=0 " Autofold everything by default set foldmethod=marker " fold on markers set foldnestmax=3 set foldopen=all " Open folds if you touch them in any way " }}} " Convenience makes my fingers happy. map :silent make\|cwindow\|redraw! imap :silent make\|cwindow\|redraw!a " map :cn nmap g :silent !grunt hogan coffee less " Use ctrl-[hjkl] to select the active split! nmap :wincmd k nmap :wincmd j nmap :wincmd h nmap :wincmd l " I'm forgetful. set history=1000 " This keeps me centered. set scrolloff=3 " Helps me find things. set ruler set showmatch set incsearch set hlsearch " This was before I found out about \c set smartcase " My, that bottom bar can get cluttered... set shortmess=atI set noshowmode set expandtab set wildmenu " language-specific settings {{{ autocmd filetype python set expandtab autocmd filetype pony set expandtab autocmd filetype php set expandtab autocmd filetype coffee set expandtab autocmd filetype mustache set expandtab autocmd filetype pony set expandtab augroup nemerle au! autocmd BufNewFile,BufReadPre *.n \ set fencs=ucs-bom,utf-8,iso-8859-2 fenc=utf-8 augroup END " }}} augroup Binary au! au BufReadPre *.bin let &bin=1 au BufReadPost *.bin if &bin | %!xxd au BufReadPost *.bin set ft=xxd | endif au BufWritePre *.bin if &bin | %!xxd -r au BufWritePre *.bin endif au BufWritePost *.bin if &bin | %!xxd au BufWritePost *.bin set nomod | endif augroup END " cscope seems to work a little better than ctags, but Vim doesn't auto-load " cscope files like it does ctags files. if has("cscope") set cst set csto=0 set nocsverb if filereadable("cscope.out") cs add cscope.out elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb nmap s :cs find s =expand("") nmap g :cs find g =expand("") nmap c :cs find c =expand("") nmap t :cs find t =expand("") nmap e :cs find e =expand("") nmap f :cs find f =expand("") nmap i :cs find i ^=expand("")$ nmap d :cs find d =expand("") nmap s :scs find s =expand("") nmap g :scs find g =expand("") nmap c :scs find c =expand("") nmap t :scs find t =expand("") nmap e :scs find e =expand("") nmap f :scs find f =expand("") nmap i :scs find i ^=expand("")$ nmap d :scs find d =expand("") nmap s :vert scs find s =expand("") nmap g :vert scs find g =expand("") nmap c :vert scs find c =expand("") nmap t :vert scs find t =expand("") nmap e :vert scs find e =expand("") nmap f :vert scs find f =expand("") nmap i :vert scs find i ^=expand("")$ nmap d :vert scs find d =expand("") endif set tags=./tags,tags let ComniCpp_MayCompleteDot=1 let ComniCpp_MayCompleteArrow=1 let ComniCpp_MayCompleteScope=1 " Search paths for completions. " Starting with local files and the default includes set path+=**,/usr/include " KDE-specific set path+=/usr/include/KDE,/usr/include/qt4 " boost set path+=/usr/include/boost set grepprg=grep\ -nH\ $* let g:tex_flavor = "latex" let g:clang_library_path = '/usr/lib' let g:clang_auto_select = 1 let g:clang_complete_auto = 1 let g:clang_complete_macros = 1 let g:proj_flags='imstS' set completeopt=menu,menuone,preview,noselect,noinsert let g:ale_completion_enabled = 1 " I often forget to use sudoedit. Much to my chagrin. cmap w!! %!sudo tee > /dev/null % let g:snipMate = { 'snippet_version' : 1 } " Plugins {{{ " note: run :PlugUpgrade | PlugInstall | PlugUpdate call plug#begin('~/.vim/plugged') "" if these are uncommented I started working with C :( " Plug 'Rip-Rip/clang_complete', { 'for': ['cpp', 'cpp11', 'c'], 'do': 'make install' } " Plug 'vim-scripts/ctx' " I don't need NERDTree Plug 'ctrlpvim/ctrlp.vim' Plug 'tpope/vim-fugitive' " Make things look pretty Plug 'morhetz/gruvbox' Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline' Plug 'kien/rainbow_parentheses.vim' Plug 'jaxbot/semantic-highlight.vim' " Sessions Plug 'shemerey/vim-project' Plug 'tpope/vim-surround' "I like ALE but it doesn't like me :( Plug 'dense-analysis/ale' "Snippets because I am lazy Plug 'garbas/vim-snipmate' Plug 'MarcWeber/vim-addon-mw-utils' Plug 'tomtom/tlib_vim' "Rust my beloved Plug 'rust-lang/rust.vim' "Lamtex Rabbit hole Plug 'lervag/vimtex' "Personal wiki? Plug 'vimwiki/vimwiki' call plug#end() " Vimtex shi let g:vimtex_view_method = 'zathura' " Tab Completion inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" "let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki/', 'path_html': '~/public_html/'}] au VimEnter * RainbowParenthesesToggle au Syntax * RainbowParenthesesLoadRound au Syntax * RainbowParenthesesLoadSquare au Syntax * RainbowParenthesesLoadBraces " }}} au BufReadPost,FileReadPost,BufNewFile * call system("tmux rename-window 'vim | " . expand("%:t") . "'") au BufNewFile,BufRead *.hpp set syntax=cpp11 au BufNewFile,BufRead *.mustache set ft=html " Everything else looks like crap. colorscheme gruvbox let g:airline#extensions#tabline#enabled = 1 let g:airline_theme='base16_gruvbox_dark_hard' "{{{ unicode symbols if !exists('g:airline_symbols') let g:airline_symbols = {} endif "" unicode symbols "let g:airline_left_sep = 'Β»' "let g:airline_left_sep = 'β–Ά' "let g:airline_right_sep = 'Β«' "let g:airline_right_sep = 'β—€' "let g:airline_symbols.crypt = 'πŸ”’' "let g:airline_symbols.linenr = '☰' "let g:airline_symbols.linenr = '␊' "let g:airline_symbols.linenr = '␀' "let g:airline_symbols.linenr = 'ΒΆ' "let g:airline_symbols.maxlinenr = '' "let g:airline_symbols.maxlinenr = '㏑' "let g:airline_symbols.branch = 'βŽ‡' "let g:airline_symbols.paste = 'ρ' "let g:airline_symbols.paste = 'Þ' "let g:airline_symbols.paste = 'βˆ₯' "let g:airline_symbols.spell = 'Ꞩ' "let g:airline_symbols.notexists = 'Ι†' "let g:airline_symbols.whitespace = 'Ξ' " powerline symbols let g:airline_left_sep = 'ξ‚°' let g:airline_left_alt_sep = 'ξ‚±' let g:airline_right_sep = 'ξ‚²' let g:airline_right_alt_sep = 'ξ‚³' let g:airline_symbols.branch = 'ξ‚ ' let g:airline_symbols.readonly = 'ξ‚’' let g:airline_symbols.linenr = '☰' let g:airline_symbols.maxlinenr = 'ξ‚‘' let g:airline_powerline_fonts = 1 let g:wintabs_powerline_arrow_left = " \u25c0 " let g:wintabs_powerline_sep_tab_transition = "\ue0b2" let g:wintabs_powerline_sep_buffer = "\ue0b1" let g:wintabs_powerline_sep_tab_transition = "\ue0b2" highlight link WintabsEmpty TabLineFill "}}}