10 ms·
Show HN: Emacs Anywhere
- usr1106 9y agoNice 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 9y agoThis 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 9y ago> 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 9y agoWhere 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 9y agoMaybe it's a "security feature" of some AV software or IE/edge. Wouldn't surprise me.
- usr1106 9y agoI use Firefox on Linux.
- dmichulke 9y agoI 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 9y agoI 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.
- usr1106 9y agogmail.com (would not be surprised if the pages are browser and country specific, at least google.com is) I use Firefox.
- amasad 9y agoNice! 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 9y agoPlease share the Karabiner replacement you are using
- saagarjha 9y agoHave you tried hooking it up to Hammerspoon? I’ve found that there’s a whole lot you can emulate from Karabiner in Karabiner-Elements using a combination of those two.
- amasad 9y agoI'll check it out, thanks.
- e40 9y agoI switched to Karabiner Elements. The json config is nice.
- amasad 9y agoLast time I checked (maybe 6-9 months ago) it was missing a lot. Did they make progress in reaching parity?
- roadbeats 9y agoAwesome. 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 9y agoWhat should it read? I’m open to any suggestions.
- rkangel 9y agoI 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 9y agoI like it!
- Kwpolska 9y agoPrefer to use Emacs to edit text? Now you can use it anywhere. Press a keyboard shortcut of your choice, and a new Emacs frame (window) will be opened. After you’re done, just save and the text will be inserted in the original input box. (*disclaimer: written by an avid vim user, and not a native English speaker. May need rephrasing to be better Emacsese or English.)
- cairo_x 9y agoReminds me of a hipster riding a Penny-farthing.
- Lio 9y agoI’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 9y agoIn other words, you're not a hipster... just some old dude who likes being offended by shit.
- psibi 9y agoThis 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 9y agoGood 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.
- uknownuser 9y agojiojojo
- JepZ 9y agoThe 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 9y agoYou’ve got that right! I built this as a knee-jerk reaction to vim-anywhere. XD
- josteink 9y agoHow is this different from “it’s all text”?
- FrenchyJiby 9y agoFor 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
- bb88 9y agoI respect your honesty here. ;)
- nabla9 9y ago"Why do we have to hide from the police, Daddy?" "Because we use vi, son. They use emacs."
- deleted 9y ago[deleted]
- WrtCdEvrydy 9y agoOkay, next weekend... let's do nano-everywhere!
- kaushiks 9y agoYou 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!
- arximboldi 9y agoWhat?! That's amazing! You never stop learning bash I guess :)
- tyingq 9y agoSimilar...look into rlwrap[1] It attempts to launch an external program with your $EDITOR (vi or emacs) preferred key bindings. [1] https://linux.die.net/man/1/rlwrap https://linux.die.net/man/1/rlwrap
- meken 9y agoThank 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 9y agoFor those of us who use Zsh, the equivalent is “Alt-x edit-command-line”, which can easily be bound to “Ctrl x, Ctrl e” by adding “bindkey '^x^e' edit-commandline” in ~/.zshrc.
- 9y ago
- cmrdporcupine 9y agoGreat 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 9y agoThanks!
- trisimix 9y agoDoes anyone use emacs with colemak or dvorak.? The default key bindings seem unintuitive with it.
- Jtsummers 9y agoI do. I actually found the defaults to be more comfortable with Dvorak. Which chords feel unintuitive to you?
- ealhad 9y agoHappy Colemak user here. I have been using Colemak for two years, and Emacs for a little more than one year. However I use Spacemacs with Vim keybindings :D
- cityroasted 9y agoI use emacs with colemak. I find it more ergonomic than emacs with qwerty. Is there anything specific you find cumbersome?
- funkaster 9y agoI use emacs with programmer dvorak[0]. I use the default key bindings and it didn't get me too long to adjust. I tried changing the bindings to new locations but they're so many and in the end they're just arbitrary. I've been using that same setup for almost 4 years now and I don't have any intention of changing it :) [0]: http://www.kaufmann.no/roland/dvorak/ http://www.kaufmann.no/roland/dvorak/
- rekado 9y agoI do. Since C-x is very common I swapped T with X. Here's the snippet from my init: ;; Swap C-t and C-x, so it's easier to type on Dvorak layout ;; `keyboard-translate` does not work when attaching an emacsclient to ;; a running emacs in daemon mode, so instead we define the key in the ;; key-translation-map. ;; http://lists.gnu.org/archive/html/help-gnu-emacs/2009-10/msg00505.html (define-key key-translation-map [?\C-x] [?\C-t]) (define-key key-translation-map [?\C-t] [?\C-x]) With this modification I find Emacs with Dvorak very comfortable.
- 9y ago
- KasianFranks 9y agoIt's about time it caught up to vi on the 'being available anywhere' front.
- noyaav 9y agoVim is better
- tmalsburg2 9y agoTrue, that's why Emacs has Vim emulation (evil mode).
- Y_Y 9y agoExactly, 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 9y agoIndeed 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 9y agoNeoVim is the better (best) vim! Fixes a lot of the problems with vim while still staying true to its spirit.
- weaksauce 9y agoYeah, 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.
- e19293001 9y agoCould this be done in android too? I use emacs in android through termux and I like it.
- wdr1 9y agoSounds similar to Edit with Emacs https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjlafonikaiipfkggjbhkghgicgoh?hl=en https://chrome.google.com/webstore/detail/edit-with-emacs/lj...
- halayli 9y agoIt 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.
- Blackthorn 9y agoLovely 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!
- _sdegutis 9y agoSimilarly 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
- spectrum1234 9y agoI'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.
- paultopia 9y agoFWIW, I can confirm it works in spacemacs (after killing and restarting the emacs server).
- spectrum1234 9y agoGot it. The macOS instructions were updated correctly in the readme I see. I even wrote this comment in emacs!!
- paultopia 9y agoI'm typing this comment in Emacs! This is so exciting!
- gitgud 9y agoI'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...
- cmbaget 9y agoonly if it was vim... :P
- iLemming 9y agoI've done it recently using Hammerspoon, if anyone interested https://github.com/agzam/spacehammer https://github.com/agzam/spacehammer