diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2015-10-10 16:56:22 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2015-10-10 16:56:22 +0200 |
commit | 0de043adbc144510635702dadedc946e3c69f64e (patch) | |
tree | 78e5d363305935cf5653a3f510ab86bb019c3199 /ftplugin/cabal.vim | |
parent | 67fcbd2a8632d5ab7895e34acb084117e5d0ea17 (diff) | |
download | vim-polyglot-0de043adbc144510635702dadedc946e3c69f64e.tar.gz vim-polyglot-0de043adbc144510635702dadedc946e3c69f64e.zip |
Update
Diffstat (limited to 'ftplugin/cabal.vim')
-rw-r--r-- | ftplugin/cabal.vim | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/ftplugin/cabal.vim b/ftplugin/cabal.vim deleted file mode 100644 index 0942397c..00000000 --- a/ftplugin/cabal.vim +++ /dev/null @@ -1,69 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1 - -if exists("g:loaded_haskellvim_cabal") - finish -endif - -let g:loaded_haskellvim_cabal = 1 - -function! s:makeSection(content) - return "\n" . join(a:content, "\n") -endfunction - -function! s:exeTmpl(name, src) - let l:exetmpl = [ 'executable ' . a:name, - \ '-- ghc-options:', - \ 'main-is: ' . a:src, - \ '-- other-modules:', - \ '-- other-extensions:', - \ 'build-depends: base', - \ '-- hs-source-dirs:', - \ 'default-language: Haskell2010' - \ ] - - return s:makeSection(l:exetmpl) -endfunction - -function! s:libTmpl() - let l:libtmpl = [ 'library', - \ '-- ghc-options:', - \ '-- other-modules:', - \ '-- other-extensions:', - \ 'build-depends: base', - \ '-- hs-source-dirs:', - \ 'default-language: Haskell2010' - \ ] - - return s:makeSection(l:libtmpl) -endfunction - -function! s:flagTmpl(name) - let l:flagtmpl = [ 'flag ' . a:name, - \ 'description:', - \ 'default: False', - \ 'manual: True', - \ ] - - return s:makeSection(l:flagtmpl) -endfunction - -function! cabal#addExecutable() - let l:name = input("Enter executable name: ") - let l:src = input("Enter source file: ") - exe "normal Go" . s:exeTmpl(l:name, l:src) -endfunction - -function! cabal#addLibrary() - exe "normal Go" . s:libTmpl() -endfunction - -function! cabal#addFlag() - let l:name = input("Enter flag name: ") - exe "normal Go" . s:flagTmpl(l:name) -endfunction - -command! -buffer CabalAddExecutable call cabal#addExecutable() -command! -buffer CabalAddLibrary call cabal#addLibrary() -command! -buffer CabalAddFlag call cabal#addFlag() - -endif |