Live data from Hacker News

Intero for Emacs: complete interactive development program for Haskell

commercialhaskell.github.io

51–60 of 75 posts

Re: Intero for Emacs: complete interactive development program for Haskell

#51
post #36
post #5

I've been waiting for this release before finally trying to switch from Vim (MacVim) to Spacemacs. Anybody have any tips for somebody who's never really used Emacs?

I had used IDE's, windows based text editors like UltraEdit, and vi/vim for the longest time before I decided it was time to go back to Emacs. I dedicated two weeks to using it almost exclusively to pick up the muscle memory of major keybindings. I haven't looked back since. The keys I really needed out of the gate: * F3/F4 - building macros, then C-x e to execute (after that, just plain e) * C-s - search * M-s o - o…

Eww, chords?

This is spacemacs, just use the leader key...

Re: Intero for Emacs: complete interactive development program for Haskell

#52
post #23
post #11

Earlier quoted context omitted.

I'm a emacs convert from vim (big reason is because module support is just leagues ahead of vim, Vundle, Pathogen, or anything else don't come close to emacs package management). A huge reason why I stuck with it is because evil. evil is very mature and is incredibly close to vim, some say it's a better vim than vim. I tried a lot of "vi modes" in several IDEs but none of them cut it, you can map anything to evil and…

I tried to use Spacemacs but in vim I have hjkl mapped to jkl;. I simply could not find a way to do this in Spacemacs. All the solutions suggested did not apply to every mode and there was always some mode where I had to revert to hjkl. Is there any solution for this problem?

I use spacemacs and want to play with the vim part more, but I type dvorak, so I wanted to do a similar remapping and remap hjkl to htns so I would also be curious to hear if anyone has a good way to do that.

Re: Intero for Emacs: complete interactive development program for Haskell

#53
post #28

I wish I could get a similar utility for Python and Javascript as this seems to show off some cool FP auto complete. I'm basically looking for a way to remove my dependency on my 5-7 IDEs and I don't know how. I wish someone could show me a very good, simple, alternative to all of them. I work in C, Java, JavaScript, Python, PHP, and C# and I'd like to be able to use a single IDE solution for all of them. Sadly I can…

> Sadly I cant find anything with good auto completion and nice features (like things offered by Eclipse). Out of curiosity, have you tried the relevant JetBrains IDE(s)?

eclim is the best you're gunna do for Java in Emacs I think, and it's realllllllllly slow.

Re: Intero for Emacs: complete interactive development program for Haskell

#54
post #5

I've been waiting for this release before finally trying to switch from Vim (MacVim) to Spacemacs. Anybody have any tips for somebody who's never really used Emacs?

I'm not using Spacemacs, but rather Evil mode in Emacs. I think the biggest thing I would caution is to expect small things to be different. For example underscores are word boundaries in Emacs. File selection is different. Some modes do not have vi key bindings set up by default. Escape doesn't always work to abort (you need to get used to pressing ctl-g). Omni complete is absent and completion in Emacs works quite…

> For example underscores are word boundaries in Emacs

This is configurable [1]

>The word commands’ understanding of word boundaries is controlled by the syntax table. Any character can, for example, be declared to be a word delimiter.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Wo...

Re: Intero for Emacs: complete interactive development program for Haskell

#55
post #40

Earlier quoted context omitted.

Macros combine great with another amazing feature: registers. Hit C-x C-k b [0-9] and the macro can be called with C-x C-k [number chosen]. This way you can quickly use multiple macros. You can also C-x C-k n NAME to save the macro as a callable function and if you then decide that it would be useful in the future, just call insert-kbd-macro and emacs will generate the lisp code that defines your macro and you can pu…

Third person I see running last macro with C-x e. In my setup, and I think it's standard, repeating f4 is enough.

Interesting, I'll have to try that. When I found macros, I did open with C-x ( and close with C-x ), so C-x e makes sense. Then I found f3 and f4 and didn't bother to unlearn that binding.

Re: Intero for Emacs: complete interactive development program for Haskell

#56
post #28

Earlier quoted context omitted.

> Sadly I cant find anything with good auto completion and nice features (like things offered by Eclipse). Out of curiosity, have you tried the relevant JetBrains IDE(s)?

eclim is the best you're gunna do for Java in Emacs I think, and it's realllllllllly slow.

I never understood why running a full Eclipse as sub-process instead of just using Eclipse.

Re: Intero for Emacs: complete interactive development program for Haskell

#57
post #37
post #8

Earlier quoted context omitted.

Map command key to caps lock. Setting (global-set-key (kbd "M-P") 'scroll-down-line) (global-set-key (kbd "M-N") 'scroll-up-line) Has also been indispensable for scrolling (though you may choose to do so differently, coming from vim).

I forgot about that. Caps lock is useless 99% of the time and having that control available easily with your left pinky makes emacs (and everything else) work. I'm so confused when I get on other people's computers and caps lock is actually caps lock.

Since he is looking at spacemacs, I'd recommend mapping caps lock to escape when it's tapped, but ctrl when it's pressed in conjunction with other keys. Very useful,

(though I suffer from the same problem when on other peoples computers)

Re: Intero for Emacs: complete interactive development program for Haskell

#58
post #23

Earlier quoted context omitted.

I tried to use Spacemacs but in vim I have hjkl mapped to jkl;. I simply could not find a way to do this in Spacemacs. All the solutions suggested did not apply to every mode and there was always some mode where I had to revert to hjkl. Is there any solution for this problem?

I use spacemacs and want to play with the vim part more, but I type dvorak, so I wanted to do a similar remapping and remap hjkl to htns so I would also be curious to hear if anyone has a good way to do that.

There appears to be a keyboard layout layer on develop[0] with support for dvorak.

Personally, I started looking into this when I started, but just got used to how hjkl are on dvorak (I still need the ability to be able to pick up with any random vim/vi I find on any random box, and don't find the utility in trading that).

[0] https://github.com/syl20bnr/spacemacs/tree/develop/layers/%2...

Re: Intero for Emacs: complete interactive development program for Haskell

#59
post #33

Earlier quoted context omitted.

Are you sure that you launched the correct emacs? (`M-x version RET` in Emacs to check) This is an extremely common error for people using the built-in version which, as of El Capitan, is still Emacs 22.1 (almost 10 years old).

Ack, you're right! I installed it, added a symlink to the head of my path, but forgot to open a new terminal so continued using the old hashed path. Edit 10 minutes later : Ok, it's installed now. And I've set this up in my .zshrc: -alias vi=vim +alias vi=emacs Let's see how this goes.

If you want a little more terminal magic here are my emacs related shortcuts:

  alias et='TERM=xterm-256color emacsclient -t'
  alias ec='emacsclient -c -a=emacs'
  alias ed='emacs --daemon'
  alias kill-emacs='emacsclient -e "(kill-emacs)"'
  alias e='TERM=xterm-256color f -e "emacsclient -c -a=emacs"'
The reason for these is that emacs is a little slow to start up (in comparison to vim at least). So you can set up a daemon running ( ed command above, for emacs daemon. I don't have ed on my system)

You can then open up a new frame (window) of emacs with the ec command, or a new terminal session of emacs with the et command.

My favourite is the e command, which makes use of fasd[0] to find any "frecent" file, tries to open it with emacsclient, but, if emacs daemon is not running will fall back to opening a new emacs (which with spacemacs will start a new daemon running). This way I can open files in completely different directories if need be.

[0] https://github.com/clvv/fasd

Re: Intero for Emacs: complete interactive development program for Haskell

#60
It didn't "just work (TM)" for me, I had to customize the intero-package-version in my .emacs when using it with a project with the latest stack-nightly, to bump it up to "0.1.16".

But other than that, wow! I was already very happy whenever I could get ghc-mod and haskell-mode to work, but this takes the responsiveness to a whole different level.

Post reply on HN