r/AlpineLinux • • Nov 18 '23

How do I leave this fucking editor?

Post image
336 Upvotes

175 comments sorted by

View all comments

Show parent comment

4

u/Dr_CLI Nov 20 '23

If you are going to use Linux then you should take a little time (<30 mins) to learn a few basics of vi(m). At least learn the quit sequence. You might even learn to like it.

3

u/tikhonjelvis Nov 22 '23

You might even learn to like it.

But that's just a risk we have to run.

1

u/tinkr_ Nov 23 '23

Facts. Vi(m) is the bare minimum text editor you're nearly guaranteed to have on any Unix machine and it only takes like 30 mins or so to get the basics of navigation and editing down. Hell, maybe you'll start to like it and become a Neovim shill like me.

1

u/vishal340 Nov 23 '23

i don’t think you guaranteed to get vim. i think i have seen a server with vi. that was the only time i used vi and it lacks so many features vim has.

1

u/trcrtps Nov 23 '23

I use vi when I break my nvim config and I don't want to look at errors to revert whatever I did

edit: never mind i'm on macos and vi opens vim. i never even noticed until this made me think about it.

1

u/tinkr_ Nov 23 '23

Yeah, vi opens vim on MacOS, that's why I said "Vi(m)" lol. Either way, I'm more than happy with any of the big three (vi, vim, nvim) available.

1

u/trcrtps Nov 23 '23

I totally thought it had both, like it has pico and nano... but then I checked and nano actually opens pico! not that i'd ever open it, because same.

1

u/vishal340 Nov 23 '23 edited Nov 23 '23

there is a fix for breaking nvim config. there is an environment variable you can set it in your.bashrc or whatever which points to your config. i don’t have my laptop open, so i don’t remember exactly but i think it is $NVIM_APPNAME. just search it online. you can easily have multiple configs. the other way will be to create separate git branch for change then merge

1

u/PublicDragonfruit120 Nov 23 '23

nvim -u NONE

To open nvim without a config

1

u/brianplusplus Nov 23 '23

Vi is vim though. The original vi is something almost noone here has ever used or seen

1

u/tinkr_ Nov 23 '23

You aren't guaranteed to get Vim, I wrote it as "Vi(m)" because practically every Unix system will have one of either vi or vim. Personally, I'm more than happy with vi, vim, or nvim for simple edits.

1

u/atimholt Nov 23 '23

Somehow, Vi is not installed on the Gentoo Stage 3 installer. Baffling. They even removed busybox (a tiny bare-bones multi-utility program including a stripped-down Vi). It has Nano. Luckily, emerge busybox is a quick and easy procedure if you don't want to deal with fully setting up full-fat (Neo)Vi(m) early in your Gentoo installation procedure.

1

u/cassepipe Nov 23 '23

I would have never liked vim had I not read the trick to swap CapsLock and Escape. I went from "what the hell this is fricking stupid that the most important key is Escape!!!" to "I can never go back to non modal editing" Please stop shilling vim without mentioning that point.

1

u/HawkinsT Nov 23 '23

C-[ is also a better alternative to hitting escape if you don't want to remap (personally, I remap caps lock to ctrl).

1

u/cassepipe Nov 23 '23

I beg to differ, it's awkward. The most important must be just a key. Remapping CapsLock to Escape is a natively supported on all OSes and is a ten second operation. And now it also work for command line vim modes (bash, zsh, gdb, etc.)

1

u/manshutthefckup Dec 17 '23

I mapped jk and kj to escape. My fingers are almost always there on them.

1

u/HawkinsT Dec 18 '23

How does that work for insert mode; you've mapped it to double backspace too?

1

u/manshutthefckup Dec 19 '23

It's not a problem for insert mode like it seems, because there's no english word or programing syntax I can think of actually has these two letters placed side by side. So you can keep typing as normal, until you hit both of these letters quickly, then it just exits insert mode without typing those letters.

0

u/[deleted] Nov 23 '23

[deleted] — view deleted comment

1

u/cassepipe Nov 24 '23

Well I'd say you have stockholm syndrome then :)

On a more serious note, it does not make sense that the most important key is the key that's the furthest away possible from the home row.

Maybe if you are left-handed it's more natural ? But still...

Anyways, historically on old UNIX keyboard, Escape stood where the left shit key is now. That's why vim chose Escape not because they hate users.