diff options
Diffstat (limited to 'xxx/vim-old/vimrc')
| -rw-r--r-- | xxx/vim-old/vimrc | 527 |
1 files changed, 527 insertions, 0 deletions
diff --git a/xxx/vim-old/vimrc b/xxx/vim-old/vimrc new file mode 100644 index 0000000..1362055 --- /dev/null +++ b/xxx/vim-old/vimrc @@ -0,0 +1,527 @@ +"Miguel's VIMRC (some stuff added recently depends on NVIM) + +" {{{ NOTES +" THIS LOOSE NOTES REQUIRE REVIEW! +" external links to browser +" https://wiki.haskell.org/99_questions/Solutions/34 +" http://www.stephendiehl.com/posts/vim_2016.html +" https://github.com/lukerandall/haskellmode-vim +" :h compiler-plugin +" :help equalprg +" 15:15:33 gagbo | and then you can map it on key like nnoremap │ aauren +" | <F7> :compiler clang-tidy<CR>:make and nnoremap │ abbec +" | <F8> :compiler clang<CR>:make in like │ Accord +" | ~/.vim/after/ftplugin/cpp.vim for example +" https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/ +" https://mendo.zone/fun/neovim-setup-haskell/ +" https://github.com/aloiscochard/codex +" https://github.com/haskell/haskell-ide-engine#using-hie-with-vim-or-neovim ? +" ghc-mod, hlint (haskell) +" https://wiki.haskell.org/Vim +" http://www.alexeyshmalko.com/2014/using-vim-as-c-cpp-ide/ +" https://github.com/vim-airline/vim-airline +" https://github.com/spf13/spf13-vim +" http://antjanus.com/blog/thoughts-and-opinions/use-vim/ +" http://stevelosh.com/blog/2010/09/coming-home-to-vim/ +" http://derekingrouville.com/2012/vim-is-my-ide/ +" https://github.com/VundleVim/Vundle.vim +" draculatheme.com +" learnvimscriptthehardway.stevelosh.com " +" autocomplete +" jump to defintion / list calls / ctags shortcuts? +" spellcheck / translate / thesaurus / dict +" change mappings to more specific mappings and use noremap! +" toggle 'cursorline' via hotkey for nicer reading experience. +" ft=c.doxygen etc. +" include dependancies as git submodules (wherever possible?? seriously?) (licenses?) +" :help complete-functions +" quickfix +" compiler/debugger invocation +" release vim-colortune plugin +" load layout automatically on start (pff) +" ConqueGDB Resize +" Do something about startup lag (because of YouCompleteMe) +" Do something about the input problems in ConqueGDB/Term (YouCompl?) +" implement a plugin for fast-reading (check if one exists first ;)) +" plugins on vim.org etc. +" syntastic! https://github.com/vim-syntastic/syntastic +" vimproc! https://github.com/Shougo/vimproc.vim +" pathogen / vundle DONE +" NerdTree DONE +" minibufexpl DONE +" fugitive DONE +" vim-sensible DONE +" taglist.vim +" snipMate +" c.vim +" autocomplpop +" surround +" perl-support +" matchit +" vimspell +" conqueshell +" fuzzyfinder +" Nerd Commenter +" tSkeleton +" grep +" cppcomplete +" colortest +" colour sampler pack +" gundo +" CScope / CCTree +" inline reference/ (stlrefvim?) +" emmet.io (webdev) +" }}} + +" {{{ VUNDLE +" As required by https://github.com/VundleVim/Vundle.vim +set nocompatible +filetype off +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() + +" Plugin 'Valloric/YouCompleteMe' +" Plugin 'Shougo/vimproc.vim' +" Plugin 'vim-scripts/Conque-GDB' +" Plugin 'dracula/vim' +" Plugin 'git://ex40.softwarefools.com/vim-potion.git' +" Plugin 'git://ex40.softwarefools.com/vim-colortune.git' +" Plugin 'terryma/vim-multiple-cursors' + +Plugin 'gmarik/Vundle.vim' + +Plugin 'scrooloose/nerdtree' +Plugin 'altercation/vim-colors-solarized' +Plugin 'fholgado/minibufexpl.vim' +Plugin 'majutsushi/tagbar' + +Plugin 'tpope/vim-fugitive' +Plugin 'tpope/vim-sensible' +Plugin 'tpope/vim-surround' + +Plugin 'MarcWeber/vim-addon-mw-utils' +Plugin 'tomtom/tlib_vim' + +Plugin 'garbas/vim-snipmate' +Plugin 'honza/vim-snippets' + +Plugin 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' } +Plugin 'neomake/neomake' +Plugin 'parsonsmatt/intero-neovim' +Plugin 'neovimhaskell/haskell-vim' +Plugin 'mileszs/ack.vim' + +call vundle#end() +filetype plugin indent on +" }}} + +"{{{ DISABLED +" limited .vimrc in current dir +" set exrc +" set secure + +" let g:ConqueGdb_Leader = '\' +" let g:ConqueTerm_CloseOnEnd = 1 + +" let g:potion_command = "/home/miguel/int/dev/potion/bin/potion" + +" set wrap +" set showbreak=>_ + +" move line under the cursor up and down. +" nnoremap <leader>- ddp +" nnoremap <leader>_ kddpk + +" abbreviations and typo correction +" iabbrev teh the +" set spell +" }}} + +" {{{ BASICS + +" {{{ mapleaders +" use <space> but remap to _ so it is visible for 'showcmd' +nmap <space> _ +let mapleader="\_" +let maplocalleader="\_" +" }}} + +" {{{ misc +set autoread +set foldmethod=marker +set nowrap +set backspace=2 +" set ruler +set showcmd +set number +set hidden + +"set cursorcolumn +set cursorline + +" save before making etc. +set autowrite + +" some nice candy +set laststatus=2 "always show status line on last window +set wildmenu + +" indent +" set autoindent +" set cindent + +" mouse support in xterm +set mouse=a + +"other +set previewheight=10 + +" http://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally +" set splitbelow +" set splitright + +" easy move between windows +nnoremap <C-J> <C-W><C-J> +nnoremap <C-K> <C-W><C-K> +nnoremap <C-L> <C-W><C-L> +nnoremap <C-H> <C-W><C-H> +" }}} + +" {{{ statusline +set statusline=%f " Path to the file +set statusline+=%m " modified flag +set statusline+=[%n] " buffer number +set statusline+=%= " Switch to the right side +set statusline+=%l,%c " Current line,column +set statusline+=\ (%L,%P) " Percentage +"set statusline& " reset +" }}} + +" {{{ terminal width / colorcolumn +" http://richarddingwall.name/2008/05/31/is-the-80-character-line-limit-still-relevant/ +" +" set tw=80 +" set tw=72 +" set tw=78 (for instance vims :help) +set tw=0 +set colorcolumn=73 +" }}} + +" {{{ tabs +set listchars=tab:>. +set tabstop=8 +set expandtab +set softtabstop=4 +set shiftwidth=4 +set shiftround +" }}} + +" {{{ folding +set foldcolumn=5 +set foldlevelstart=0 +" }}} + +" {{{ colorscheme / syntax highlight +syntax enable + +if has('gui_running') + set background=light +else + set background=dark +endif + +set background=dark + +colorscheme solarized + +hi SpellBad ctermfg=white +hi SpellBad ctermbg=red + +syntax sync fromstart +" }}} + +" {{{ minimal gui +" set guioptions= +set guioptions-=m +set guioptions-=T +set guioptions-=r +set guioptions-=L +set guifont=Monospace\ 9 +" }}} + +" {{{ search +set hlsearch +set incsearch +" }}} + +" {{{ match brackets +set showmatch +set matchtime=5 +" }}} +" }}} + +" {{{ KEY BINDINGS + +" temporary mappings, to get rid of bad habits. +" inoremap <esc> <nop> +" inoremap <Up> <nop> +" inoremap <Down> <nop> +" inoremap <Left> <nop> +" inoremap <Right> <nop> + +" map <F5> :silent make \| copen \| redraw!<CR> +" map <F5> :silent make \| redraw!<CR> +" map <F5> :make<CR> +" nnoremap <C-]> <C-]>:tselect<CR> +" nnoremap <leader>cc :call Colortune_fill()<cr> + +" make +" nnoremap <leader>mm :silent make!<cr> +" nnoremap <leader>mc :silent make! clean<cr> +" nnoremap <leader>mn :silent make! new<cr> +" nnoremap <leader>mr :silent make!<cr>:call system("make run &")<cr> +" nnoremap <leader>md :silent make!<cr>:call system("make debug &")<cr> +" nnoremap <leader>ms :silent make! stop<cr> +" nnoremap <leader>mf :silent make! %:r<cr>:redraw! <cr> +" nnoremap <leader>mx :silent make! %:r <bar> !./%:r<cr> +" +" session handling +" nnoremap <leader>ss :call Session_save()<cr> +" nnoremap <leader>sl :call Session_load()<cr> +" +" retab +" map <leader>rt :retab!<CR> + + +" activate 'very magic' for searches automatically +nnoremap / /\v +nnoremap ? ?\v + +" alt esc in insert mode +inoremap jk <esc> + +" toggle tabs visibility +noremap <leader>t :set invlist<CR> + +" easy editing and sourcing of vimrc +" nnoremap <leader>sv :source $MYVIMRC<cr> +nnoremap <leader>ev :e $MYVIMRC<cr> + +" turn off search highlight +nnoremap <leader>h :nohlsearch<cr> + +" toggle visibility of trailing whitespaces +nnoremap <leader>w :match ErrorMsg /\v +$/<cr> +nnoremap <leader>W :match<cr> + +" toggle and navigate quickfix window +nnoremap <leader>cn :cnext<cr> +nnoremap <leader>cp :cprevious<cr> +nnoremap <leader>cc :cc<cr> +nnoremap <leader>cq :copen<cr> +nnoremap <leader>cQ :cclose<cr> + +" buffer navigaion +nnoremap <leader>bn :MBEbn<cr> +nnoremap <leader>bp :MBEbp<cr> +nnoremap <leader>bd :MBEbd<cr> + +" layout +nnoremap <leader>ln :NERDTreeToggle<cr> +nnoremap <leader>lt :TagbarToggle<cr> +nnoremap <leader>lm :MBEToggle<cr> +"nnoremap <leader>lg :ConqueGdb<cr> + +" silver search +noremap <leader>a :Ack!<Space> + +" stylish-haskell +" noremap <leader>sh :!stylish-haskell + +" ctrl-space auto complete in insert mode +inoremap <C-Space> <C-N> + +" show list if multiple ctrl-] matches +nnoremap <C-]> g<C-]> +" }}} + +" {{{ FILETYPES +" {{{ custom highlight (twig) +augroup filetype_custom_highlight + autocmd! + au BufRead,BufNewFile *.twig set filetype=htmljinja +augroup END +" }}} + +" {{{ markdown +augroup filetype_markdown + autocmd! + "autocmd FileType markdown setlocal spell + "autocmd FileType markdown setlocal list +augroup END +" }}} + +" {{{ cpp +augroup filetype_cpp + autocmd! + autocmd FileType cpp nnoremap <buffer> <localleader>c I//<esc> + autocmd FileType cpp :iabbrev <buffer> iff if () <cr>{<cr>}jkF + autocmd FileType cpp nnoremap <buffer> <leader>bo :r ~/_int/dev/misc/c++/template/template.cpp<cr> +augroup END +" }}} + +" {{{ haskell +augroup filetype_haskell + autocmd! + autocmd FileType haskell setlocal formatprg=stylish-haskell + autocmd FileType haskell setlocal softtabstop=2 + autocmd FileType haskell setlocal shiftwidth=2 +" autocmd FileType haskell setlocal foldmethod=marker +" autocmd Filetype haskell map <F5> :w<ENTER>:term cabal -- exec runghc %<ENTER> +" autocmd Filetype haskell map <F5> :w<ENTER>:term make<ENTER> +" autocmd Filetype haskell map <F5> :w<ENTER>:term make<ENTER> +" autocmd FileType haskell setlocal expandtab +augroup END +" }}} +" }}} + +" ADDED AT WORK +if has ("nvim") +tnoremap <Esc> <C-\><C-n> +endif + +augroup interoMaps + au! + " Maps for intero. Restrict to Haskell buffers so the bindings don't collide. + + " Background process and window management + au FileType haskell nnoremap <silent> <leader>is :InteroStart<CR> + au FileType haskell nnoremap <silent> <leader>ik :InteroKill<CR> + au FileType haskell nnoremap <silent> <leader>ir :InteroReload<CR> + + " Open intero/GHCi split horizontally + au FileType haskell nnoremap <silent> <leader>io :InteroOpen<CR> + " Open intero/GHCi split vertically + au FileType haskell nnoremap <silent> <leader>iov :InteroOpen<CR><C-W>H + au FileType haskell nnoremap <silent> <leader>ih :InteroHide<CR> + + " Reloading (pick one) + " Automatically reload on save + " au BufWritePost *.hs InteroReload + " Manually save and reload + au FileType haskell nnoremap <silent> <leader>wr :w \| :InteroReload<CR> + + " Load individual modules + au FileType haskell nnoremap <silent> <leader>il :InteroLoadCurrentModule<CR> + au FileType haskell nnoremap <silent> <leader>if :InteroLoadCurrentFile<CR> + + " Type-related information + " Heads up! These next two differ from the rest. + au FileType haskell map <silent> <leader>t <Plug>InteroGenericType + au FileType haskell map <silent> <leader>T <Plug>InteroType + au FileType haskell nnoremap <silent> <leader>it :InteroTypeInsert<CR> + + " Navigation + au FileType haskell nnoremap <silent> <leader>jd :InteroGoToDef<CR> + + " Managing targets + " Prompts you to enter targets (no silent): + au FileType haskell nnoremap <leader>ist :InteroSetTargets<SPACE> +augroup END + +" Intero starts automatically. Set this if you'd like to prevent that. +let g:intero_start_immediately = 0 + +" Enable type information on hover (when holding cursor at point for ~1 second). +let g:intero_type_on_hover = 1 + +" Change the intero window size; default is 10. +let g:intero_window_size = 10 + +" Sets the intero window to split vertically; default is horizontal +let g:intero_vertical_split = 0 + +" disable neomake +let g:intero_use_neomake = 0 + +" OPTIONAL: Make the update time shorter, so the type info will trigger faster. +set updatetime=1000 + +"https://github.com/MarcWeber/hasktags/blob/assets/hasktags.vim +let g:tagbar_type_haskell = { + \ 'ctagsbin' : 'hasktags', + \ 'ctagsargs' : '-x -c -o-', + \ 'kinds' : [ + \ 'm:modules:0:1', + \ 'd:data:0:1', + \ 'd_gadt:data gadt:0:1', + \ 'nt:newtype:0:1', + \ 'c:classes:0:1', + \ 'i:instances:0:1', + \ 'cons:constructors:0:1', + \ 'c_gadt:constructor gadt:0:1', + \ 'c_a:constructor accessors:1:1', + \ 't:type names:0:1', + \ 'pt:pattern types:0:1', + \ 'pi:pattern implementations:0:1', + \ 'ft:function types:0:1', + \ 'fi:function implementations:0:1', + \ 'o:others:0:1' + \ ], + \ 'sro' : '.', + \ 'kind2scope' : { + \ 'm' : 'module', + \ 'd' : 'data', + \ 'd_gadt' : 'd_gadt', + \ 'c_gadt' : 'c_gadt', + \ 'nt' : 'newtype', + \ 'cons' : 'cons', + \ 'c_a' : 'accessor', + \ 'c' : 'class', + \ 'i' : 'instance' + \ }, + \ 'scope2kind' : { + \ 'module' : 'm', + \ 'data' : 'd', + \ 'newtype' : 'nt', + \ 'cons' : 'c_a', + \ 'd_gadt' : 'c_gadt', + \ 'class' : 'ft', + \ 'instance' : 'ft' + \ } +\ } + +" do not show minibuf +let g:miniBufExplorerAutoStart = 0 +let g:miniBufExplBRSplit = 0 "put above/left +let g:miniBufExplVSplit = 20 +let g:miniBufExplSplitToEdge = 0 +let g:miniBufExplMaxSize = 25 + +let g:intero_load_targets= ["twg:lib","twg:exe:twg"] + +let g:ghcid_keep_open = 0 + +" show trailing whitespace per default: +" match ErrorMsg /\v +$/ + +" let g:ackprg = 'ag --nogroup --nocolor --column' +let g:ackprg = 'ag --vimgrep' +let g:ackhighlight = 1 +" let g:ack_autoclose = 1 +" let g:ack_autofold_results = 1 +cnoreabbrev Ack Ack! + +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 +let g:intero_prompt_regex= ' >' +" let g:haskell_classic_highlighting = 1 + +let NERDTreeQuitOnOpen=1 +set ignorecase +set smartcase |
