
Show HN: Emacs Anywhere - curryz
https://github.com/zachcurry/emacs-anywhere
======
JepZ
The editor war isn't over yet :D

[https://github.com/zachcurry/emacs-
anywhere](https://github.com/zachcurry/emacs-anywhere) (here)

vs.

[https://github.com/cknadler/vim-anywhere](https://github.com/cknadler/vim-
anywhere) \+
[https://news.ycombinator.com/item?id=16395379](https://news.ycombinator.com/item?id=16395379)

Nice to see them both still in use :-)

~~~
curryz
You’ve got that right! I built this as a knee-jerk reaction to vim-anywhere.
XD

~~~
josteink
How is this different from “it’s all text”?

~~~
FrenchyJiby
For one it seems to be system-wide rather than Firefox-specific (too bad It's
All text doesn't work after Quantum). Apparently relies on the clipboard
instead of filesystem

------
kaushiks
You can do this in Bash already (Ctrl x Ctrl e is bound to readline's edit-
and-execute-command, which will open $EDITOR with the current command), but
being able to do this everywhere is nice!

~~~
meken
Thank you! I tried to google how to do this some time ago with no success!

However it looks like it only works with emacs editing mode (set -o emacs). Is
there a way to do this in vim editing mode (set -o vi)?

Also it doesn't appear to work in zsh. Is there a zsh equivalent?

~~~
Arkanosis
For Zsh, add “bindkey '^x^e' edit-command-line” somewhere in your ~/.zshrc and
you have it.

------
amasad
Nice! I spent in inordinate amount of time recreating emacs key bindings in
MacOS using Karabiner -- everything from editing text to scrolling to
switching windows -- before the latest release of MacOS broke it. I found a
replacement but it's not as good.

~~~
textread
Please share the Karabiner replacement you are using

~~~
phaedrix
This is the Karabiner alternative for >10.12:
[https://github.com/tekezo/Karabiner-
Elements](https://github.com/tekezo/Karabiner-Elements)

------
roadbeats
Awesome. I have one suggestion though: the project description could be easier
to understand.

I wouldn't understand anything without the screenshot altho I use Emacs for 11
years. Imagine beginners reading it...

~~~
curryz
What should it read? I’m open to any suggestions.

~~~
rkangel
I found the description pretty good, but maybe an extra 'headline' might be
helpful:

What it does: Use emacs to input text in any program at any time

How it work: A keyboard shortcut of your choosing...

~~~
curryz
I like it!

------
wdr1
Sounds similar to Edit with Emacs

[https://chrome.google.com/webstore/detail/edit-with-
emacs/lj...](https://chrome.google.com/webstore/detail/edit-with-
emacs/ljobjlafonikaiipfkggjbhkghgicgoh?hl=en)

------
halayli
It would be nice if there's a plugin that launches vim/emacs with a tmp file
in the background, and replaces the textarea with a terminal like canvas that
connects to it. Upon exit, the content gets copied into the textarea.

------
psibi
This is amazing, I have always wanted something like this. Given that it
requires xdotool, I was wondering if it would work in a Wayland system (I
don't use Wayland yet, I'm just curious) ?

~~~
curryz
Good eye! I don’t think it does on account of xdotool. If you can suggest
something better than xdotool I’m open to using it. I only use two commands
from xdotool at the moment.

------
_sdegutis
Similarly I made an app the other day to allow custom key shortcuts on macOS.
The defaults use vim keys but I plan to eventually add key chords too.
[https://github.com/sdegutis/Vimac](https://github.com/sdegutis/Vimac)

------
paultopia
I'm typing this comment in Emacs! This is so exciting!

~~~
paultopia
It even works in Facebook! If it can handle the ten layers of browser UI
capture there, it can handle anything...

------
cmrdporcupine
Great idea. I will use this.

Minor nit, can you fix the grammar here: "inserted into the application your
using"

Should be "you're using" as in "you are using".

Thanks for this.

~~~
curryz
Thanks!

------
trisimix
Does anyone use emacs with colemak or dvorak.? The default key bindings seem
unintuitive with it.

~~~
kreetx
I use dvorak and I can agree that there are at least a few popular chords that
are inconvenient, like Cx Cf. But I've gotten used to this and haven't changed
any core key bindings.

And, of course, the upside is that on any random machine with emacs is 100%
compatible.

Oh, and one more tip :-): bind 'vim' to 'emacs -nw -Q' which loads emacs
really fast (without requiring the daemon to be running).

------
iLemming
I've done it recently using Hammerspoon, if anyone interested
[https://github.com/agzam/spacehammer](https://github.com/agzam/spacehammer)

------
e19293001
Could this be done in android too? I use emacs in android through termux and I
like it.

~~~
jdormit
How did you set that up?

~~~
e19293001
Just install termux from android. Then install emacs from terminal. It works
flawlessly.

------
spectrum1234
I'm getting 'No such file or directory' errors following these instructions.

I use spacemacs but I don't think this should cause any issues. I'm new to
both though.

~~~
spectrum1234
Got it. The macOS instructions were updated correctly in the readme I see.

I even wrote this comment in emacs!!

------
gitgud
I've read the README, Can someone please explain this to me?

It looks like this just opens an editor with a shortcut and pastes the text on
exit...

------
Blackthorn
Lovely idea. I used to use emacs with Firefox via plugin many years ago and I
still miss it. Hope one day you can figure out Windows!

------
cmbaget
only if it was vim... :P

------
uknownuser
jiojojo

------
KasianFranks
It's about time it caught up to vi on the 'being available anywhere' front.

------
noyaav
Vim is better

~~~
tmalsburg2
True, that's why Emacs has Vim emulation (evil mode).

~~~
Y_Y
Exactly, vim is better than emacs, and I've always known this. It wasnt until
recently that i found out emacs is a better vim than vim. Spacemacs really is
a masterpiece.

~~~
weaksauce
Indeed it is. Still early and getting better all the time but it's very usable
and much less broken than vim as it stands. With the spacemacs package cache
and version pinning it will become even better out of the box.

~~~
SeoxyS
NeoVim is the better (best) vim! Fixes a lot of the problems with vim while
still staying true to its spirit.

~~~
weaksauce
Yeah, neovim is a great project but still lacks imo compared to emacs. maybe
when the ecosystem and plugins get more stabilized will it be a really
compelling option for me to switch. once you get past some of the emacs
oddities it's pretty much a better vim. The thing about neovim is that bram
added the feature that neovim was initially forked off because of and he made
vim's version incompatible with neovim's async. being able to have transient
buffers in emacs is a very powerful feature that is used all over the place
(magit is one that does this very effectively). I am not sure neovim has all
the necessary fundamental building blocks to compete and allow these extremely
rich plugins like orgmode, magit, helm, swoop, evil, etc. I could be wrong on
that but the plugins on the emacs side are much more robust which leads me to
believe that emacs is better at customization. only having lua as a baked in
language is limiting just like only having viml as the builtin language for
vim was limiting as to what could be done easily... most plugins will simply
not use any other language for compatibility and ease of install even though
it's possible to use ruby/python/etc. In addition the concepts of major(vim
filetypes) and minor modes(editor enhancements) is pretty great too.

don't get me wrong, all that said, I couldn't and wouldn't use emacs if it
didn't have a rich vim emulator.

------
usr1106
Nice idea. But AFAIK it cannot work with most "modern" web sites, because they
are increasingly using some Javascript nonsense instead of a textarea.
(Disclaimer: have not tried this, but some "everything is text" extension
years ago)

~~~
curryz
This tool does not rely upon the application you use it with. You can use it
anywhere with any application which allows you to paste text.

~~~
usr1106
> You can use it anywhere with any application which allows you to paste text.

Thanks for this clarification. (Even pasting becomes increasingly impossible.
For e.g. Google does not allow me anymore to paste my username at login, and
my (work) username is very long... I suppose pasting might offer an easier way
scripted attacks. But yeah, most applications still allow it.)

~~~
simias
Where does google prevent that? I tried on the web login page and I can paste
without problem. I'm not sure why they'd prevent you from pasting your login
in the first place.

In general there's always a simple way to bypass these websites limitations,
like those who try to disable the right click.

~~~
dmichulke
Maybe it's a "security feature" of some AV software or IE/edge. Wouldn't
surprise me.

~~~
usr1106
I use Firefox on Linux.

~~~
dmichulke
I didn't mean to insult you :)

Since you talked about your "(work) username" I thought your employer chose
your OS/browser for this particular case.

~~~
usr1106
I didn't take it as an insult :)

While my employer does not chose my OS/browser I am in the lucky situation
that most of us use Linux with their favorite distro.

------
cairo_x
Reminds me of a hipster riding a Penny-farthing.

~~~
Lio
I’m a Vi user rather than emacs but I can perfectly understand wanting to have
the same keyboard interface across platforms.

Could you explain what’s bad about that or why you think classic keyboard
interfaces are a fad? (I’ve been using Vi interfaces in one form or another
since 1989).

~~~
cairo_x
In other words, you're not a hipster... just some old dude who likes being
offended by shit.

