From dedbb5b35d4aa2f066482abc227214b712378b0e Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 6 Jun 2019 22:47:45 +0200 Subject: haskelling in nvim and tmux --- vim/vimrc | 229 +++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 167 insertions(+), 62 deletions(-) (limited to 'vim/vimrc') diff --git a/vim/vimrc b/vim/vimrc index fd0d8d9..022b39a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,8 +1,4 @@ -""""""""""""""""""""""""""""""""""""" -" Miguel's .vimrc " -" Author: m.i@gmx.at " -" Last Update: 2019-05-25 " -""""""""""""""""""""""""""""""""""""" +"Miguel's VIMRC (some stuff added recently depends on NVIM) " {{{ NOTES " THIS LOOSE NOTES REQUIRE REVIEW! @@ -41,7 +37,7 @@ " :help complete-functions " quickfix " compiler/debugger invocation -" release vim-colortune plugin +" release vim-colortune plugin " load layout automatically on start (pff) " ConqueGDB Resize " Do something about startup lag (because of YouCompleteMe) @@ -57,7 +53,7 @@ " vim-sensible DONE " taglist.vim " snipMate -" c.vim +" c.vim " autocomplpop " surround " perl-support @@ -78,36 +74,41 @@ " }}} " {{{ VUNDLE -" as required by https://github.com/VundleVim/Vundle.vim -set nocompatible -filetype off +" As required by https://github.com/VundleVim/Vundle.vim +set nocompatible +filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() -Plugin 'gmarik/Vundle.vim' + " 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 '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 'Shougo/vimproc.vim' Plugin 'MarcWeber/vim-addon-mw-utils' Plugin 'tomtom/tlib_vim' Plugin 'garbas/vim-snipmate' Plugin 'honza/vim-snippets' -" Plugin 'vim-scripts/Conque-GDB' -" Plugin 'dracula/vim' -" Plugin 'git://ex40.softwarefools.com/vim-potion.git' -" Plugin 'git://ex40.softwarefools.com/vim-colortune.git' -call vundle#end() +Plugin 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' } " added at work +Plugin 'neomake/neomake' +Plugin 'parsonsmatt/intero-neovim' + +call vundle#end() filetype plugin indent on " }}} -"{{{ DISABLED - +"{{{ DISABLED " limited .vimrc in current dir -" set exrc +" set exrc " set secure " let g:ConqueGdb_Leader = '\' @@ -124,15 +125,11 @@ filetype plugin indent on " abbreviations and typo correction " iabbrev teh the - +" set spell " }}} " {{{ BASICS -" {{{ spelling OFF -" set spell -" }}} - " {{{ mapleaders " use but remap to _ so it is visible for 'showcmd' nmap _ @@ -141,8 +138,6 @@ let maplocalleader="\_" " }}} " {{{ misc - -set nocompatible set foldmethod=marker set nowrap set backspace=2 @@ -169,7 +164,7 @@ set wildmenu set mouse=a "other -set previewheight=25 +set previewheight=10 " http://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally " set splitbelow @@ -180,7 +175,6 @@ nnoremap nnoremap nnoremap nnoremap - " }}} " {{{ statusline @@ -191,7 +185,7 @@ set statusline+=\ (%L,%P) " Percentage "set statusline& " reset " }}} -" {{{ terminal width / colocolumn +" {{{ terminal width / colorcolumn " http://richarddingwall.name/2008/05/31/is-the-80-character-line-limit-still-relevant/ " " set tw=80 @@ -252,7 +246,6 @@ set incsearch set showmatch set matchtime=5 " }}} - " }}} " {{{ KEY BINDINGS @@ -264,11 +257,29 @@ set matchtime=5 " inoremap " inoremap -"map :silent make \| copen \| redraw! -"map :silent make \| redraw! -"map :make -"nnoremap :tselect -"nnoremap cc :call Colortune_fill() +" map :silent make \| copen \| redraw! +" map :silent make \| redraw! +" map :make +" nnoremap :tselect +" nnoremap cc :call Colortune_fill() + +" make +" nnoremap mm :silent make! +" nnoremap mc :silent make! clean +" nnoremap mn :silent make! new +" nnoremap mr :silent make!:call system("make run &") +" nnoremap md :silent make!:call system("make debug &") +" nnoremap ms :silent make! stop +" nnoremap mf :silent make! %:r:redraw! +" nnoremap mx :silent make! %:r !./%:r +" +" session handling +" nnoremap ss :call Session_save() +" nnoremap sl :call Session_load() +" +" retab +" map rt :retab! + " activate 'very magic' for searches automatically nnoremap / /\v @@ -277,9 +288,6 @@ nnoremap ? ?\v " alt esc in insert mode inoremap jk -" retab -" map rt :retab! - " toggle tabs visibility noremap t :set invlist @@ -304,32 +312,16 @@ nnoremap bn :MBEbn nnoremap bp :MBEbp nnoremap bd :MBEbd -" make -" nnoremap mm :silent make! -" nnoremap mc :silent make! clean -" nnoremap mn :silent make! new -" nnoremap mr :silent make!:call system("make run &") -" nnoremap md :silent make!:call system("make debug &") -" nnoremap ms :silent make! stop -" nnoremap mf :silent make! %:r:redraw! -" nnoremap mx :silent make! %:r !./%:r - -" session handling -" nnoremap ss :call Session_save() -" nnoremap sl :call Session_load() - " layout nnoremap ln :NERDTreeToggle nnoremap lt :TagbarToggle -"nnoremap lg :ConqueGdb nnoremap lm :MBEToggle nnoremap lq :copen - +"nnoremap lg :ConqueGdb " }}} " {{{ FILETYPES - -" {{{ custom highlight +" {{{ custom highlight (twig) augroup filetype_custom_highlight autocmd! au BufRead,BufNewFile *.twig set filetype=htmljinja @@ -339,9 +331,8 @@ augroup END " {{{ markdown augroup filetype_markdown autocmd! - autocmd FileType markdown setlocal spell -" autocmd FileType markdown setlocal spell - " autocmd FileType markdown setlocal list + "autocmd FileType markdown setlocal spell + "autocmd FileType markdown setlocal list augroup END " }}} @@ -352,7 +343,6 @@ augroup filetype_cpp autocmd FileType cpp :iabbrev iff if () {}jkF autocmd FileType cpp nnoremap bo :r ~/_int/dev/misc/c++/template/template.cpp augroup END - " }}} " {{{ haskell @@ -365,5 +355,120 @@ augroup filetype_haskell " autocmd FileType haskell setlocal expandtab augroup END " }}} - " }}} + +" ADDED AT WORK +tnoremap + +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 is :InteroStart + au FileType haskell nnoremap ik :InteroKill + + " Open intero/GHCi split horizontally + au FileType haskell nnoremap io :InteroOpen + " Open intero/GHCi split vertically + au FileType haskell nnoremap iov :InteroOpenH + au FileType haskell nnoremap ih :InteroHide + + " Reloading (pick one) + " Automatically reload on save + " au BufWritePost *.hs InteroReload + " Manually save and reload + au FileType haskell nnoremap wr :w \| :InteroReload + + " Load individual modules + au FileType haskell nnoremap il :InteroLoadCurrentModule + au FileType haskell nnoremap if :InteroLoadCurrentFile + + " Type-related information + " Heads up! These next two differ from the rest. + au FileType haskell map t InteroGenericType + au FileType haskell map T InteroType + au FileType haskell nnoremap it :InteroTypeInsert + + " Navigation + au FileType haskell nnoremap jd :InteroGoToDef + + " Managing targets + " Prompts you to enter targets (no silent): + au FileType haskell nnoremap ist :InteroSetTargets +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"] + +let g:ghcid_keep_open = 1 +" show trailing whitespace per default: +match ErrorMsg /\v +$/ -- cgit v1.2.3