[Top][All Lists]

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

Re: [Help-nano] Disable justify on ^J

From: Mark Yagnatinsky
Subject: Re: [Help-nano] Disable justify on ^J
Date: Sun, 23 Apr 2017 00:47:27 -0400

First of all, it's not too complicated to subscribe to the list.  It takes a few minutes to sign up.  It takes less time to sign up than it took you to write this email.
I signed up myself fairly recently, and it was also for a "single use".  And then I never bothered to unsubscribe.  But that's also simple.
Unfortunately, gmail by default uses "repy" instead of "reply-all", so I almost hit send before I noticed that I hadn't replied to you.
To save you a few minutes, I've taken the liberty beginning the subscription process for you.
This is in some sense a bit rude and presumptuous of me, so if this not what you want I hope you'll forgive me.
Anyway, about your actual question...

I think this is a very old feature, and I've used copy and paste through PuTTY before, so I have no idea what's going wrong for you.
Here's a quick-and-dirty workaround.  Let's say your shell prompt is a dollar sign, and the file you want to change is config.txt.
Then do this:

$ cat > temp.txt
$ nano temp.txt config.txt

Now you can use copy and paste within nano itself.  After you're done, delete the temporary file.

Hope this helps.

On Sat, Apr 22, 2017 at 2:55 PM, Yves Goergen <address@hidden> wrote:

I'm facing an issue with using nano on Ubuntu Linux through PuTTY on Windows. I need to copy and paste a few lines of a configuration file into the file in the editor. Naturally the file uses Unix line endings (LF only) because it can also be copied over directly. Unfortunately, the two line ending characters, CR and LF, have the corresponding key input ^M and ^J. Now while ^M (CR) is actually documented to insert a new line (which is exactly what the Enter key does), ^J (LF) does not do the same thing, or nothing at least, but instead it messes up the document by removing some line breaks over the place.

Interestingly, LF, the Unix line ending, causes justify, whereas CR, that alone is the Mac OS classic line ending, causes a new line. CR and LF, Windows line ending, would do both. I don't understand why the thing isn't broken everywhere but actually seems to work for interactive Linux users.

So I need a way to permanently disable or remap the ^J hotkey. How does that work? I'm not interested in justify, this is a simple text editor, not a word processor.

In the current state, I cannot use nano to maintain server config files through SSH. I'm not sure how to solve this otherwise. I don't want to go back to vim, and I have no experience with emacs. Are there other editors that are similarly easy to use as nano but don't have this major issue?

Actually I can't remember having this trouble before. Is justify (with that hotkey) a new feature that was added with Ubuntu 16.04? Or even later through a security update?


PS: Please CC me because I'm not subscribed to the list. (Mailing lists are too complicated to use for single use.)

Help-nano mailing list

reply via email to

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