nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [RFC] is it time to break free from the Pico defaults


From: Devin Hussey
Subject: Re: [Nano-devel] [RFC] is it time to break free from the Pico defaults
Date: Mon, 26 Nov 2018 15:47:38 -0500

> From: Benno Schulenberg <address@hidden>
> To: address@hidden
> Cc:
> Bcc:
> Date: Mon, 26 Nov 2018 15:54:59 +0100
> Subject: Re: [Nano-devel] [RFC] is it time to break free from the Pico 
> defaults
>
> Op 23-11-18 om 23:22 schreef Devin Hussey:
> > If nano wants to be more accepted as a serious editor instead of "the
> > one for n00bs who don't know how to use Emacs or Vim", it needs to
> > advertise most of its features out of the box. There is a reason more
> > people use Ubuntu and Mint than Arch. You just install it and use it
> > without messing with manual setup.
> >
> > I think we should use something like these for defaults:
> >
> >     # sanity
> >     set historylog
> >     set nowrap
> >     set mouse
> >     set multibuffer
> >     set smooth
> >     set softwrap
> >     set zap
>
> I can agree with zap and smooth and nowrap, and maybe with softwrap
> and historylog.  But not with mouse (it stops me from using the
> touchpad to scroll through the file, and hinders selecting text
> by dragging),

Then, mouse is not for you. Most people probably would prefer mouse.

echo "set nomouse" >> ~/.nanorc
Most terminals support selection in mouse reporting mode by holding
Alt or Control.

>and not with multibuffer (it would change the tag
> for ^R, Insert, into a misnomer).

^R Read File

> >     set linenumbers
> >     set numbercolor brightblack # gray on most terminals
> >     # Actually hardcode the absolute paths into the code.
> >     include "/usr/share/nano/*.nanorc"
>
> Line numbers by default would be a nuisance.

I don't think this looks so bad. Maybe don't have it on by default,
but brightblack looks really nice.

https://imgur.com/a/m29Nn97

The only irritating thing is highlighting text for copy/paste.

>And loading all syntaxes by default is a performance killer.

real    0m0.375s
user    0m0.262s
sys    0m0.071s

real    0m0.602s
user    0m0.309s
sys    0m0.068s

That is a very minor difference for an 8mb file on a low end 2009 Core 2 Duo.
Vim uses syntax highlighting by default, and nano still outspeeds it
on cold startup (vim benefits more on hot cache, though). And vim's
highlighting definitions are significantly more complex than nano's.

When we properly implement the short-circuit parsing, that would
probably bring it down to a fourth of a second.

The only issue I see is with Terminal.app which does choke a bit on
colors, but then again, Apple ships with nano 2.0.6 because of their
GPLv3 phobia, and power users which do upgrade nano usually switch to
a different terminal like iTerm2.

> I was thinking more of:
>
>         set morespace

Coming from someone who studied both web and graphic design, morespace
is kind of visually unpleasant. We should have an initial gap at the
first line, which scrolls away as the user scrolls. I think that looks
best.

  GNU nano 3.2

1  hello world
2  this
3  is
^G Get Help    ^O Write Out

  GNU nano 3.2
1  hello world
2  this
3  is
4  a
^G Get Help    ^O Write Out

  GNU nano 3.2
2  this
3  is
4  a
5  test
^G Get Help    ^O Write Out

Most webpages with a floating header do that. If the header is, for
example, 48px tall, they usually put margin-top: 56px; on the content.
Even the built-in stylesheets have a 0.5em margin on the body itself
by default to get the same effect with the browser frame.

That way, it puts an initial visual separator between the two, then
when the user scrolls, they can see that there is a separation
(because the content is moving independently from the header) and they
no longer need that gap.

>         set nonewlines

Is there an option to only set nonewlines if the existing file has no
trailing new line? If so, we should use it.

Almost all files on Linux are expected to end in a new line. For
example, ISO C requires it, although GCC and Clang happily ignore it
without -Wpedantic.

When they don't, you get ugly stuff like this:

address@hidden ~ $ cat file
Hello, address@hidden ~ $

Only zsh will actually put a new line in there, marked by a reverse video %.

zsh ~ % cat file
Hello, world![%]
zsh ~ %

>         set nowrap
>         set quickblank
>         set smooth
>         set zap

Ok with the rest of these.

-- Devin Hussey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]