Nano is my “daily drive”, but I’d use vim as well – takes a couple seconds to search for “how to type in linux vim” and “how to save a file in linux vim” anyways. :^)
I know
i
and:wq
and that’s all I ever plan on learningNot even Basic Command-Count-motion like c3w aka change 3 words after cursor, or d3b delete 3 words before the cursor?
To that, you add the D aka delete command C for change Y for yank (copy)
So yy to yank line, or dd to delete line.
Also p for paste
Also, i sends you before the cursor, a sends you after. Capital I is insert at beginning of line, Capital A is insert at end of line (append).
I terms of motions and moving around, you need: hjkl, C-d and C-u (half page jumps down and up), and within the line: 0 or ^ for beginning of line, $ for end (taken from regex), w for moving by word forwards, b for moving by word backwards. That’s pretty much all you need imo. There is also t and f. Where t goes forwards (think 'till aka until). Like dtc delete until the c character. F is the same but goes backwards in the line rather than forwards. Remember you can use these with xommands, so d$ deletes until the end of the line. Or “dt.” deletes till the “.” so… yeahI know there’s more, but that’s all you need for Normal and Insert mode imo.
For Visual mode, you only need to know how the Visual modes work. Visual (v), Visual Line (Shift-v) and Visual Block (Ctrl-V).
Also, for visual mode, it might be helpful to learn how to use V-Block to comment out multiple lines at once. Can’t be bothered to go into it.
But I’d argue that’s all there is to learn about vim keys in terms of getting work done.
Not gonna lie, once you’re getting past single button combos, I’m mentally checking out. Ctrl+K and Ctrl+U in nano are good enough for me, and if I need to do something more complex like actual coding, I’ll use an editor with a full GUI as well.
Fair enough. I basically gave you a large chunk of vim so it will feel super overwhelming. The trick is to do one command or combo at a time. For example, I started with dd. Then I added yanking. Then I added visual mode. Then I added “o” (which I think I forgot to mention: o creates a newline under the current one and puts you in insert mode. Capital O does the same but above the current line). The real trick is going little by little. And to be honest, there are some commands I still rarely use or forget to mention. I’ve never used f instead of t. And in terms of forgetting to mention, there’s the x command which deletes the single character under the cursor rn.
Also, I’m sure someone will find this list helpful, so on top of this, I’ll also add this video (and hope that Piped bot will appear): https://www.youtube.com/watch?v=RSlrxE21l_k
It contains some things I haven’t mentioned.
As for learning all this, I’m repeating myself for the third time. Do it little by little. And when a command is already a thing you do almost without thinking about it, you’re ready to add more.
I’m mentally checking out
Why? dw is delete word, c5b change 5 words backwards, and those are the most complicated commands you’ll ever get to use, unless you start adding cuatom keybinds.
But I digress. If you don’t want to learn it, it’s fine.
I’ll say that I find easier to exit vim that to exit nano.
I don’t know what ^ means. I just start pressing special keys until it doesn’t the thing
CTRL
IME?
Integrated Mevelopment Environment. You should have known this
I’m a meveloper
tips fedora M’eveloper
MevOps Engineer
My mate mevops
The M stands for beefcake
Integrated Memeing Environment
That acronym usually stands for “Input Method Editor” and describes the program that makes people able to type east Asian characters with a usual keyboard.
日本語は楽しいです。
Vscode is malware
?
VScodium is FOSS though
Nah… vim users fight emacs users, but not nano users. Wrong league. We do not beat little children ;)
Nano is more like fast food. It’s easy and convenient, but it makes you feel a little guilty and dirty afterwards.
Nano is the tool that people use when they don’t have a need for TUI editors in general and therefore don’t want to have to memorize how people with teletypes decided things should have been done 75 years ago and who also don’t want to get dragged into endless pointless bickering arguments about which set of greybeards was objectively right about their sets of preferences.
I’m glad people enjoy the editors they use and also I just wanna change a single fuckin line in a config file every once in a while without needing to consult a reference guide.
I don’t have much to say about nano, except the hotkey bindings are weird and unnatural.
They make sense, but they feel wrong.
And yet Emacs users don’t fight vim users. Emacs users decided vim’s interface was pretty cool and added it to Emacs. Somehow people still call it a war though.
Bruh 😂 the Emacs user community absolutely constantly shit on Vim users. When they added Vi(m) bindings they literally named it ‘evil mode’, and they constantly make fun of people who use it, and spacemacs, and the latest flavor of (neo)vi(m), and all the extensions necessary to make vim halfway useful as an ide, etc etc etc.
Which Emacs community? I’ve been following it for ages in a few places (Reddit is the most common) and I literally do not encounter any of that. Calling it evil was humor - as if people who went to all the bother making it would be trying to push people away…
Using the evil package is very popular and often recommended, which means literally using it like vim, but with all the Emacs ability on top. I don’t know what on earth you’re talking about.
Same here.
The biggest diss I have on emacs users, as a vim user, is that emacs is the only text editor where people routinely need to keep a book about it on their desk!
I used to work with a bunch of emacs guys and they all had an emacs book or two on their desk or as a monitor stand. They usually also had one on awk and/or Perl to go with it.
I’m sure they’d probably make fun of me for being unable to edit a file with anything but my specific vim config, which is not compatible with any other human’s vim config.
(I would never seriously judge someone on their editor, but I will bust an emacs users chops and accept a good natured jab back)
Oh to be clear, it’s all humor. At least mostly, I’m sure there are RMS level fanatics somewhere that truly believe some of the BS.
This is something as old as time. I’ve seen it prolifically on Reddit (though not in the Emacs community, they generally discourage memes), various Linux forums, old Usenet, various programming forums… I’m not trying to be evasive, but it’s hard to provide examples that aren’t specifically cherry picked, which wouldn’t benefit the conversation much.
There’s even a Wikipedia page dedicated to this: https://en.wikipedia.org/wiki/Editor_war
How close to vim’s functionality is evil mode? I’ve been toying with the idea of learning Emacs but I rely on Vim’s langmap and that is rarely implemented in Vim emulations / bindings.
Although I came from vi (pre-vim and pre-evil) and still have the muscle memory, I don’t and haven’t used it myself.
I hear it described as a “nearly complete” and “very comprehensive”. There is definitely a solid community of people using and enjoying it, but on the other hand there are always some reports of getting tired of having to work through, and sometimes extend, an additional interface layer, so in the long run being happier to just adopt the default bindings.
I know there are a few areas where trying to follow common vim workflows doesn’t work as well. Historically the performance of line number display been weak in Emacs, though I believe it’s recently much improved. A lot of people seem to make heavy and constant use of it in vim but conversely for me (and I think it’s more common in Emacs) it’s only an occasional, transient need when some external log or error quotes a line number, so I have them only displayed when I hit the go-to-line binding.
Overall, I think the most frustrating issues people have trying to adopt Emacs from vim are due to trying to impose their specific familiar vim workflows. The most obvious example is people concerned with startup time, but for more typical Emacs workflows it’s a non-issue. Users typically stay in Emacs rather than jumping in and out of it from a terminal (and if you really want that workflow, you run one instance as a daemon and pop up a new client to it instantly). My Emacs instance’s uptime usually matches my computer’s uptime.
The draw of Emacs is not about it only being an editor so much as a comprehensive and programmable text environment. It is a lisp-based text-processing engine that can run numerous applications, the primary being an editor (the default, or evil, or others…) but also countless other applications like file managers, VC clients, subprocess management and many others. It 95% replaces the terminal for me, and many other tools. So it’s the environment through which you view and manipulate all things text that is very accessible to modify and extend to fit your needs. Hence the joke about it being an OS is pretty apt, though to believe it needs a good editor implies vim isn’t a good editor ;).
Evil or the extensible vi layer is super popular and improves the one area that emacs was lacking i prefer the emacs keybinds but have never seen peeps chat shit about it
That’s like the picture of a normal dude with Nano, a large Vim dude, a larger buff Emacs dude and an ever larger massive Ed dude.
eh the emacs folks are just chilling in a corner somewhere. Maybe in the old folks home together with the ed users
Do people still use ed unironically outside of scripting context?
Unironically? Maybe not. But using something ironically is still using it.
Don’t forget the joe user in the corner wearing a trench coat with a bomb strapped to his chest wired to a dead man’s switch.
Ed is like Skynet itself.
stop using nano, if you want a non modal editor use
vim -y
Uh, just trying non-modal vim for the first time and… how do I quit it? I can’t :q.
Uh, just trying non-modal vim for the first time and… how do I quit it? I can’t :q.
I’ve never tried modal vim because I’ve only just heard about it. The next thing I’d try is restarting the computer. Or Ctrl + Q whichever’s easier.
Ctrl-q
and then if it asks to save, type “no, fuck you”
I so would love to downvote this to oblivion.
Vim (or emacs, or any other advanced text editor) is much easier to use than nano when you need to do something more complex than type couple of lines.
If you don’t count the hours of reading docs and learning shortcuts
This makes it seem like jerking off to MILF porn is hard because there is a learning curve
It is easier after you learn basics. Learning is not easy, but usage is.
Well okay by that logic playing Beethoven on piano is super easy
A handful of shortcuts isn’t that hard
Right, it’s remembering them and using them efficiently that’s hard. It’s amusing watching coworkers try to flex in vim and then struggle at the most basic tasks.
No, some piano plays are still harder than others, mo matter how long you practice. Editing text with vim is easier than with nano after some practice.
If something is “easy to use” this includes the time you need learn said thing.
Drinking rahmen from the bowl is easier then using chopsticks (even if you are more elegant with chopsticks)
Driving automatic is easier then driving manual (even if you may be more efficient with manual if you practised shifting a lot)
Walking is easier then flicflacs (even if you may be faster with flicflacs if you practised a lot)
Using Ubuntu is easier than using arch (even if arch gives you more control and opportunities if you understand it)
And how often does that happen in the real world?
VIM may have been a very useful tool 20 or 30 years ago, but today it’s nothing else but a tool for one’s sense of superiority. It’s the vinyl of editors.
If you have to type that much code in a terminal, your infrastructure is outdated. Simple as that.
Every day in my case, except holidays.
…so your infrastructure is outdated.
Yes it’s so outdated that mostly every IDE offers usage with its keybindings.
VIM may have been a very useful tool 20 or 30 years ago, but today it’s nothing else but a tool for one’s sense of superiority. It’s the vinyl of editors.
So, because you don’t understand something, it’s outdated?
If you have to type that much code in a terminal, your infrastructure is outdated. Simple as that.
Ok, I can see you have no idea what you’re talking about.
I understand it very well. And that’s exactly why I’m writing this.
Ok, I can see you have no idea what you’re talking about.
Then say, grandmaster delusion, what purpose does vim serve, where it is actually the best tool? Writing code? Hardly, it’s way too limited and requires a ton of upfront investment and headspace. Writing config files? Hardly, because if you write these by hand, you’re living in the 90s, that’s what Ansible, Terraform etc are for.
You just don’t want to admit, that vim is nothing more than a habit. Muscle memory.
You seem to believe that people only use the terminal if they HAVE to. I doubt anybody these days HAS to type any amount of code in the terminal, but choose to anyway. Like probably anyone else I have access to modern tools and infrastructure, but I choose to do work in the terminal because I’m more productive there. I use (neo)vim because I like it more than any other text editor I’ve used, and have no problem writing code and debugging in the terminal.
You’re using the terminal, because you’re used to it. It is not the better tool, it’s simply what you happen to know already.
People who argue with productivity because of some key bindings live in the world of the 80s. You don’t just sit there and type code 12h a day, that’s not how modern software development works.
And all those blockheads down voting me are caught up in their weird superiority complex. They are the powerful superhackers, and don’t understand that we are just highly qualified plumbers.
I’m actually fairly young and wasn’t around in the 80s. I graduated college with a CS degree in the past 5 years, where I was exposed to many different tools and software. What did I come out of that experience with? I like the terminal more than any IDE I had to use in any class.
Now in the real world, we don’t always get to use our favorite tools for every task, obviously. I do need to use other, more enterprise, software from time to time for work. But whenever possible I go to the terminal because I’m faster there, and I can quickly automate things.
I’m not saying the terminal is the best tool for every job, I’m just saying it is the best for ME. Notice I’m also not putting down other tools here. It seems to me like you might be the one with a superiority complex.
No, I’d argue you simply didn’t want to invest in the other tools.
Think about it, you probably spent hours on customizing and automating vim, and then say you’re faster in that. Well, that’s called a habit.
IDE are objectively more powerful and since you can actually see options and navigate quickly, you don’t need to memorize every obscure feature.
All the terminal editor enthusiasts are actively holding us back, because they insist everything outside vim is garbage for enterprise and kiddies.
If your tool of choice is actively hostile to new users for no reason other than “that’s how it’s always been, and thus it’s better”, well then you’re digging a moat to automate your gatekeeping.
vim + terminal is actually objectively more powerful than any IDE, and most IDEs include a way to pull up a terminal as a crutch for things they can’t do. In any case It seems you can’t be reasoned with. Your argument is just a strawman about what you say other people are saying.
(…once you learn the bindings)
The problem I had with nano is that, for the time being, it was supposed to be easy to use. With that in account I always get lost when saving a file and closing the thing because one’s used to doing something else with Ctrl+O and Ctrl+X.
Whereas with Vim (and Neovim for a little while, and now with Vis) I knew it had a steep learning curve from the start so I always had it in mind. And all the funny stories about quitting vim.
I mean quitting vim isn’t hard you just reset the computer.
they’ve changed those bindings now, Ctrl+S, Ctl+V, and Ctrl+C all do what you think they do
I’m thinking Ctrl+C quits and Ctrl+S is scroll lock is that correct?
-
nano
- Ctrl-Q search backwards
- Ctrl-S and Ctrl-X is save file
- Ctrl-V is scroll down
- Ctrl-C is cancel or info
-
nano --modernbindings
- Ctrl-Q quits
- Ctrl-S is save file
- Ctrl-X is cut
- Ctrl-C is copy
- Ctrl-V is paste
-
Great, now the next time I use nano I surely will forget about this and get frustrated when trying to save a file with Ctrl+O
you still can, but I think Ubuntu and other prepacked distros will switch soon to the better bindings
Great so now I will mangle all my merge commits depending on which version the host is using.
The first time I found myself in nano was when testing a distro fifteenor twenty years ago. I had to edit some files and it was the only available editor. The damn thing was a horror to use. I still have no idea who it caters to. I haven’t had to use it since though.
Dunno what you used, but nano is literally a text editor that may be simple simple but it just works. Shortcuts are shown to the user, buttons work like you expect them to (arrow keys, ESC, shift, etc)
With vim you open it and if you haven’t read 5pages of doc you won’t even be able to close it again. I see that its useful for power users, but for casuals who just want to edit a config once in a while nano is absolutely the way to go imho
It’s not that simplle or user friendly when none of the usual shortcuts work. C-a did something completely unexpected.
Well its shown to you at the bottom of the screen what it does…
And if you want Ctrl v,c,s etc. To work like in word etc you can always use nano --modernbindings
They’re in Linux now, it should show the shortcuts they’ll encounter everywhere. Not leftovers from another system.
Butterfly gang
Vim actually IS easy to use once you get the hang of it, plus more comfortable and efficient.
Nanos just an excuse for lazyness, cmv.
Easy is relative. What are you trying to do? Replace a value in an yaml file? Then nano is easier. Trying to refactor a business critical perl/brainfuck polyglot script in production? Then you probably want to use vim (or emacs if you are one of those people)
Replacing a value in a config file is still easier in vim due to e.g.
ciw
orci"
being a thing.Honestly, roll back to previous release for production and use best IDE your developers are used to on their local machines, test the fix in a non production environment then release to prod. When is editing business critical scripts in production really needed?
It was a joke to make the point that vim can be the easiest tool to use if you are trying to do a complex task.
Ed users entered the chat
I started on Emacs and then didn’t use it for a few years and forgot everything so now I’m stuck on Nano. But that’s fine because nano does everything I want it to do.