News for hackers. Stuff that matters.
Re:The Emacs Widget Library by milkytron on Thursday July 26, 2018 @08:09PM (#17622460)
After using vim for years and becoming what I would consider proficient in it, is there any reason to try out emacs? I've been wondering if I could be more productive in it after the learning curve, or if I should spend that time further solidifying and slightly improving my vim skills. Has anyone here used both and have any thoughts on this?
Re:The Emacs Widget Library by nextos on Thursday July 26, 2018 @08:22PM (#17622525)
Emacs is not just an editor, it's a text-mode Lisp machine.

If you like this idea, it does make sense to try it. Some people love Evil, a Vim emulation layer on top of Emacs.

I do all my computing using just StumpWM, Emacs, Firefox and xterm. I'm much happier than with my previous setup. Curses-based CLI applications don't compose well. They are little silos.

In contrast, on Emacs everything is hackable and alive. There's a wealth of classic packages (calc, dired, gnus, ansi-term, ess, auctex...) and modern ones (org-mode, magit, notmuch, pdf-tools, projectile, ivy, company...) that can let you craft a great environment.

Even if you are not a fan of huge customizations, I'm not either, small tweaks that adapt everything to your preferred workflow really do increase productivity. For example, my agenda view on org-mode emulates a kanban board.

I prefer to do as much of my computing as possible on a text-mode Lisp machine for this reason. Everything is friendly and customizable alive. I do web stuff on a regular browser inside a container: Firefox + Tridactyl. And plumbing is left to Unix, either NixOS or a simple Linux (Arch or Slackware) on xterm.

I find that trying to move stuff that naturally falls into one of these platforms (Emacs, Web, Unix) into another one makes me unhappy. For example, trying to browse the web on Emacs or composing emails on a web browser.

Re:The Emacs Widget Library by ams6110 on Thursday July 26, 2018 @10:22PM (#17623010)
> I do all my computing using just StumpWM, Emacs, Firefox and xterm

Same, though I use Awesome for my window manager.

Re:The Emacs Widget Library by pjmlp on Friday July 27, 2018 @05:02AM (#17624560)
If only it was an actual graphical-mode Lisp machine.

XEmacs did better there, but it seems to have faded away.

Re:The Emacs Widget Library by good4parts on Friday July 27, 2018 @09:38AM (#17625842)
What type of container do you use for your browser?
Re:The Emacs Widget Library by nextos on Friday July 27, 2018 @11:01AM (#17626438)
Just firejail (despite the name it has no association to Firefox):

https://firejail.wordpress.com/

https://wiki.archlinux.org/index.php/Firejail

It's super easy to use.

Re:The Emacs Widget Library by tashlandiq1 on Thursday July 26, 2018 @08:31PM (#17622561)
I also used Vim for about 5 years. I have been using Emacs for about two years now. Emacs, hands down, is the better editor, and not only that. When I first decided to learn one of them, Vim seemed cool because modal editing was something new to me. I'm glad I learned it, but I wish I had switched to Emacs earlier. Emacs offers so much than Vim plus many other programs combined. Emacs users often mention org-mode, but to me Gnus is the best non-programming related Emacs package. Life's short. In addition to learning an editor, I don't want to learn an email client UI (all of the ones I used (Thunderbird, Gmail website, Evolution, Geary, Kmail, etc.) suck compared to Gnus), an IRC UI, or any other software that I may want to use in the future. With Emacs, once I grasped the basics, learning ERC (an IRC client), org-mode, Gnus, Projectile, etc. was not that hard. For example, using org-mode I can create flashcards and export them to Anki (it' so much faster and less frustrating than the Anki editor). Emacs is also well documented. Moreover, Elisp introduced me to the Lisp family of languages. I'm amazed how the Common Lisp development environment with Slime and Quicklisp is so much better than anything else out there. People think Python notebooks are great for easy prototyping. I say they should try Slime first. yada yada yada (You should try Emacs yourself and see if you like it.) yada yada yada.
Re:The Emacs Widget Library by pjmlp on Friday July 27, 2018 @05:05AM (#17624569)
> I'm amazed how the Common Lisp development environment with Slime and Quicklisp is so much better than anything else out there.

Now imagine the commercial ones.

https://franz.com/products/allegro-common-lisp/acl_ide.lhtml

http://basalgangster.macgui.com/RetroMacComputing/The_Long_V...

Re:The Emacs Widget Library by WalterGR on Friday July 27, 2018 @02:47PM (#17628201)
Why Franz and not LispWorks?

20 minutes into a Franz video about single-step debugging and they still hadn’t set it up yet. Maybe that was impressive 30 years ago?

Re:The Emacs Widget Library by nextos on Thursday July 26, 2018 @08:37PM (#17622578)
Have you tried Notmuch. I like Gnus, but I find Notmuch's architecture really neat. Besides, it's super fast.

Have you considered org-drill instead of exporting to Anki? Or you run Anki on a phone?

The only thing I miss on Emacs is a good OMEMO XMPP or Signal implementation. Currently Bitlbee lacks both.

Re:The Emacs Widget Library by tashlandiq1 on Thursday July 26, 2018 @08:53PM (#17622652)
I tried mu4e before Gnus. Haven't tried Notmuch. I like reading hackernews and some mailing lists on Gnus without cluttering my inbox. Not sure if Notmuch can handle that.

Yes, I use Anki on my phone too.

I haven't thought about using Emacs as an IM, but I use w3m for browsing, which is great given all JS/CSS crap we get from websites these days. I just want text and can easily search for it within w3m.

Re:The Emacs Widget Library by clircle on Thursday July 26, 2018 @09:12PM (#17622729)
How well does Evil mode work with Gnus? I used mu4e for a while but eventually just went back to thunderbird.
Re:The Emacs Widget Library by tashlandiq1 on Thursday July 26, 2018 @09:31PM (#17622807)
I don't know. I've never used Evil. I felt like I should actively forget Vim in order to get the most out of Emacs. Vim emulation maybe good for editing for some people, but Emacs is much more than an editor. People bring up the Emacs pinky problem, and I agree it's a problem. But the solution for me was easy: mapped the left alt to ctrl, and kept using the right alt as alt.
Re:The Emacs Widget Library by natrys on Thursday July 26, 2018 @11:16PM (#17623198)
Mine is nearly the same. I use xcape to make space behave as ctrl when pressed in conjunction with other keys, but just space otherwise. Much more convenient use of the left thumb. But yes, in practice there is some getting used to it if you are a fast typer, because xcape uses a tiny time threshold to distinguish between the intent behind these two (and that normal space occurs at key release, not key press).
Re:The Emacs Widget Library by clircle on Friday July 27, 2018 @12:41PM (#17627235)
Interesting, I alt as control on Windows and Linux. I wonder if there is a way to map Space to Control when tapped on Windows.
Re:The Emacs Widget Library by natrys on Friday July 27, 2018 @04:10PM (#17628917)
Map as in the equivalent of the xcape solution? You can do these things using AutoHotKey. I use this:

https://github.com/benhansenslc/BigCtrl

Re:The Emacs Widget Library by zcid on Thursday July 26, 2018 @09:26PM (#17622783)
I have used vim/tmux/screen for almost 20 years, and while I only use a subset of the functionality, I am extremely at home in that workflow. I recently switched over to Emacs because I started spending a lot of time in Scheme.

I set it up over a couple of days to almost entirely emulate my vim setup: leader key, 'jk'->ESC, evil binding everywhere, you name it. At this point, my config file is only 165 lines, yet it provides all the editing comforts to which I'm accustomed. The only thing I haven't figured out yet is how to map my enter key to ':' in normal mode.

I still use vim out of habit when I'm in the terminal, but the transition is so smooth I don't even notice which one I'm using. It's difficult to say if it's worth the effort to switch unless you are looking at a specific use case with which vim struggles. I am in love with the ease of CL/Scheme editing in Emacs, but without that itch, I probably wouldn't have switched. I've had many people try to convert me in the past, but they couldn't provide the why.

Re:The Emacs Widget Library by jaytaylor on Thursday July 26, 2018 @10:42PM (#17623082)
Can you share this config you speak of? Would like to give it a whirl!
Re:The Emacs Widget Library by zcid on Friday July 27, 2018 @07:28AM (#17625150)
Sure. https://pastebin.com/R7zmfhp0

I don't use a lot of plugins in vim so it's relatively trim. The only thing I'm planning on adding at this point is https://github.com/emacs-evil/evil-surround. Ivy probably requires some tweaking to get the behavior right, and I'm not super familiar with it yet.

Re:The Emacs Widget Library by wraithm112 on Thursday July 26, 2018 @11:12PM (#17623183)
I too have vim muscle memory in the terminal, so what I do is alias vim to emacsclient. It's actually really great! Terminal emacsclient with evil is basically indistinguishable from terminal vim.
Re:The Emacs Widget Library by 87 on Thursday July 26, 2018 @08:28PM (#17622545)
I think you shouldn't concern yourself too much with the editor. Negative productivity gains are a possibility too. Emacs can be the ultimate productivity trap if you love customizing stuff. Using Emacs often feels like working on a buggy, never-ending project.
Re:The Emacs Widget Library by SmirkingRevenge on Friday July 27, 2018 @12:01AM (#17623344)
I've been down this road and negative gains are likely. I like tinkering with these things and find it fun, so that's fine with me. But efficiency/productivity we're secondary to exploration.

Unless you have it your heart to become an absolute elisp guru, emacs won't really offer you anything more than vim or any other editor, except plugins that are harder to integrate and configure.

Re:The Emacs Widget Library by kqr on Friday July 27, 2018 @02:54AM (#17623995)
Interesting perspective. I know the thought has sometimes struck me how much time I put on extending my Emacs... but as of late, I have also been shocked by how much time it has saved me. I can now do rather complicated sequences of actions with the press of a key or two. This would not have been as easy to implement without Emacs!
Re:The Emacs Widget Library by abhiyerra on Thursday July 26, 2018 @08:56PM (#17622667)
I've used Emacs for about 8 years now and before that I used vim. I think Emacs in Evil mode is the best. Emacs default keybindings were giving me the Emacs pinky.

Then again nowadays I am trying to be pragmatic with editors and more get things done. It is easy to go into endless customization in Emacs where you don't actually solve any real problems. (i.e I once used elnode https://github.com/nicferrier/elnode to build and host a website... great little project that took way too much time better used elsewhere.)

Nowadays I basically do VSCode for many things and jump onto Emacs if VSCode can't do it. Still using vim bindings though.

Re:The Emacs Widget Library by orbital-decay on Thursday July 26, 2018 @09:47PM (#17622868)
A classic trick to avoid Emacs pinky is swapping Caps Lock and Ctrl. I'm using it everywhere though; swapcaps makes it much more comfortable to use the Ctrl key on a standard PC keyboard.
Re:The Emacs Widget Library by 0xcde4c3db on Thursday July 26, 2018 @10:44PM (#17623088)
Another approach is to hit Control in its default corner location with the bone below the pinky (fifth metacarpal) instead of the pinky itself. It's definitely a little awkward at first, but works better than you might expect after a little bit of practice. Probably not very viable for most laptop keyboards, though.

Truly hardcore modifier wizards (or people recovering from injury) have been known to use pedals.

Re:The Emacs Widget Library by agumonkey on Friday July 27, 2018 @01:06AM (#17623577)
I hit Control with the last finger joint before the nail, pinky curled. I don't know how it happened but that's how it is now.
Re:The Emacs Widget Library by Pimpus on Thursday July 26, 2018 @10:28PM (#17623031)
With the placement of the Control key on most keyboards, your pinkie is doing a straight downwards motion which is much less straining than going sideways, even if it is a bit of a long stretch. Most keyboards (maybe not on laptops though) also have two Control keys so the load is distributed over two pinkies instead of one and neither hand makes any crazy stretches. Personally, I think Caps Lock as Control is categorically terrible advice. I'm sure your intentions were good, but I wouldn't be surprised if this classic trick wasn't originally some vile Vim scheme designed to undermine Emacs users.

Ideal would be to use a keyboard and OS (MacBooks have both) where you can map Control to the keys immediately next to the spacebar. Using the strongest finger (thumb) instead of the weakest finger and the strongest movement (thumb curl) rather than the weakest is a true upgrade.

Re:The Emacs Widget Library by kaens on Thursday July 26, 2018 @11:21PM (#17623219)
> With the placement of the Control key on most keyboards, your pinkie is doing a straight downwards motion

On every keyboard I have in my apartment, and every keyboard I've used for a long time, moving my left pinky straight down with my hands on the home row hits left shift and the windows key, in that order. Hitting caps lock with my left pinky is barely a movement at all.

Re:The Emacs Widget Library by megaman22 on Thursday July 26, 2018 @10:35PM (#17623059)
Caps-lock is an abomination. I used to try remapping it to something useful, or disabling it in software with autohotkey or the like, but that was not sufficiently foolproof, so I've given up and just rip the keycap off my keyboards. Looks a little trashy, but it works fantastic.
Re:The Emacs Widget Library by hyperion2010 on Thursday July 26, 2018 @09:24PM (#17622778)
I've been on vim for 8+ years. About 2 years ago I set up emacs because I wanted to start working in lisp land and use org mode. I couldn't use emacs without vim keybinds so I installed evil. I still use both editors, but I find emacs much easier to customize and the 'operating system' part of emacs makes it much easier to manage all the things I need to do. It sucks for big files, and there are some annoying quirks where repeating actions don't quite match vim's behavior, otherwise, I can hardly tell the difference, and when I do it is much easier to adjust to fit my needs. If you have your workflows set, then as with anything, there isn't much reason to switch, but emacs opens up a whole new world of possibilities in other ways.
Re:The Emacs Widget Library by applecrazy on Thursday July 26, 2018 @08:12PM (#17622476)
I've been using spacemacs for a bit now, mainly because of org-mode. Most of the keybindings from Vim transfer to spacemacs, so it hasn't been very hard to learn, so for you I think it would be a nice middle ground, if you don't want to immediately go full Emacs.
Re:The Emacs Widget Library by platz on Thursday July 26, 2018 @08:39PM (#17622586)
Spacemacs unfortunately suffers from slow startup speed and an unnecessary "layers" abstraction.

I could never use Emacs without vim keybindings, but I don't need to install Spacemacs to get that. It's as easy as

    package-install evil
    package-install evil-commentary
    package-install evil-leader
    package-install evil-org
    package-install evil-surround
Re:The Emacs Widget Library by akashakya on Friday July 27, 2018 @10:57AM (#17626399)
Have you tried doom-emacs? https://github.com/hlissner/doom-emacs

It has an insane startup speed! I tried once and it opened within a second. I'm not an evil user myself, so don't know about the vim compatibility.

If you are interested in making the startup faster, check https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms... from the same author

Re:The Emacs Widget Library by PurpleRamen on Friday July 27, 2018 @06:15AM (#17624849)
Layers are not an abstraction, it's an organization-system for the configuration. Anyone who has more then a handful lines of configurations develops some system to avoid the infamous .emacs bankruptcy. And Spacemacs comes with dozen packages pre-configured, while offering the option to allow the user to choose from hundred more package-configurations.

Similar slow startup. Majority impact on spacemacs startup is the regular search for package updates. Without it the startup-time is relative tame, though there is of course some place for improvment if you aim for <1 sec-startups.

Re:The Emacs Widget Library by celeritascelery on Thursday July 26, 2018 @09:23PM (#17622774)
Your missing he part where you have to configure all those packages. Having new features already setup and integrated for me is a huge plus. It takes a lot of work to mimic something as well done as Spacemacs.
Re:The Emacs Widget Library by platz on Thursday July 26, 2018 @09:58PM (#17622921)
here's the total configuration required:

    (require 'evil)    
    (require 'evil-matchit)
    (require 'evil-surround)

    (evil-mode 1) 
    (global-evil-matchit-mode 1)
    (global-evil-surround-mode 1)
    (evil-commentary-mode)
judge for yourself whether this is too much work to paste into your .emacs
Re:The Emacs Widget Library by SmirkingRevenge on Friday July 27, 2018 @12:13AM (#17623388)
Spacemacs does a lot more than provide vim key bindings and modal editing.

The biggie to me is discoverability, with it's pneumonic key combos, and integrating with packages like helm.

Even with evil, the vim semantics are often violated in special buffers, making for a rather disjointed experience. Spacemacs also does a lot to smooth out a lot of those problems.

Re:The Emacs Widget Library by anotheryou on Friday July 27, 2018 @03:55AM (#17624274)
i switched for org mode. spacemacs keeps the vim keys and offers great discover of commands. initially learning to navigate files and buffers is awkward though
Re:The Emacs Widget Library by cup-of-tea on Friday July 27, 2018 @03:16AM (#17624076)
Definitely yes. Use evil if you have to. Then check out org-mode and magit and you'll never go back.
Re:The Emacs Widget Library by platz on Friday July 27, 2018 @09:43AM (#17625874)
The only thing lacking in magit is the graph log renderer, which is just ASCII and can't deal with complicated graphs well
Re:The Emacs Widget Library by cup-of-tea on Friday July 27, 2018 @12:08PM (#17626982)
I wrote a graph renderer in emacs lisp a few years ago [0]. It never got included in magit because my code wasn't very good. I'm not sure it would have been better for complicated graphs than the standard git log one, though. Do you have an example of a complicated graph and how a better renderer deals with it?

[0] https://github.com/magit/magit/issues/495#issuecomment-17480...

Re:The Emacs Widget Library by platz on Friday July 27, 2018 @12:21PM (#17627082)
well, gitk is really my high-bar standard. Of course it't not ascii, but in terms of the end-user-goal of clarity, it's the best. as for ascii renderers, tig doesn't do too badly.

your project looks very nice though, certainly an improvement over the default in magit.

Re:The Emacs Widget Library by cup-of-tea on Friday July 27, 2018 @01:00PM (#17627361)
Oh, I see, tig puts merges on one line. I used two for some reason. I think I was copying git graph too closely and missed that opportunity. It would be rather easy to modify my elisp version to be like tig.

When I was testing mine the worst case repository for me was git.git. It's essentially useless to view the graph in any ASCII viewer. It actually breaks tig right now on my box. gitk does much better because it breaks some of the long branches rather than piling them all up until it no longer fits on the screen.

Re:The Emacs Widget Library by platz on Friday July 27, 2018 @01:19PM (#17627519)
Idk, Maybe your version is better than than tig, I was just comparing tig to 'git log'