From f70d5dc9b1f546bcfae67f067fe2e3b67f94ca45 Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 3 Nov 2021 19:59:44 +0100 Subject: improving dotfiles --- xxx/vim-old/vimrc | 527 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 527 insertions(+) create mode 100644 xxx/vim-old/vimrc (limited to 'xxx/vim-old/vimrc') 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 +" | :compiler clang-tidy:make and nnoremap │ abbec +" | :compiler clang: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 - ddp +" nnoremap _ kddpk + +" abbreviations and typo correction +" iabbrev teh the +" set spell +" }}} + +" {{{ BASICS + +" {{{ mapleaders +" use but remap to _ so it is visible for 'showcmd' +nmap _ +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 +nnoremap +nnoremap +nnoremap +" }}} + +" {{{ 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 +" inoremap +" inoremap +" inoremap +" inoremap + +" 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 +nnoremap ? ?\v + +" alt esc in insert mode +inoremap jk + +" toggle tabs visibility +noremap t :set invlist + +" easy editing and sourcing of vimrc +" nnoremap sv :source $MYVIMRC +nnoremap ev :e $MYVIMRC + +" turn off search highlight +nnoremap h :nohlsearch + +" toggle visibility of trailing whitespaces +nnoremap w :match ErrorMsg /\v +$/ +nnoremap W :match + +" toggle and navigate quickfix window +nnoremap cn :cnext +nnoremap cp :cprevious +nnoremap cc :cc +nnoremap cq :copen +nnoremap cQ :cclose + +" buffer navigaion +nnoremap bn :MBEbn +nnoremap bp :MBEbp +nnoremap bd :MBEbd + +" layout +nnoremap ln :NERDTreeToggle +nnoremap lt :TagbarToggle +nnoremap lm :MBEToggle +"nnoremap lg :ConqueGdb + +" silver search +noremap a :Ack! + +" stylish-haskell +" noremap sh :!stylish-haskell + +" ctrl-space auto complete in insert mode +inoremap + +" show list if multiple ctrl-] matches +nnoremap g +" }}} + +" {{{ 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 c I// + autocmd FileType cpp :iabbrev iff if () {}jkF + autocmd FileType cpp nnoremap bo :r ~/_int/dev/misc/c++/template/template.cpp +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 :w:term cabal -- exec runghc % +" autocmd Filetype haskell map :w:term make +" autocmd Filetype haskell map :w:term make +" autocmd FileType haskell setlocal expandtab +augroup END +" }}} +" }}} + +" ADDED AT WORK +if has ("nvim") +tnoremap +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 is :InteroStart + au FileType haskell nnoremap ik :InteroKill + au FileType haskell nnoremap ir :InteroReload + + " 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: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 -- cgit v1.2.3