Spyke
marcosreply
lemmy.world

When $EDITOR is vim, but I expected anything else:

opens file, with small text on the top; text begins changing; text duplicates in size, then triples; text returns to original size; text increases in size to fit several screens...

Then my great reflexes kick on and I notice something wrong :)

11
jaybonereply
lemmy.zip

Do you prefer when EDITOR is set to emacs?

2
marcosreply
lemmy.world

Personally, yes. But the default being nano is very sensible.

8

First few time I opened vim (will neovim) I failed to see how to enter a command, and closed the window to get out of it

1
quokk.au

I will legitimately go esc, :w, i on Google Docs to try and save the document...

49
lemmy.zip

Escape in some email clients cancels a new email. I had to retype many emails before email clients began auto-saving drafts.

31

The paiiiin! How many hours I lost because of this?

::: spoiler Spoiler Probably less than I used to configure my neovim... :::

7

my work client cancels the new mail without there being a draft, though that may be because of muscle memory pressing a key combo after esc. its major pain o7

2

I often ^x^s on graphic IDEs too.

On most of them, it works if you don't have any text selected. The Microsoft ones do really weird things.

1
FedXreply
quokk.au

Direction navigation in vim is hjkl.

27
sh.itjust.works

I know I'm just a vim-less heathen, but using letters for navigation in a text editor seems kind stupid when arrows exist.

22
ExcessShivreply
lemmy.dbzer0.com

Why the hell didn't they go with JIKL or something instead then, so the pattern at least resembles the direction it navigates?

12

I remember going from using Z/X/C+mouse2 for left/backpedal/right+forward WASD was such an adjustment

1

so your finges dont have to leave the home row. Its acually peak when you used hjkl for some time

11

The reason it's so popular is because it provides directional navigation on the home row, with the direction that's by far the most common (down) under your strongest, dominant finger (the index finger).

It's much better for both efficiency and ergonomics than arrow keys.

11
ExLisperreply
lemmy.curiana.net

Why would you move your hand to arrow keys when the letter are already under your fingers?

ESC, use-letter-to-navigate, i, type, ESC, navigate, i, type

Really simple. On my keyboard I re-mapped ESC to TAB so I don't even have to move my hand to switch between navigate and insert modes.

8
sh.itjust.works

So you've transferred the required hand move from the right hand to the left, and added extra required keystrokes to accomplish the same task. I don't see how that isn't worse.

3
ExLisperreply
lemmy.curiana.net

No, it's a key stroke, not hand move. I don't have to reposition my hand to hit ESC. You do have to reposition your hand to use arrow keys.

Also, you usually move the cursor by more than just one character. It's one extra keystroke to reposition the cursor, not to move it by one char. You have shortcuts to jump to end of file, specific line, end of line or even create and jump to bookmarks. All this with just standard keys, without repositioning your hands to use the mouse or arrow keys.

5
sh.itjust.works

Your keyboard must be slightly different than the one I have in front of me right now. Home row to esc and home row to arrows is the same distance on mine.

1

First, as I said, I remapped ESC to TAB key. Tab is very close.

Second, it's different to hit ESC ones than to use arrows keys to move around. To go back to home row after using arrow keys I have to feel around the keys trying to find "j" again. Or look at keyboard. I don't have to do that after hitting ESC once.

3

Moving hands is an extremely time-consuming task when you're typing 60+ words per minute. Couple of keystrokes are much much faster than relocating your hand twice.

2
msagereply
programming.dev

I have it instead of CapsLock, tab is too useful to forego.

But yes, arrow keys are too far, and I avoid them everytime I can, including in Shell

2
ExLisperreply
lemmy.curiana.net

Yeah, sorry. I have:

Esc -> Caps lock (useless so far away)

Caps Lock -> Tab (the most useful so closest)

Tab -> Esc -> second most useful

I had it for so long that I forgot which one is which :)

2
TerHureply
lemmy.dbzer0.com

Imma throw another option into the ring which is Caps lock -> Esc / Ctrl. it‘s esc when tapped and ctrl when combined/ held for longer. veeeery useful

1

Sounds interesting. How do you set this up in Linux? I'm just remapping keys on X level now.

2
graycubereply
lemmy.world

Instead of using the arrow keys most vi & him users navigate the cursor around the doc by using letter keys. I do it so subcociously now I am not sure which direction is the j when I use my phone.

8

Look down at your keyboard. Look at the letters, look at the arrows. You can use hjkl without moving your right hand at all, it's always in a position to enter commands or text. With arrows, you'd constantly need to switch positions.

6
Lumidaubreply
feddit.org

I'm one of the noobs. You use letter keys to navigate around text?

1
owseireply
programming.dev

Vim has several modes. INSERT mode let's you write text, NORMAL mode let's you navigate (with h,j,k,l and others) and perform operations on the text with your keyboard, like "dw" to Delete Word or "A" to enter insert mode at the end of the line.

You can use arrow keys to navigate in insert mode. However I just press escape, which changes to normal, navigate to where I want to, then change to insert mode.

I may seem like this makes simple navigation complex, and it kinda does. But complex navigation becomes easier.

Vi (and vim and neovim)'s primary concern is viewing and editing code, writing is secondary (although it's still an excellent experience)

10
poinckreply
lemmy.world

Oh, I did not know of 'A' before. Hopefully I can train myself to use it.

2
SystemDiscreply
feddit.org

I use ‘O’ the most. It inserts a newline at the end of the line and starts Insert Mode after the newline.

2

Awesome. After many years of vim-use I learned about CTRL+n as well. A game changer.

And while we're at it, I also installed vim-nox to be able to use vim-snippets with utilsnips to TAB for even more joy of programming with vim. [=

2

Yes, (neo)vi(m) has different modes, in normal mode the characters are shortcuts, hjkl is used for navigation. However other methods are prefered, w, e, b - jumping words, f,t - jumping to a specific character etc. Its way faster. Also it can be combined d2w (d)eletes the next (2) (w)ord. Or more advanced di" (d)eletes the text (i)nside the "..."

Insert mode is what you except: it writes what you type. Can be accessed by i - (i)nsert before a - (a)append after. Going back to normal mode is ESC (or many configure tab)

5
poinckreply
lemmy.world

I always uninstall nano on systems with not much users. On the more busy and established servers, I need to leave it as-is and I have to adjust when visudo opens nano and I forgot to put EDITOR=vim in front of it.

1

Can't uninstall it or my coworkers would go nuts. On systems with separate users, I can set it via .bashrc, but on shared user systems ... Well. Above happens.

2

I cannot begin to describe how many times I’ve had to re-type the same info in some input form because I hit esc when I had first finished it!

7

It's been so long since I worked on a machine where I couldn't use the cursor keys in vi, I don't think I'd even be able to anymore.

5

I only understand this reference because I worked for a company at one point that had a large number of NeXT and Solaris hosts that only had vi installed with letter key navigation, so my muscle memory does not use arrow keys.

5

ITT: People who don't use vim and insist we have arrow keys now so don't need hjkl anymore.

4

Here's what my terminal usually looks like

@>vim srv/txt.txt Writes a bunch of lines of code/words/docker containers. [ESC] :sq Can't edit file without sudo :q! @>sudo vim srv/txt.txt 🥹

4
lemmy.today

Coders use word docs?

I'm not a programmer but I still open up notepad and write in markdown.

It's just faster.

4

When I start a new roguelike:

Activate [j]ump ability, view [l]og, no item underfoot to mark for [k]eeping, [h]ide.

2

ting in vim I sometimes still forget I start in normal mode.

2