yi-editor / yi

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

Config file not loaded #973

Open vladfi1 opened 7 years ago

vladfi1 commented 7 years ago

I made some changes to ~/.config/yi/yi.hs (cua mode, vty frontend) but they don't seem to be loaded when I start yi. I've looked around a bit and it sounds like I need to "kickstart the dynamic recompilation" - how exactly do I do this?

noughtmare commented 7 years ago

Have you read this? With kickstarting I meant compiling a dynamic configuration manually.

vladfi1 commented 7 years ago

Yes. I wasn't able to get either of those to work, though it might be my lack of emacs/vim skill (I've never used either).

noughtmare commented 7 years ago

Do you know how to compile with stack? Are you using the latest version of Yi from github?

The static configurations are built to in such a way that you can just run stack install inside the folder and use the resulting binary as your text editor (so I think that's the easiest route). You should keep in mind, however, that this resulting binary is not automatically named yi and not automatically placed on your PATH. You can change the name in the package.yaml file under the line executables: (You have to recompile after you do that).

vladfi1 commented 7 years ago

I installed with cabal install yi, which gives me version 0.13.0.1. I think I got the emacs reload command right but the config still isn't being reloaded.

vladfi1 commented 7 years ago

Alternatively, is there a way to get cua from the command line? I tried yi -k cua but it didn't recognize the keymap.

noughtmare commented 7 years ago

Currently (In version 0.13.5) the cua keymap is disabled (i.e. not made available) by default because it is incomplete.

You should probably update your list of packages (with cabal update), because 0.13.5 is also the latest on hackage (I don't have much experience with cabal so this might be wrong).

I really recommend using the static configurations and stack (especially if you are new to Yi).

  1. clone the repo
  2. copy one of the static example configs (you need to copy the entire folder) to a directory you like
  3. change the paths inside the stack.yaml (this file is located in the folder you copied in step 2) file so that they point to the location where you cloned the repo in step 1 (e.g. /home/yourname/yi if you cloned it in you home directory)
  4. change the name of the executable in the package.yaml (also located in the folder you copied in step 2) file (this is optional)
  5. run stack install
  6. run yi (also optional 😉)
vladfi1 commented 7 years ago

I was using yi 1-2 years ago and there was no problem with cua.

noughtmare commented 7 years ago

Ah, I based my entire opinion on the state of lua off of #791. I guess you know more about cua than me.

vladfi1 commented 7 years ago

Ha! Sounds like I'm the only cua user in the past year. I was mostly fine without advanced features like indentation.

What I'm really looking for is a gedit-level (or better) editor, but in the terminal so I can easily use it over ssh and with git. Sometimes nano isn't quite good enough.

noughtmare commented 7 years ago

I guess you are not new to Yi... If you already have a working configuration file in ~/.config/yi you should just be able to run it with runhaskell and then it should compile the dynamic configuration (if you have installed all the yi libraries with cabal correctly).

The reason I wont recommend this is because it is really hard (for me at least) to tell if they installed the correct version of yi globally or in the current sandbox or with stack or in any other way such that ghc has access to it.

ghost commented 7 years ago

Should be able to add the cua config in https://github.com/yi-editor/yi/blob/8efbc775d999c2ff1f5920caba5c230f2e1424f2/yi/Main.hs#L43

I would assume it should be an easy task.