this post was submitted on 25 Dec 2023
660 points (99.8% liked)
196
16490 readers
2957 users here now
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
escape colon w q
escape colon w q
it is literally. the first result on google.
escape then Shift+Z twice also works. or shift+Z shift+Q to quit without saving.
Are you people allergic to search engines or someth--
siiiiiiiiigh
Yes, I'm an old man yelling at cloud, but Vim and Neovim are fantastic text editors that really are worth the half hour you'll spend running through the tutorial to learn them, and the subsequent two weeks you'll spend installing plugins and configuring it exactly to your liking. It really does make writing software more efficient and really doesn't deserve the reputation it gets from "vim is hard to exit lmao" memes made by people who haven't bothered to change their $EDITOR to nano, had it launch automatically when they tried to write a commit message, and instantly decided it was just yet another piece of arcane 80s Unix bullshit
vi isn't a text editor as much as it's a text manipulation language.
It has a syntax, grammar, idioms, and, yes, a learning curve.
But once you learn it, it's as close to a brain-computer interface as I've experienced. You start thinking about edits as chainable operations and it literally becomes muscle memory -- if you ask someone experienced with vi how they just did a complex sequence of edits, chances are they'll have to stop and consciously walk through it because they literally didn't have to think about it the first time.
got any online course recommendations? my college recommended missing semester for the basics of the basics, but i know there are so many more and other vim workflows (easy motions etc)
although i should first start getting into touch typing
In the terminal write ‘vimtutor’, that covers the basics.
"All my homies hate :wq"
At first I did now understand it, why would you even use it??(vim / neovim) It would take ages to learn it all. Then got around to try it, and in a span of like a week, I couldnt go back to editing text with a mouse. I wasnt efficient at first, but damn was it fun. Just cruising around the codebase without touching the mouse (as much as i could.)
Yeah, it makes you more efficient if youve learnt it enough, but at the same time, it makes editing literal text way more enjoyable. You need to edit some boilerplate, and it actually becomes somewhat interesting like: 'Can I use a macro here', or 'How can i do it the most efficient way?’.
I think it also gives you a state of mind as well (for me it definitely shaped it.) You want to learn your tools, you want to understand what makes a good text editor (ex. LSP), or just perfecting your usabilitx of a terminal / shell.
At the same time, damn sometimes its a straight up curse that i learnt vim. I open any other text editor and i just curse the whole time: 'Where are my vim motions?!!?
P.S. Remapping Escape to Caps Lock made vim usability to a 10 for me.
First time using Linux and in a job setting isn’t the time to get Vim’d, so yeah I dipped. Don’t judge too hard pls!
I am a professional linux sysadmin, and I don't use Vim. There is honestly no task you will ever do that will actually require familiarity with Vim. You can get by with Nano just fine.
vim feels nicer though :/
I use nano on my servers because the default configuration can be used by pretty much anyone, even if I had to explain it to someone over the phone. And hopefully you rarely if ever have to make sophisticated changes to files on servers that would benefit from vim's model.
If you do need to do consistent heavy-duty file editing on a server, rmate is really nice for that: https://github.com/aurora/rmate
But honestly both of these strategies are dated and I don't use either of them professionally. These days it's all immutable infrastructure: I use my local editor to make build scripts for immutable server images that there's no point in editing files on running instances because none of the changes will be persisted.
Exactly. The days of doing long form editing directly on your server are gone. Most likely any editing I'm doing is happening in VSCode or Notepad++/qq.
I actually learned while writing docs for work because it was boring as fuck otherwise. Now I'm one of those people. Give it a shot if you want to spice up (and dramatically slow down at first) some tedious work for a bit.
Okay, how do I Google in vim?
step 1. alt
step 2. tab
alternately:
step 1. switch VTs back to your desktop environment and Google it there
if you're using vim without a GUI running at all (I hate embedded systems too):
step 1. you still have your phone on you, right