Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nano line wrapping (-w)

daviddavid Member
edited May 2025 in General

I must have been using nano for more than 15 years now. I've used "nano -w" to turn off line wrapping, because the default was hard wrapping/breaking the lines.

It's a bit of a pain, because every other time I would mistype the "-w".

nano o-w

Today, reading the man page for nano, I found:

-w, --nowrap
       Do  not  automatically hard-wrap the current line when it becomes overlong.  This is the default.  (This option is the opposite of -b (--break‐
       longlines) — the last one given takes effect.)

So "-w" is the default now. I'm sure it wasn't before, though.

Thanked by 1nghialele
«1

Comments

  • JabJabJabJab Member

    Thanked by 1nghialele
  • wadhahwadhah Member, Host Rep

    just make an alias if you use it often something like "nw" for "nano -w"

  • daviddavid Member

    @wadhah said: just make an alias if you use it often something like "nw" for "nano -w"

    I was about to do something like that, after all these years. There's also .nanorc where you can change the settings. But as it turns out, it's the default now.

    Thanked by 1wadhah
  • zedzed Member

    I admire you for admitting in public you use nano.

  • daviddavid Member

    @zed said: I admire you for admitting in public you use nano.

    What do you use?

    Even though I know it's the default now. I still find myself typing:

    nano -w
    nano o-w
    

    I'm not sure I can stop.

  • Why don't you use vim?

  • @JohnnySac said:
    Why don't you use vim?

    Because some people don’t like to torture themselves?

  • yoursunnyyoursunny Member, IPv6 Advocate

    Why don't you use notepad.exe?

  • daviddavid Member

    @JohnnySac said: Why don't you use vim?

    It's too similar to vi, which I was introduced to back in the 80's, and disliked.

  • daviddavid Member

    @yoursunny said: Why don't you use notepad.exe?

    $ notepad.exe
    bash: notepad.exe: command not found
    
  • @yoursunny said:
    Why don't you use notepad.exe?

    wordpad.exe ftw

  • zedzed Member

    @david said:

    @zed said: I admire you for admitting in public you use nano.

    What do you use?

    Even though I know it's the default now. I still find myself typing:

    nano -w
    nano o-w
    

    I'm not sure I can stop.

    vim of course, horrible shit but now i'm old and used to it. i was teasin though, use what you like <3

  • daviddavid Member

    On my desktop, I often use kate, though even there, if I'm already on the command line, I'll more likely use nano.

  • lirrrlirrr Member

    i use nano

    Thanked by 2nghialele beanman109
  • @david said:

    @JohnnySac said: Why don't you use vim?

    It's too similar to vi, which I was introduced to back in the 80's, and disliked.

    Yeah everybody hates vi/vim at first (including me) but once you force yourself to learn a few keys you will wonder how you lived without it.

  • emperoremperor Member
    edited May 2025

    @david said: What do you use?

    Idk what's wrong with nano.. I would like to know also what he uses. found in the comment up :)

  • I use nvim.

  • raindog308raindog308 Administrator, Veteran

    @barbaros said: Because some people don’t like power tools and want to swim in the kiddie pool

    FTFY

    @david said: It's too similar to vi, which I was introduced to back in the 80's, and disliked.

    Sad. You're really limiting yourself as a Unix user.

    If you'd said "I prefer emacs," that is a respectable answer.

    But every sysadmin I've ever known who was worth his salt quickly outgrew nano and used vi/m or emacs. When editing text files is a large part of your day, you want to do it as efficiently as possible.

    I can't even begin to imagine editing text files without regex... :s

    Thanked by 1JohnnySac
  • DediRockDediRock Member, Patron Provider

    gotz to have the softwrapping

  • darkimmortaldarkimmortal Member
    edited May 2025

    @raindog308 said:

    @barbaros said: Because some people don’t like power tools and want to swim in the kiddie pool

    FTFY

    @david said: It's too similar to vi, which I was introduced to back in the 80's, and disliked.

    Sad. You're really limiting yourself as a Unix user.

    If you'd said "I prefer emacs," that is a respectable answer.

    But every sysadmin I've ever known who was worth his salt quickly outgrew nano and used vi/m or emacs. When editing text files is a large part of your day, you want to do it as efficiently as possible.

    I can't even begin to imagine editing text files without regex... :s

    I can’t imagine editing text files without a GUI… any serious remote editing of configs I do with winscp+notepad++ , and of course nano for one liners

    Vim is for hardcore keyboard users, you can get same results from a gaming mouse and monitor (1:1, high refresh rate, low latency) without having to learn new tricks

  • Also why not edit ~/.nanorc to make it permanent

  • daviddavid Member

    @raindog308 said: Sad. You're really limiting yourself as a Unix user.

    If you'd said "I prefer emacs," that is a respectable answer.

    But every sysadmin I've ever known who was worth his salt quickly outgrew nano and used vi/m or emacs. When editing text files is a large part of your day, you want to do it as efficiently as possible.

    I can't even begin to imagine editing text files without regex...

    Back in the day, I used the Prime line editor (ED), on a Prime minicomputer. When searching, I found it's available on sourceforge. I don't think I'd want to go back to it, today, though.

  • daviddavid Member

    @zed said: vim of course, horrible shit but now i'm old and used to it. i was teasin though, use what you like <3

    No offense taken, no worries. Nano is just what I've gotten used.

  • Nano is for neutered bitches.

  • I currently use Micro as editor. It's very simple and easy to use. For coding i either use VSCode or Vim using LazyVim (when i'm on terminal or ssh'ing to a vps)

  • doghouchdoghouch Member
    edited May 2025

    @JohnnySac said:
    Yeah everybody hates vi/vim at first (including me) but once you force yourself to learn a few keys you will wonder how you lived without it.

    esc + :q! is all you need

    edit: maybe :wq too

    edit #2: you know what, just install nodejs vscode on ur server and see 90% cpu when it tries to index your $3/year crapbox

  • angstromangstrom Moderator

    @david said:
    I must have been using nano for more than 15 years now. I've used "nano -w" to turn off line wrapping, because the default was hard wrapping/breaking the lines.

    It's a bit of a pain, because every other time I would mistype the "-w".

    nano o-w

    Today, reading the man page for nano, I found:

    -w, --nowrap
           Do  not  automatically hard-wrap the current line when it becomes overlong.  This is the default.  (This option is the opposite of -b (--break‐
           longlines) — the last one given takes effect.)
    

    So "-w" is the default now. I'm sure it wasn't before, though.

    --nowrap seems to have been made default in February 2019 (in which case it's been a while):

     #ifdef ENABLE_WRAPPING
    -       print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines"));
    +       print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines [default]"));
     #endif
    

    (See https://cgit.git.savannah.gnu.org/cgit/nano.git/commit/?id=cd9328fbf5c4016ba5c5fbc06fe88427d9bd1b50 )

    Thanked by 1david
  • angstromangstrom Moderator

    @raindog308 said: I can't even begin to imagine editing text files without regex... :s

    Although nano has its limitations, it has regex:

    set regexp
       Do regular-expression searches by default.  Regular expressions in
       nano are of the extended type (ERE).
    
  • farsighterfarsighter Member
    edited May 2025

    @doghouch said:
    esc + :q! is all you need

    edit: maybe :wq too

    Or just these:
    esc + ZX (quit without saving)
    esc + ZZ (save and quit)

  • e2bs2k1e2bs2k1 Member

    i use nano normally. Only use vim when copy pasting. nano have weired actions when copied text have invisible characters.

Sign In or Register to comment.