set nocompatible filetype off " Leader let mapleader=" " " Map to space " File Navigation / Search nnoremap o :lua require'telescope.builtin'.git_files{} nnoremap O :lua require'telescope.builtin'.find_files{} nnoremap g :lua require'telescope.builtin'.live_grep{} nnoremap b :lua require'telescope.builtin'.buffers{} nnoremap f :NERDTreeFind nnoremap ag :Ack " Testing nnoremap :TestNearest autocmd FileType dockerfile nnoremap :!podman build -f % nnoremap t :TestFile nnoremap T :TestSuite nnoremap :tabn nnoremap :tabp nnoremap :tabnew " Git nnoremap gs :Git status nnoremap gc :Git commit nnoremap gS :Git commit --amend nnoremap go :GBrowse set hidden " Handle multiple buffers better " Interface color jellybeans set number " Show line numbers set showmode " Show the mode in use set cursorline " Highlight current line set wrap " Turn on line wrapping "set textwidth=79 " Force wrap at 79 characters set colorcolumn=80 " Show a column at 80 set title " Set the terminal title set visualbell " Disable beeping set mouse=a set shortmess=Ia " Disable start up message and abbreviate items " Show indication of newlines and trailing spaces nmap l :set list! set listchars=tab:▸\ ,trail:▝ set list " Status Bar set laststatus=2 " Always show status bar " Highlight the status bar when in insert mode au InsertEnter * hi StatusLine ctermfg=235 ctermbg=10 au InsertLeave * hi StatusLine ctermfg=15 ctermbg=240 " Search set hlsearch " Highlight all search matches set incsearch " Highlight matches as you type set ignorecase set smartcase " Be case-sensitive if expression contains a capital letter " Backup set nobackup set nowritebackup set directory=$HOME/.vim/tmp//,. " Keep swap files in one place " Formatting set tabstop=4 " Use 4 spaces to a tab set shiftwidth=4 " As above set expandtab " Expand tabs into spaces set showbreak=↪ " Completion set complete=.,w,b,u,t,i set completeopt=menu set wildmenu " Better completion in the CLI set wildmode=longest:full,full " Completion settings set wildignore+=*/venv/* " Use templates for new files " from https://twitter.com/petdance/status/1009826710752317440 autocmd BufNewFile * silent! 0r ~/.vim/templates/%:e autocmd BufNewFile * silent! 0r ~/.vim/templates/%:t " Files autocmd FileType gitcommit setlocal spell textwidth=72 autocmd FileType markdown setlocal spell textwidth=79 autocmd FileType apiblueprint setlocal spell textwidth=79 autocmd FileType javascript setlocal shiftwidth=2 autocmd FileType go setlocal noexpandtab au BufRead,BufNewFile *.dat set filetype=ledger " Yeah... these get typoed command W w command Q q command Wq wq command WQ wq " Wordcount command! Wc :w !wc " autocmd BufWritePre * :%s/\s\+$//e " Syntastic let g:syntastic_python_flake8_args="--max-complexity 10" " ack-vim let g:ackprg = 'ag --vimgrep' " vim-test " Override pytest, otherwise it may pick poetry run, which is incompatible " with shells like nixos let test#python#pytest#executable = 'pytest' if &term =~ "^screen" let test#strategy = "vimux" map q :call VimuxCloseRunner() else let test#strategy = "neovim" endif if &shell =~# 'fish$' set shell=bash endif " Podspecs ------ {{{ augroup ft_podspec autocmd! autocmd BufNewFile,BufRead,BufWrite *.podspec setlocal filetype=podspec autocmd BufNewFile,BufRead Podfile setlocal filetype=podfile autocmd FileType podspec,podfile set syntax=ruby autocmd FileType podspec set makeprg=pod\ spec\ lint\ % autocmd FileType podfile set makeprg=pod\ install augroup END " }}} " vsnip imap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' smap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' imap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' smap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : ''