this post was submitted on 03 Jan 2025
373 points (97.9% liked)
Linux
48903 readers
987 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
vim isn't required for any files, you just followed online tutorials for how to edit those files instead of RTFM
terminal text editing is convoluted because it has to strike a balance between figuring out when a keypress is part of the text you're typing, vs when it's a command you're using, and making sure that all the editor commands the designer wanted are accessible.
vim is great because it allows for thousands more editing commands and macros, and much more customization of the editor, up to allowing plugins that emulate other functionality. As it stands, my setup basically functions as a full, lightweight-ish, multi-language IDE that rivals Emacs or Visual Studio.
On top of all that, I don't have to move my hands away from the homerow of keys to navigate or edit, which may not seem like much, but adds up to a lot of avoid typos and time saved from moving my hands to reach the arrows/delete/home/end/pgup/pgdn.
Some examples:
h
,j
,k
,l
move left, down, up, and right respectively, but they can be combined with a number to move that many rows or columns; e.g.6j
will move down 6 rowsdd
deletes a line, but using a number +d
+ a movement will delete that many characters/lines in the path of the cursor: e.g.34dl
will delete 34 characters to the right of the cursor,12dk
will delete 12 lines up.gg
will take you to the first line,G
will take you to the last, and number + either will take you to that line: e.g.3275gg
or3275G
will take you to line 3275and finally you can use
/text or regex pattern you want to search for
and Enter to search the document for the first occurence below your current location, and then usen
to search for the next occurence, orN
to search for the previousThat doesn't even scratch the surface (that's just the cheatsheet, which only scratches the surface), but if you can get a handle on only what I've said, and switching between input and command mode (
i
andEsc
respectively), the speedup to navigation alone will make it seem more sensible.And as always, don't forget to
:wq
(write to file and quit)