+" force python3
+if has('python3') | endif
+
+" space is leader
+let g:mapleader = " "
+
" runtimepath {{{1
set runtimepath ^=$XDG_CONFIG_HOME/vim
set runtimepath +=$XDG_CONFIG_HOME/vim/after
-" force python3
-if has('python3') | endif
-
" plugins {{{1
-" remove all autocommands
-autocmd!
-
call plug#begin('$XDG_DATA_HOME/vim')
" This does not update vim-plug, use PlugUpgrade instead
Plug 'junegunn/vim-plug'
set shortmess+=W " don't give 'written' or '[w]' when writing a file
set shortmess+=A " ignore swapfile warning
set shortmess+=I " no splash screen
+set shortmess+=c " don't give |ins-completion-menu| messages
" editing text {{{2
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set formatoptions-=o " Do not insert comment leader after hitting o or O in normal mode
set nrformats-=octal " don't inc/dec octal numbers with ^[AX]
+set nrformats+=unsigned " treat all numbers as unsigned
set complete=. " scan the current buffer ( 'wrapscan' is ignored)
set complete+=w " scan buffers from other windows
set backupskip+=/dev/shm/pass* " skip passwordstore files
set undofile " persistent undo history
+set undolevels=10000 " moar undos
if !has('nvim')
set undodir=$XDG_CACHE_HOME/vim/undo//
endif
" running make and jumping to errors {{{2
set makeprg=make\ -w " print changing directories
+set grepformat=%f:%l:%c:%m
set grepprg=ag\ --vimgrep\ $*
" language specific {{{2
" autocmds {{{1
" Resize splits when the window is resized {{{2
-augroup resize
+augroup resize_splits
au!
- autocmd VimResized * :wincmd =
+ autocmd VimResized * :tabdo wincmd =
augroup END
" Only show cursorline in the current window and in normal mode {{{2
augroup END
" Jump to last known cursor position {{{2
-augroup cursor_pos
+augroup last_loc
au!
" blacklist certain filetype
let blacklist = ['gitcommit']
" bindings {{{1
-" allow both <space> and \ to be <leader>
-map <space> <leader>
-
" make
function! MakeWithOpt()
" TODO only do this if makeprg matches make