[Haskell-cafe] Haskell IDE: Someone else interested in enhancingShim ? / How to contact author Benedikt Schmidt ?

Claus Reinke claus.reinke at talk21.com
Fri Apr 11 09:36:44 EDT 2008


Hi Marc,

when i first encountered Shim, i thought it was a nice idea, but
with a lot less emphasis on the vim side than on the emacs side.

also, iirc, Shim uses python's interprocess communication and i
didn't want to ask vim users to install python to get haskell 
functionality. so i found that Shim didn't help me to simplify my
own haskellmode plugins for vim [1]. perhaps all that has
changed, and information just hasn't reached this list yet?

but i like your suggestions, so i thought i'd comment as a 
non-Shim vim haskeller;-)

>        :GrepScope regex
>        Which greps the whole scope of all used packages by regex.
>        Very useful to find all functions taking/ returning some type etc

i have something similar in my .ghci file [2], allowing things
like ':grep Maybe :browse' or ':grep fold :browse'. it might be 
useful to have more direct access to it inside vim, but i'll wait
for user interest on this one.
 
>        :ModulesExporting identifier
>        returns all modules exporting identifiers. Can be used to 
>        add imports more automatically.

already supported in my haskellmode plugins; used for

|_?|                  browse Haddock entry for id under cursor
|_.|                  qualify unqualified id under cursor
|_i|                  add 'import <module>(<identifier>)' for id under cursor
|_im|                 add 'import <module>' for id under cursor

>        Completion:
>        camelCaseMatching
>        Use pSL<c-x><c-o> to get putStrLn

i like this so much that i've implemented it, too (still testing/modifying,
so it isn't online yet;-)! nice way to navigate/narrow down the huge 
menues of options one can otherwise get from completing short ids.
there are some interesting issues, though:

- i consider upper-case letters anchored at the start of patterns,
    so 'X<c-x><c-u>' will ignore things like 'fromX'

- apart from upper-case letters, i also use '.' for guidance,
    and as anchors, so that 'C.E.t<c-x><c-u>' will get you directly 
    to the 'Control.Exception.t' stuff, ignoring 'C[^.]E' stuff
    (depending on preferences, some might want '_'  for 
     guidance, too?)

- i need to enable CamelCase matching only when there are no 
    prefix matches, otherwise it will enlarge the completion options,
    offering unintended choices (and since those extra options
    will not have the same prefix, that prefix will disappear,
    eg if you actually mean 'pSomething', you try 'pS', and
    it will turn into 'p' -with a huge menu- because there are
    things like 'putStr', etc)

- there are now more possible matches and more matching,
    so things get a bit slower..

- i'm having an odd issue that interferes with incrementally
    adding upper-case letters to narrow completion options
    CamelCase style; but hitting <c-x><c-u> again works,
    so it might be a bug in my code?

but quite useful when it works, so thanks for the suggestion!-)

claus

[1] http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim
[2] http://haskell.cs.yale.edu/haskellwiki/GHCi#Using_.ghci.2C_a_mini-tutorial
        (everyone, please add your own .ghci tips to that wiki page!-)



More information about the Haskell-Cafe mailing list