yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.51k stars 201 forks source link

How to get yi-fuzzy-open working? #1064

Closed ghost closed 6 years ago

ghost commented 6 years ago

I did this:

example-configs/yi-all-static, edited the stack.yaml, added yi-rope to extra-deps , added yi-all-static to the subdirs and then did a stack build and stack install. But I still can't find the fuzzyOpen function in M-x.

Would that not be available as a function in M-x? Do I need to do a keymap in vim or emacs mode? If so how would I go about that?

resolver: lts-8.18
packages:
- '.'
- location: '../../'
  subdirs:
    - 'yi-core'
    - 'yi-frontend-vty'
    - 'yi-frontend-pango'
    - 'yi-fuzzy-open'
    - 'yi-language'
    - 'yi-keymap-vim'
    - 'yi-keymap-emacs'
    - 'yi-misc-modes'
    - 'yi-mode-haskell'
    - 'yi-mode-javascript'
extra-deps: [yi-rope-0.10]
ghost commented 6 years ago

I was able to use this example config and make it work.

noughtmare commented 6 years ago

@varmanishant To give you some more information, the things that M-x lists are defined here: https://github.com/yi-editor/yi/blob/bd91818cf33b78a92c9e669a5d7ca2282f503b31/yi-core/src/Yi/Config/Default.hs#L34-L74

If you want to add a command to the M-x menu you have to do something like this:

import Yi.Eval (publishedActions)
import qualified Data.HashMap.Strict as HM
import Yi.Config.Simple (defaultConfig)
import Yi.Keymap -- for the makeAction function
import Control.Lens

myConfig = defaultConfig & publishedActions %~ HM.insert "myAction" (makeAction myAction)
ghost commented 6 years ago

Thanks @noughtmare !