help-nano
[Top][All Lists]
Advanced

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

Re: [Help-nano] Language-specific replacement for `formatter`


From: Anthony Sottile
Subject: Re: [Help-nano] Language-specific replacement for `formatter`
Date: Wed, 26 Sep 2018 13:39:38 -0700

On Wed, Sep 26, 2018 at 1:35 PM Viechtbauer, Wolfgang (SP)
<address@hidden> wrote:
>
> Maybe I am misunderstanding, but you can bind ^R^X... to a key. See:
>
> https://www.nano-editor.org/dist/v3/nano.html
>
> and search for "If you use such a formatting command regularly".
>
> Best,
> Wolfgang
>

Right, but I can't do that _per language_, I'd need to have N key
bindings (and remember each of them separately) for the N languages I
have formatters for.  Plus I can't bind to a name that already has
another meaning (I'd want to bind to ^T so I don't have to "oh is this
a linter or a formatter" each time).

Anthony

> -----Original Message-----
> From: Help-nano [mailto:address@hidden On Behalf Of Anthony Sottile
> Sent: Wednesday, 26 September, 2018 21:45
> To: address@hidden
> Cc: address@hidden
> Subject: Re: [Help-nano] Language-specific replacement for `formatter`
>
> On Wed, Sep 26, 2018 at 12:37 PM Anthony Sottile <address@hidden> wrote:
> >
> > On Wed, Sep 26, 2018 at 11:31 AM Benno Schulenberg <address@hidden> wrote:
> > >
> > >
> > > Hello Anthony,
> > >
> > > Op 25-09-18 om 22:23 schreef Anthony Sottile:
> > > > Hi! I've noticed that `formatter` has been removed in nano 3.x,
> > > > however I've previously found it pretty useful for running things like
> > > > `go fmt` (or sorting for gitignore for example).
> > >
> > > The formatter command was "made" for Go, so that you used it for that
> > > is no surprise.  But... how often do you need to re-sort a .gitignore
> > > file?  And if you really need to, how hard is it to type: ^R ^X |sort
> > > <Enter>?
> > >
> >
> > Any time I'm changing a .gitignore I run this.  And really any time
> > I'm editing _any_ file I'll instinctively hit ^T to run the formatter
> > / linter.  `^R^X|sort` is a *lot* to type over and over.
> > Additionally, if `^R^X` replaces `formatter` surely it also replaces
> > `linter` but that seems to remain?
> >
> > > > Whether I had a formatter or linter I could run ^T and it would
> > > > usually do what I want.  With the removal of `formatter` from nanorc
> > > > is there a way to restore that behaviour?
> > >
> > > No.  Not now.
> > >
> > > > I work on a _ton_ of different file types (20+) so setting up a
> > > > shortcut for each formatter for each language is really not feasible.
> > >
> > > For how many of those syntaxes have you found a useful use of the
> > > formatter command?  (Judging from your Github stuff, you have nanorc
> > > files for just four syntaxes, and just one of them contains formatter.)
> > >
> >
> > Ah yeah, those are just the ones I have posted publicly because they
> > work "universally" on all the machines I install those dotfiles on --
> > I have 10-15 other nanorc files that I don't have checked in there
> > (with most of them containing formatters / linters).
> >
> > > > I'd be sad to see this feature removed permanently
> > > >
> > > > (maybe this is an email asking for restoration of `formatter`)
> > >
> > > Then please post a feature request on Savannah:
> > >   https://savannah.gnu.org/bugs/?group=nano
> > >
> > > In that request you may want to reference another complaint:
> > >   https://savannah.gnu.org/bugs/?54651
> >
> > It seems that link is exactly what I'm asking for as well, either
> > restoration of ^T -> `formatter` or an equivalent replacement.  Though
> > it is marked as `wontfix` :(
> >
> > >
> > > Benno
> > >
>
> The implementation of `formatter` doesn't seem all that complicated
> either: 
> http://git.savannah.gnu.org/cgit/nano.git/commit/?id=975b49123592e20c71860e7d44d5788c59928f7d
>
> is it really _that_ much maintenance burden to remove given how
> convenient it is (and how inconvenient ^R^X is?)
>
> Anthony



reply via email to

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