FelixKratz / SketchyVim

Adds all vim moves and modes to macOS text fields
GNU General Public License v3.0
692 stars 9 forks source link

Works in Notes app but not Mail app #1

Open sdondley opened 2 years ago

sdondley commented 2 years ago

Any trick to get it working with Mail?

FelixKratz commented 2 years ago

Interestingly apple does not implement the required accessibility features for their mail compose window because it is a HTML content editable field, even when selecting plain text as a format. I believe this is an oversight on their part, as I can happily use svim in my webmail plain text client.

bestdax commented 1 year ago

It's so bad that there is no access to Mail compose window. I do most my writing in Mail:(

FelixKratz commented 1 year ago

Thats why I have moved to Mailspring. In mailspring the "rich text and advanced editor features" can be switched off, this will give a monospaced plain text view for mail composing. Since mailspring is an electron app, svim needs to be compiled with -DMANUAL_AX to work with this app.

bestdax commented 1 year ago

Hi, FelixKratz

Many thanks for the info about Mailspring. I would like to try it.

I don't know so much about programming, so I didn't figure out how to do it. Here is what I tried.

  1. git clone svim repository to my mac;
  2. uncommented -DMANUAL_AX in the makefile
  3. make
  4. Since svim is already installed with brew, I copied the svim binary to where brew placed it
  5. brew services restart svim

the above didn't work. and the compiled binary size is only half of brew installed binary.

Would you please help me out?

FelixKratz commented 1 year ago

Hi, FelixKratz

Many thanks for the info about Mailspring. I would like to try it.

I don't know so much about programming, so I didn't figure out how to do it. Here is what I tried.

  1. git clone svim repository to my mac;
  2. uncommented -DMANUAL_AX in the makefile
  3. make
  4. Since svim is already installed with brew, I copied the svim binary to where brew placed it
  5. brew services restart svim

the above didn't work. and the compiled binary size is only half of brew installed binary.

Would you please help me out?

You steps are perfectly fine, except one critical detail that revolves around code signature and the macOS gatekeeper:

You can create the full bundle I use for the releases by running:

make bundle

it properly signs the binary for gatekeeper if you have a certificate called 'svim-cert' here: https://github.com/FelixKratz/SketchyVim/blob/010426a7b924a280257080e70afe6a6855037c20/makefile#L39-L41

If you don't want to bother with creating this certificate you can simply swap out the signature command with an ad-hoc certificate:

codesign --force -s - $(ODIR)/svim

If you now run make bundle it should create a bundle_$(VERSION).tgz file in the folder where the full binary with proper code signature can be found. If you swap this with the homebrew binary it should work fine. You might need to focus Mailspring twice initially such that it sets the manual ax flag and then is recognized as supported.

Alternatively it should also be enough to run:

make
codesign --force -s - bin/svim

this binary only contains one instruction set, i.e. x86 or arm64 depending on the system you compile it on, thats why it is half the size of the release binary, which contains both.

bestdax commented 1 year ago

Many thanks for your very detailed instructions and explanation.

But after more than years working with Mail, I am afraid the pain of changing.

BTW, svim doesn't support multi-key mapping. So we can't map jk to escape insert mode. There is a workaround by using Karabinar.

https://user-images.githubusercontent.com/22925996/208226662-48eec2a1-0ebb-412f-89ac-60839763bb3e.mov