From 79e86a6cbc485778e69892605a2624354f8d5f2b Mon Sep 17 00:00:00 2001 From: "Andrew R. M" Date: Thu, 6 Apr 2017 10:46:02 -0400 Subject: [PATCH] Reorganized .vimrc and added support for hasktags to tagbar --- vim/.vimrc | 91 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 28 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index f14e16e..c873f1a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -3,36 +3,11 @@ " Use vim defaults " set nocompatible -"{- PLUGINS -}" - - " Load pathogen, the plugin manager, and all of the plugins " +"{- PLUGIN MANAGER -}" + " Load pathogen, the plugin manager, which then loads all plugins " runtime bundle/pathogen/autoload/pathogen.vim execute pathogen#infect() - "{- SLIME -}" - " Use screen as slime's target - let g:slime_target = "screen" - - " Use a temporary file to contain slime's paste buffer - let g:slime_paste_file = tempname() - - " Default session for screen - let g:slime_default_config = {"sessionname": "REPL", "windowname": ""} - - "{- SUPERTAB -}" - " Use the default vim completion keys for supertab completion - let g:SuperTabMappingForward = '' - let g:SuperTabMappingBackward = '' - - " Use context sensitive completion to allow filename and omni completion - let g:SuperTabDefaultCompletionType = "context" - - " Completion context only lasts for current completion - let g:SuperTabRetainCompletionDuration = "completion" - - " Use enhanced longest matching completion - let g:SuperTabLongestEnhanced = 1 - "{- COMMANDS -}" " Remove blank lines " @@ -53,7 +28,6 @@ set nocompatible " Toggle line numbering command! Numbers :setlocal number! relativenumber! - "{- INTERFACE -}" " Colors and syntax highlighting " @@ -147,3 +121,64 @@ set nocompatible if has("clipboard") set clipboard=unnamed,unnamedplus endif + +"{- PLUGINS -}" + + "{- SLIME -}" + " Use screen as slime's target + let g:slime_target = "screen" + + " Use a temporary file to contain slime's paste buffer + let g:slime_paste_file = tempname() + + " Default session for screen + let g:slime_default_config = {"sessionname": "REPL", "windowname": ""} + + "{- SUPERTAB -}" + " Use the default vim completion keys for supertab completion + let g:SuperTabMappingForward = '' + let g:SuperTabMappingBackward = '' + + " Use context sensitive completion to allow filename and omni completion + let g:SuperTabDefaultCompletionType = "context" + + " Completion context only lasts for current completion + let g:SuperTabRetainCompletionDuration = "completion" + + " Use enhanced longest matching completion + let g:SuperTabLongestEnhanced = 1 + + "{- TAGBAR -}" + " Use `hasktags` to generate tags for Haskell files + 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', + \ 't:type names:0:1', + \ 'nt:new types:0:1', + \ 'c:classes:0:1', + \ 'cons:constructors:1:1', + \ 'c_gadt:constructor gadt:1:1', + \ 'c_a:constructor accessors:1:1', + \ 'ft:function types:1:1', + \ 'fi:function implementations:0:1', + \ 'o:others:0:1' + \ ], + \ 'sro' : '.', + \ 'kind2scope' : { + \ 'm' : 'module', + \ 'c' : 'class', + \ 'd' : 'data', + \ 't' : 'type' + \ }, + \ 'scope2kind' : { + \ 'module' : 'm', + \ 'class' : 'c', + \ 'data' : 'd', + \ 'type' : 't' + \ } + \ } +