Re: Language-specific replacement for `formatter`
"Viechtbauer, Wolfgang (SP)" <[email protected]>
| Newsgroups | gmane.editors.nano.general |
|---|---|
| Message-ID | <[email protected]> |
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 -----Original Message----- From: Help-nano [mailto:help-nano-bounces+wolfgang.viechtbauer=maastrichtuniversity.nl@gnu.org] On Behalf Of Anthony Sottile Sent: Wednesday, 26 September, 2018 21:45 To: [email protected] Cc: [email protected] Subject: Re: [Help-nano] Language-specific replacement for `formatter` On Wed, Sep 26, 2018 at 12:37 PM Anthony Sottile <[email protected]> wrote: > > On Wed, Sep 26, 2018 at 11:31 AM Benno Schulenberg <[email protected]> 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