Changing from a distro that defaults to nano to another that defaults to vim... What to do other than installing nano and changing visudo?

top 100 comments

sorted by: hot top controversial new old
[–] 41 points 6 months ago* (last edited 6 months ago) (6 children)

At the risk of restarting the Editor wars (https://en.wikipedia.org/wiki/Editor_war) from days of yore, I find it interesting that emacs wasn't even in your list of contenders. I hear it mentioned less frequently these days, so perhaps it's going by the wayside?

For the record, I'm a vi/vim user! I had the privilege of being taught to use it by an RFC-writing greybeard decades ago, and have used it without thinking ever since.

For those who find themselves on a machine with only vi/vim, or want to learn, here's a quick primer when editing a file (usually done by typing "vi foo.txt" in a shell) --

:q! ...Force quit vi (:q also works -- gentler!)

:wq! ...Save file and quit vi

i (then type characters) ...insert text at current position

A (then type characters) ...Insert at end of current line

G ...go to first character of last line in the file

/foo ...search for first occurrence of "foo" in the file (hit / again to find additional instances)

x ...Delete character under cursor

:56 ...Go to line 56

yy ...Copy the line the cursor is currently on into the buffer

p ... Paste the buffer

r (then type character) ...Replace character under cursor

u ...undo (hit multiple times to undo prior actions)

When done with a command like this, hit Esc to go back into normal mode.

Second nature after a bit of practice! I used to work with a guy who insisted on using ed. That was... odd.

  • source
  • hideshow 6 child comments
  • [–] 8 points 6 months ago (2 children)

    Yeah but op was comparing editors, not OS's. Https://emacsos.dev

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 6 months ago*

    Been using it (not often beyond basics for home server container administration) for years but I always get confused with searching vs search and replace vs global search

    / (n for next instances)

    :%s//

    :g//p (grep was named after this one IIRC, Global Regular Expression Print)

    And often I just use :%s to search and highlight all instances and don't press enter because I forget the others and I often have to search and replace for docker comppse snippets.

  • source
  • parent
  • [–] 67 points 6 months ago (3 children)

    Team Vim. Because I learned the vim basics once 20 years ago and never bothered to learn after that. :D

  • source
  • hideshow 3 child comments
  • [–] 11 points 6 months ago (1 child)

    I see you and raise straight vi.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 7 points 6 months ago

    That's what I was taught at my first tech internship. It's all they had on the UNIX system running the webserver in 1998.

    I did write some web pages the pulled live data from the backend. I had the pleasure of writing them in C. I got the data binding to some kind of CORBA system using extern variables that were bound at compile time. All of the html (no js or css yet) was hand built and generated from the C code.

    vi was the only editor on the system and there was no way to use arrow keys (the UNIX system didn't have them on the keyboard at all).

    I also had the displeasure of building a backup system on a floppy where I had to write a bat script that could manually load a token ring driver, bind a SMB share, load Ghost backup software and backup the local hard drive at under 2mb (yay coax thicknet). The tool used to query and write through the hostname for the backup? Copycon. Fucking copycon in DOS. That showed me how a terrible (but working) tool could be to work with.

    Unless an editor can do reasonable vim emulation, I can't take it seriously. You're welcome to use it, but I won't be able to get anything done in it quickly. The vi keys are too ground into my reflexes.

  • source
  • parent
  • [–] 7 points 6 months ago

    Vim sorely underrated. Great tools/hotkeys. Felt like a master pianist clacking away while the terminal went berserk until suddenly the 2 hour job was done in 20 minutes.

  • source
  • parent
  • [–] 25 points 6 months ago (4 children)

    I use Helix... Uhhh idk I think it's nice I guess

  • source
  • hideshow 4 child comments
  • [–] 23 points 6 months ago

    micro for sensible defaults out of the box, and because I don't like modal editors.

  • source
  • [–] 18 points 6 months ago

    NANO I just need simple, and tell an me how to save and exit without abstract key codes.

  • source
  • [–] 18 points 6 months ago (3 children)

    nano for quick things; emacs for longer typing sessions.

  • source
  • hideshow 3 child comments
  • [–] [S] 0 points 6 months ago (2 children)

    Emacs its a so-so operating system (that devours your ssd) with a not do good embedded text editor

  • source
  • parent
  • hideshow 2 child comments
  • [–] 18 points 6 months ago (2 children)
  • [–] 17 points 6 months ago

    Team Neovim.

    I looked into ed, then decided its not for me.

  • source
  • [–] 15 points 6 months ago (2 children)

    Emacs.

    With all the vimmery going around nowadays though, I feel like I'm on the losing team. ;_;

  • source
  • hideshow 2 child comments
  • [–] 14 points 6 months ago (1 child)

    I'm an emacs -nw kind of guy.

    But if I have to pick one of your options, nano

  • source
  • hideshow 1 child comment
  • [+] 13 points 6 months ago (7 children)
  • [–] 1 point 6 months ago (5 children)

    No only OP provided almost no discussion value in the post body, but also this topic has been discussed one million times and nothing more can be talked about.

  • source
  • parent
  • hideshow 5 child comments
  • [–] [S] 1 point 6 months ago (4 children)

    Isn't the chance for us Lemmings to share experiences a good enough reason to start this thread?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 6 months ago (3 children)

    To be frank, not really. What's so special about us Lemmings? I mean, so many other people brighter and more experienced than us have already shared. Whatever we said here can only be a subset to that at most, then why not just read the old threads.

  • source
  • parent
  • hideshow 3 child comments
  • [–] [S] 1 point 6 months ago (2 children)

    Understandable, have a good day!

  • source
  • parent
  • hideshow 2 child comments
  • [–] 11 points 6 months ago (2 children)

    Helix when I can install things, vi when I can't.

  • source
  • hideshow 2 child comments
  • [–] 11 points 6 months ago (4 children)
  • [–] 3 points 6 months ago (2 children)

    I've never heard of helix before, is it any good?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 6 months ago

    I use it daily and think so. Best part is that it dose not need any plugins to be a modern editor. Just configure any LSPs you want and it all just works including things like fuzzy finding, multiple cursors, file browsing etc.

    This all being said a plugin system is close to being added. :)

  • source
  • parent
  • [–] 11 points 6 months ago

    I only ever use a terminal based editor for making quick edits of config files, so nano works just fine for me.

  • source
  • [–] 11 points 6 months ago

    Nano. It's easy and I've never had a reason to change.

  • source
  • [–] 11 points 6 months ago

    vim, mainly cause I haven't figured out how to quit yet.

  • source
  • [–] 9 points 6 months ago

    "Why are we running from the police, Dad?"

    "Because they use vim, son. We use Emacs".

  • source
  • [+] 9 points 6 months ago (1 child)
  • [–] 9 points 6 months ago
    [–] 9 points 6 months ago

    I have switched to using helix, so no matter which distro I am on I need to change it to be my default by setting the EDITOR env var.

  • source
  • [–] 9 points 6 months ago
    [–] 9 points 6 months ago

    I use nano because I haven't learned how to use anything else yet.

  • source
  • load more comments (-2 replies)
    [–] 16 points 6 months ago (4 children)
  • [–] [S] 8 points 6 months ago* (2 children)

    I realized that I'd forgotten about pico and joe, the latter was my very first text editor (hated it!).

  • source
  • hideshow 2 child comments
  • [–] 15 points 6 months ago* (3 children)

    Nano, because it's the only one I can remember how to quit from without power cycling the computer.

  • source
  • hideshow 3 child comments
  • [–] 1 point 6 months ago

    You are in edit mode and you need to get out of it. Press ESC, and then colon which will show in the text area at bottom of window. If you want to save, push w, then q and the enter to quit. If you want to quit without saving, you have to force with !.

    Escape, colon, (W)ith save, (Q), Enter

    Or

    Escape, colon, (Q)uit, !, Enter

    If you just want to use the text editor commands, you just do escape to be able to enter text on the line.

  • source
  • parent
  • [–] 7 points 6 months ago

    @SocialistVibes01 Emacs of course

  • source
  • [–] 17 points 6 months ago (12 children)

    nano. I can't memorize esoterica.

  • source
  • hideshow 12 child comments
  • [–] 2 points 6 months ago (11 children)

    That's who micro exist. And is so much better.

  • source
  • parent
  • hideshow 11 child comments
  • [–] 10 points 6 months ago (10 children)

    nano still wins. All the shortcuts are listed at the bottom.

  • source
  • parent
  • hideshow 10 child comments
  • [–] 3 points 6 months ago (9 children)

    Micro doesn't need to list the shortcuts because it uses similar shortcuts to notepad and you don't have to do weird ctrl+x to exit but ctrl+q (for quit). Also copy and pasting isn't a nightmare in it.

  • source
  • parent
  • hideshow 9 child comments
  • [–] 3 points 6 months ago (8 children)

    Copy and paste in nano work just fine - no clue what you're talking about. It uses standards established in the '80s - Ctrl-X for eXit being an even older standard - and clearly lists them visibly for a quick reminder.

  • source
  • parent
  • hideshow 8 child comments
  • [–] 3 points 6 months ago (7 children)

    Yeah cutting text with ctrl+k instead of ctrl+x (because that's exit) and copying with alt +6 instead of ctrl+c.

    Le

    Mao.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 3 points 6 months ago

    In emacs ctrl+y is paste, which is weird to me because i'm pretty sure even in emacs the logic is that y stands for yank, but in every other program i've used so far yank means copy, not paste. In the end though i feel like muscle memory from other editors don't bother me as much, and i can learn multiple at the same time. I started with evil mode for vim bindings for a short while, but now i'm diving into pure emacs bindings.

  • source
  • parent
  • [–] 2 points 6 months ago (5 children)

    Yeah, that's what the shortcut hint shows, champ.

  • source
  • parent
  • hideshow 5 child comments
  • [–] -1 points 6 months ago (4 children)

    Why doesn't my Lemmy comment box show shortcut hints? How will I know the shortcut for copy, cut and paste? I tried pressing alt+6 but it did nothing. Curse you Ecmascript from 1997!

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 6 months ago (3 children)

    Which command-line program are you using to access Lemmy?

  • source
  • parent
  • hideshow 3 child comments
  • [–] -2 points 6 months ago (2 children)

    Should only command line programs show their keyboard shortcuts?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 6 months ago
    [–] 6 points 6 months ago

    I'm on team "whatever comes pre-installed"

  • source
  • [–] 6 points 6 months ago (2 children)

    I used to use Neovim but now I mainly use Helix, it's really good by default, the most hassle is usually just looking up an LSP for a language and installing it.

    My config file literally only has the theme I use, unlike the heavy configs I'd have to make so that vim/nvim are the way I want. I also like the multiple cursor approach it has to editing.

  • source
  • hideshow 2 child comments
  • [–] 1 point 6 months ago (1 child)

    I also like the multiple cursor approach it has to editing.

    You do!? I cannot STAND it! Am I using it wrong? C to add another cursor on the line below but only if it already has a character in that column. It seems strictly worse than VIM's visual line selection with V.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 6 months ago

    For use cases like that it's usually better to search a pattern and split it to cursors. Also using line selects helps.

    I remember being annoyed at what you said but I guess I was overusing C for new cursors when there were other ways to do what I needed because I don't have that often now

  • source
  • parent
  • [–] 6 points 6 months ago (2 children)
  • [–] 5 points 6 months ago* (last edited 6 months ago) (2 children)

    nano but i'm a casual. i can use vi/vim in a pinch, but i'm inefficient. ed and emacs are totally foreign

    i tend to use a graphical text editor like Kate unless there is a specific reason to do it in the terminal

  • source
  • hideshow 2 child comments
  • [–] 5 points 6 months ago (1 child)

    Just echo text to create a new file or use sed and awk to edit an existing file.

    In reality, I use nano for edits and vimdiff for comparing files (usually a .pacnew after an update on a headless device)

  • source
  • hideshow 1 child comment
  • [–] 5 points 6 months ago

    Micro, for muscle memory for keyboard shortcuts from when I was a mostly GUI user.

  • source
  • [–] 5 points 6 months ago

    I am a noob. My server is a MacMini running Ubuntu server because it was easy to install. I have a website, Jellyfin and nexcloud.

    I don’t have the brain cells to understand VIM.

    In the CLI, I use nano, always. In the GUI, I use Sublime text because the colors are very pretty.

  • source
  • load more comments
    view more: next ›