Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better tabular

  • Loading branch information...
commit de0babd670e63372a51d90fac0060bf77d6ad5d2 1 parent 85c75eb
@dag authored
View
11 README.md
@@ -180,12 +180,13 @@ snippets by hitting `Ctrl+Tab` in INPUT mode.
Another useful Vimscript is
[Tabular](https://github.com/godlygeek/tabular). If it's installed, vim2hs
-can provide some named patterns useful for aligning Haskell code. This
-feature is disabled by default since patterns are global and override
-existing patterns in case of a name conflict.
+adds some named patterns useful for maintaining layout in Haskell code.
+You can list all named patterns by tab-completing after entering the
+`:Tabularize` command. You probably want to configure some mappings or
+commands for the ones you find useful.
-To enable them, use this configuration:
+To disable them, use this configuration:
```vim
-let g:haskell_tabular = 1
+let g:haskell_tabular = 0
```
View
2  after/plugin/tabular_haskell.vim
@@ -1,4 +1,4 @@
-call vim2hs#letdefault('g:haskell_tabular', 0)
+call vim2hs#letdefault('g:haskell_tabular', 1)
if g:haskell_tabular && exists(':Tabularize')
call vim2hs#haskell#editing#tabular()
View
14 autoload/vim2hs/haskell/editing.vim
@@ -20,11 +20,11 @@ endfunction " }}}
function! vim2hs#haskell#editing#tabular() " {{{
- AddTabularPattern! ( /^[^(]*\zs(/l1r0
- AddTabularPattern! as / as /l0r0
- AddTabularPattern! = /^[^=]*\zs=/
- AddTabularPattern! :: / :: /l0r0
- AddTabularPattern! : /^[^:]*\zs:/
- AddTabularPattern! > / -> /l0r0
- AddTabularPattern! < / <- /l0r0
+ AddTabularPattern! colon /^[^:]*\zs:/
+ AddTabularPattern! haskell_binding /^[^=]*\zs=/
+ AddTabularPattern! haskell_do_arrow / <- /l0r0
+ AddTabularPattern! haskell_function_arrow / -> /l0r0
+ AddTabularPattern! haskell_import_as / as /l0r0
+ AddTabularPattern! haskell_type / :: /l0r0
+ AddTabularPattern! parenthesis /^[^(]*\zs(/l1r0
endfunction " }}}
Please sign in to comment.
Something went wrong with that request. Please try again.