set nocompatible " be iMproved, required filetype indent plugin on " required set modeline set modelines=1 set nowrap set viminfo='100,<100,s20 " vim file history set hidden set expandtab set shiftwidth=2 set number set relativenumber set undolevels=1000 set undoreload=10000 set updatetime=300 let mapleader = " " nmap :w imap :w vmap gv noremap y "+y noremap p "+p noremap i noremap j noremap k noremap h i vnoremap K L vnoremap I H vnoremap H I nnoremap K L nnoremap I H nnoremap H I map i :wincmd k map j :wincmd h map k :wincmd j map l :wincmd l map I :wincmd K map J :wincmd H map K :wincmd J map L :wincmd L " replay macro for each line of a visual selection xnoremap @q :normal @q xnoremap @@ :normal @@ " reselect and re-yank any text that is pasted in visual mode xnoremap p pgvy " Escape overwrite inoremap jj " Open new buffer nmap T :enew " Move to the next buffer nmap l :bnext " Move to the previous buffer nmap j :bprevious " Close the current buffer and move to the previous one " This replicates the idea of closing a tab nmap q :bp bd # " Show all open buffers and their status nmap bl :ls " Mapping selecting mappings nmap (fzf-maps-n) xmap (fzf-maps-x) omap (fzf-maps-o) nmap :Files imap :Files " Insert mode completion imap (fzf-complete-word) imap (fzf-complete-path) imap (fzf-complete-file) imap (fzf-complete-line) " Clear quickfix shortcut nmap c :ccl " netrw let g:netrw_fastbrowse=0 " fzf with file preview command! -bang -nargs=? -complete=dir Files \ call fzf#vim#files(, fzf#vim#with_preview(), 0) "command! -bang -nargs=? -complete=dir Files " \ call fzf#vim#files(, fzf#vim#with_preview({'options': '--preview "' . "grep -Pzo '.*See docs/COPYRIGHT.rdoc for more details(.*\n)*' {}" . '"'}), 0) " Auto-FMT rust code on save let g:rustfmt_autosave = 1 " Indenting in html template tags let g:html_indent_style1 = "inc" " yank highlight duration let g:highlightedyank_highlight_duration = 200 " Markdown options let g:vim_markdown_folding_disabled = 1 " Haskell options let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` let g:haskell_backpack = 1 " to enable highlighting of backpack keywords " Emmet let g:user_emmet_leader_key='' " Minimap settings let g:minimap_auto_start = 1 " Ack if executable('ag') let g:ackprg = 'ag --vimgrep' endif " Remember cursor position " Vim jumps to the last position when reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif