News for hackers. Stuff that matters.
Re:Modern terminal-based text editor by julian37 on Thursday September 28, 2017 @08:08PM (#15361801)
It's 10MB uncompressed so at that point I'd hope Emacs would have finally become a "reliably available option" first (13MB on my system).

EDIT: why the downvote? Not trolling, just genuinely sad that with today's hard drive sizes it's not a given that Emacs is available virtually everywhere, like vi or nano are.

Re:Modern terminal-based text editor by sspiff on Friday September 29, 2017 @03:23AM (#15363414)
While emacs is a terrific editor (or platform for editors), it is not easy to use. It has a unique set of keyboard shortcuts, which means that for most newcomers, their familiar hotkeys or key combos will do things that they don't expect.

A modern, straightforward CLI editor would help many people.

Re:Modern terminal-based text editor by cup-of-tea on Friday September 29, 2017 @05:16AM (#15363828)
Actually its default keys are available in lots of other places. Most notably anything that uses readline (like bash), but I've even found the keys work in unexpected places like the MATLAB editor. Plus the letter keys and arrow keys already do what you expect. What "expected behaviour" are you referring to?
Re:Modern terminal-based text editor by sspiff on Friday September 29, 2017 @06:03AM (#15364001)
Granted, but bash and other readline applications generally have a very different mode of operation compared to a text editor. They operate on single lines of input at a time (most of the time). Editors like emacs operate on a multi-line body of text, and most people expect those to work like the other text fields in their environment (Ctrl-C/X/V for copy/cut/past, Ctrl-A for select all, shift-home/end/arrows to select text etc.)

I know you can activate those keybinding in Emacs, but then none of the documentation you find about keyboard shortcuts will apply to you.

The fact that many places support emacs keybindings (like MATLAB or IntelliJ) are an indication of how many programmers are used to those keybindings, but beginning or aspiring users most certainly are not.

Don't get me wrong. I love Emacs. I use Emacs everywhere, and for everything. But I know that the default behaviour and keybindings were a hurdle to overcome when I first got to know Emacs, and it took me time and effort to get comfortable within the editor.

Re:Modern terminal-based text editor by vetinari on Friday September 29, 2017 @09:27AM (#15365020)
Cocoa widgets for text entry in macOS support Emacs keybindings by default. Yes, TextEdit too. You cannot get nearer to beginning users than that.

But yes, it takes a time to get used to. But that's matter of familiarity.

Re:Modern terminal-based text editor by sspiff on Friday September 29, 2017 @10:02AM (#15365321)
But only Emacs users use those keybindings with those widgets, so that's not a good argument to say "emacs keybindings are well known by novice users".
Re:Modern terminal-based text editor by cben on Sunday October 01, 2017 @05:16AM (#15377009)
Emacs cua-mode is not bad. It does create some confusion with C-x shortcuts, eg. C-x C-s when typed too slowly will cut selected text and enter search, instead of saving :-( But I'd love a more total conversion to CUA... E.g. I have C-o to open files, and C-w to close buffer/window.

https://gist.github.com/cben/ada7675ab9aa14000a1a50eae398611...

-- emacs user for >15yr, tired of motor context switching. (Terminal Ctrl+Shift+X/C/V vs it opening devtools in Chrome is bad enough...)

Re:Modern terminal-based text editor by dgsb on Friday September 29, 2017 @01:10PM (#15367079)
On my computers anything that uses readline behaves like vi.
Re:Modern terminal-based text editor by bostand on Friday September 29, 2017 @03:32AM (#15363444)
Emacs has a GUI with icons and menus and tooltips and all that.

Isn't that what a true beginner would use anyway instead of the terminal version?

Re:Modern terminal-based text editor by coldtea on Friday September 29, 2017 @04:04AM (#15363547)
>Emacs has a GUI with icons and menus and tooltips and all that.

Which is still nearly useless without knowing of lots of Emacs arcana.

Re:Modern terminal-based text editor by lloeki on Friday September 29, 2017 @03:51AM (#15363496)
We're talking terminal (not GUI) editors here. If I fire emacs on macOS there's no menu displayed by default. If I connect remotely on a Debian machine, the menu is there but mouse reporting is not working. The help, if started by itself, vanishes at the first keypress (on macOS), which makes it really easy to skip the C-x C-c part, and uses the emacs-only convention of C- instead of the well known ^ for control (although it's explained right there), thus doubly easy to miss. I can see how newcomers would be turned away from it.
Re:Modern terminal-based text editor by AsyncAwait on Friday September 29, 2017 @06:07AM (#15364021)
vi(m) is usually included by default and is no easier to use for a beginner, so why not emacs?
Re:Modern terminal-based text editor by lloeki on Friday September 29, 2017 @08:36AM (#15364669)
`apt-get install emacs-nox` pulls in 83MB on jessie. The installed-by-default one is vim-tiny (clocking in at 27MB), not vim-nox (which pulls in an additional 21MB), for which there is no similar emacs package. Turns out nano is ~370kB, that makes for a small non-modal beginner editor, the modal one being covered by vim-tiny.
Re:Modern terminal-based text editor by AsyncAwait on Friday September 29, 2017 @09:46AM (#15365179)
Fair, but I don't think 20MB vs 80MB should be a problem in 2017, people are downloading ~60GB games off Steam, downloading a ~5GB ISO every 6-24 months is not that much in comparison.
Re:Modern terminal-based text editor by type0 on Sunday October 01, 2017 @06:52AM (#15377251)
For some people on the move data transfers are expensive, even if 80MB isn't much that adds up very fast.
Re:Modern terminal-based text editor by cryptonector on Friday September 29, 2017 @10:47AM (#15365737)
Because modal editing is where it's at!
Re:Modern terminal-based text editor by kire456 on Friday September 29, 2017 @05:15AM (#15363825)
I was once a "true beginner", having been forced to use basic terminal commands in school and having decided to get a raspberry pi and shove Raspbian on it for laughs. There is no GUI over ssh from Windows unless you already know what you're doing. In that context, accidentally opening emacs is bewildering :)
Re:Modern terminal-based text editor by deong on Friday September 29, 2017 @12:01PM (#15366451)
That's basically my question. What's the market for people who want a terminal based programmers editor in late 2017 who don't already use Vim or Emacs?
Re:Modern terminal-based text editor by meitham on Saturday September 30, 2017 @02:03AM (#15371484)
I moved from Vim to Spacemacs (emacs with evil kit) four years ago. I was worried initially worried my productivity might go down due to not knowing emacs functions. Surprisingly, there was an included plugin (https://github.com/kai2nenobu/guide-key/blob/master/README.o...) that offered me all the possible keys at the bottom. Most functiond are two, three or four keys away. For instance, I wanted to copy the file name I am editing I could press Spacebar, which offered about 15 further keys, such as f all functions to do with files, b for buffer functions, w for window functions, etc. Once i pressed f, then I see all the functions possible on a file, including Spc-f-y for yanking the file name. This made the editor auto discoverable for me, almost like jumping to Windows 3 after years on MS-DOS.
Re:Modern terminal-based text editor by type0 on Sunday October 01, 2017 @06:50AM (#15377244)
Spacemacs is amazing but it's almost an IDE at that point.
Re:Modern terminal-based text editor by meitham on Sunday October 01, 2017 @07:39AM (#15377387)
An IDE with the best embedded editor, Vim, reimplemented with elisp!
Re:Modern terminal-based text editor by dspillett on Friday September 29, 2017 @10:04AM (#15365333)
> While emacs is a terrific editor ... it is not easy to use.

I would suggest it is easy to use, mainly because it can be customised pretty heavily to work your way, it just isn't easy to learn which is why I've stuck with other options.

Re:Modern terminal-based text editor by barrkel on Friday September 29, 2017 @12:33PM (#15366760)
Emacs is mostly just unfamiliar. It's also a little bit opinionated, and out of the box its opinions have a little bit of distance from most GUI editors.

It's not actually hard to learn. I reckon vi is harder to learn, but at least with vi you know you have to do things differently. Emacs is much closer to other common editors, just a little bit different, and that can make it surprisingly frustrating, with the emphasis on surprise.

Re:Modern terminal-based text editor by jcelerier on Friday September 29, 2017 @11:34AM (#15366187)
I think that "easy to use" means "easy to use from the beginning" most of the time.
Re:Modern terminal-based text editor by b0rsuk on Friday September 29, 2017 @06:39AM (#15364138)
I haven't downvoted you, but I wouldn't recommend Vim either, and it's my favourite editor. Vim is notorious for trapping users, they don't even know how to exit the program!

Nano really gets the job done for people who have no clue about editor usage. If you only need to edit a few lines in a file once a month, immediate accessibility Nano provides is more valuable than powerful features that take time to memorize and absorb into muscle memory.

Emacs, Vim are for people who use Nano enough to start feeling uncomfortable.

Re:Modern terminal-based text editor by mikegerwitz on Friday September 29, 2017 @09:06AM (#15364854)
> they don't even know how to exit the program

Vim lists `:q' and `:help' prominently in the middle of the screen when you first start it. If you try to exit with C-c (in Normal mode), or C-c C-c (in Insert), you get this message:

"Type :quit<Enter> to exit Vim"

Re:Modern terminal-based text editor by vetinari on Friday September 29, 2017 @09:33AM (#15365069)
> Vim lists `:q' and `:help' prominently in the middle of the screen when you first start it.

Only when you start it by itself intentionally, not when you want to edit something and your $EDITOR is not set, then you end up in vim without an idea, how to quit.

I remember (in the mid-90s) making another telnet session and killing vi. Swearing in the process. Yes, I later learned the :q! command.

Re:Modern terminal-based text editor by hiram112 on Saturday September 30, 2017 @12:21AM (#15371216)
I'm always 'that guy' who will eventually run 'sudo yum install emacs-nox' on any of our dozens of EC2 instances I'm shelled into if I'm working with it for more than a few minutes.

The problem is that some of these servers are already stripped down - it's even worse as we're moving to containers.

Emacs, even the non-gui version, still requires about a dozen dependencies, at least on most Debian and RHEL based servers. And each time I install it, I get some bad feeling in the back of my mind, wondering if I'm the one who opened a big hole into our infrastructure because I just wouldn't learn vim. :)

And yes I know about Tramp mode from my local machine, and other tricks, but sometimes it's easier to just install the damn editor locally.

Re:Modern terminal-based text editor by efficax on Friday September 29, 2017 @10:13AM (#15365417)
It's 10MB uncompressed because go compiles libraries statically in the binary. 10MB is not really a big lift, and static compilation makes binary distribution much simpler.

I don't have any objection to packaging emacs with the OS. Actually, it comes with macOS, although without graphical support (/usr/bin/emacs).

Re:Modern terminal-based text editor by coldtea on Friday September 29, 2017 @04:04AM (#15363543)
>why the downvote?

Because MB don't matter. It's about the experience it offers (e.g. as a better nano for early users) or doesn't offer.

Nobody cares if Emacs is only 3MB more -- it's not an argument for "just use Emacs then".

Re:Modern terminal-based text editor by shandor on Friday September 29, 2017 @07:35AM (#15364384)
> Because MB don't matter

I beg your pardon, but since Linux is increasingly used nowadays in quite resource constrained embedded devices, MB definitely does matter. (No, I don't claim that the individual 10 MB is very much on most devices that are actually capable of running linux. But once you go down that road and start having something else bloated than just the text editor, you are a few hundred MBs poorer in no time, and that is a lot.)

Re:Modern terminal-based text editor by coldtea on Friday September 29, 2017 @09:02AM (#15364826)
>I beg your pardon, but since Linux is increasingly used nowadays in quite resource constrained embedded devices, MB definitely does matter.

How are those relevant in our context?

Most of those "constrained embedded devices" (from smartphones to IoT and set top boxes) don't run terminals and editors anyway. And those that do belong to a niche, and those people can install whatever they want, be it nano, micro or whatever fits.

If you're concerned about the programmers of those "constrained embedded devices", that might want to ssh and edit something on them, then those programmers don't use nano anyway, so this doesn't concern them either.

Re:Modern terminal-based text editor by hnlmorg on Friday September 29, 2017 @07:58AM (#15364506)
I don't entirely agree with coldtea either but in defence of this project it is very easy to shrink the ELF binaries that Go spits out as there's a lot of debugging hooks in there that arguably you don't need on production boxes:

https://blog.filippo.io/shrink-your-go-binaries-with-this-on...

Re:Modern terminal-based text editor by shandor on Friday September 29, 2017 @08:42AM (#15364699)
Sure, my meaning wasn't to talk down the project itself, it looks neat! The "MB does not matter" just jumped at me (somewhat out of context, I have to admit) since I work in the embedded land, and the pain is sometimes too real there.
Re:Modern terminal-based text editor by coldtea on Friday September 29, 2017 @09:03AM (#15364834)
Obviously the MB don't matter in this case and for the target audience of the editor, not in general and in every context.
Re:Modern terminal-based text editor by woodrowbarlow on Friday September 29, 2017 @10:20AM (#15365482)
embedded boxes run something like busybox to get just the coreutils rather than including all the packages that ship with, e.g., debian.

https://busybox.net/about.html

Re:Modern terminal-based text editor by agumonkey on Friday September 29, 2017 @06:59AM (#15364226)
13MB only ? how come