Jump to content
  • entries
    17
  • comments
    12
  • views
    8,725

VI Improved(vim) and everything wrong with it!

Herr.Hoefkens

915 views

so after postponing for 15years i finally decided to give vim a go....

these are my issues with it most of them are applicable to the out of the box fesh installation of it.

 

lets start with the first couple:

  1. for a keyboard oriented editor (everything availeble from commands and functions without your hands needing to change positions ~ everything availeble from homerow) , to the point wer navigating a document (usually arrows) is duplicated to the keys hjkl , you do have  to press the [ESC] key 2 or more times for every little thing you want to do, go a line down be sure to be in normal mode, [j]-key , -key first then type the text hit [esc]-key [v]-key select the text [y]-key to copy  [ESK]navigate line down, - damn end of document -key again ,  hit [enter]2times ,[esc]-key , navigate one line up, [v]-key press [p] - to paste 

 the navigation using [h][j][k][l] is ideotic not because of it not being the arrow keys cause you can still use those but because of the choice of letters , [h][j] are index finger [k]-middle finger and [l]- ring finger and they respectivly do ←↓↑→ so in case its not clear , the keys should have been : [j][k][l][;]  and more logical would have been [j:←](back in line) [k:↑] (back  in docu) [l:↓]further in docu,[;: →]furter in line

]

9 Comments

You use down/up more frequently (change line) than going 1ch left/right.

Only logical to have them under your pointing/middle fingers.

Going left/right are usually done by word-jumps (W, L etc) or search (/, % etc).

 

Feels like you use ESC when you don’t need to, for example after ‘yanking’ you go into NormalMode right away.

 

Some text is missing, so I’m not sure what’s going on…

…to add a new line from NormalMode press O.

…to paste you don’t have to enter VisualMode.

 

You can remap all your keys, including HJKL to WASD, however, you should learn and understand the basics first, before customizing.

 

Go trough built-in vimtutor, also ggl VimTricks, Primeagen.

Link to comment
Link to post

another anoyance , is that the go left doesnt wrap around to the previous line at the end.

On 7/26/2022 at 8:56 PM, rikitikitavi said:

You use down/up more frequently (change line) than going 1ch left/right.

Only logical to have them under your pointing/middle fingers.

Going left/right are usually done by word-jumps (W, L etc) or search (/, % etc).

 

Feels like you use ESC when you don’t need to, for example after ‘yanking’ you go into NormalMode right away.

 

Some text is missing, so I’m not sure what’s going on…

…to add a new line from NormalMode press O.

…to paste you don’t have to enter VisualMode.

 

You can remap all your keys, including HJKL to WASD, however, you should learn and understand the basics first, before customizing.

 

Go trough built-in vimtutor, also ggl VimTricks, Primeagen.

and on the word jumps topic , i find myself using left-right allot , and switching to word jumps would be ctrl+[whatever key] , i could get used to using ctrl + [j] for word jumps, its not that that key combo is used already ,... and every other editor and tty/terminal emulator also uses that key for it.

 

and the ctrl key IS within reach from homerow while the [esc] i have to press beforehand isnt.

i also specifically mentioned that i was commenting on a clean out of the box install  without any modifications.

doing vim tutor again wont change my opinion on the choice of the keys

hjkl, vs jkl; the ';' isnt used for anything anyway.

 

and on the search thinggy , yes you often use /asdf , not for navigation or searching but for removing the highlights you accidently enabled because you were navigating and wanted to comment out a line using # and werent in insert mode yet....

 

and the fact that they hold their own copy-buffer , i wont hold against them as that seems to be a problem for every commandline editor... 

and on a minor anoyance , okay : qa exits , unless something changed , if they are gonna give a prompt that you cant because of a change a quick hit [y/n/c] to save not save or cancel, but they went for " to quit without saving hit escape now and enter the command :qa! to quit without saving or :wq to quit with saving... even :q and a prompt for [w/a/...] would have been better/nice

 

Link to comment
Link to post
38 minutes ago, Herr.Hoefkens said:

another anoyance , is that the go left doesnt wrap around to the previous line at the end.

and on the word jumps topic , i find myself using left-right allot , and switching to word jumps would be ctrl+[whatever key] , i could get used to using ctrl + [j] for word jumps, its not that that key combo is used already ,... and every other editor and tty/terminal emulator also uses that key for it.

 

and the ctrl key IS within reach from homerow while the [esc] i have to press beforehand isnt.

i also specifically mentioned that i was commenting on a clean out of the box install  without any modifications.

doing vim tutor again wont change my opinion on the choice of the keys

hjkl, vs jkl; the ';' isnt used for anything anyway.

 

and on the search thinggy , yes you often use /asdf , not for navigation or searching but for removing the highlights you accidently enabled because you were navigating and wanted to comment out a line using # and werent in insert mode yet....

 

and the fact that they hold their own copy-buffer , i wont hold against them as that seems to be a problem for every commandline editor... 

and on a minor anoyance , okay : qa exits , unless something changed , if they are gonna give a prompt that you cant because of a change a quick hit [y/n/c] to save not save or cancel, but they went for " to quit without saving hit escape now and enter the command :qa! to quit without saving or :wq to quit with saving... even :q and a prompt for [w/a/...] would have been better/nice

 

This is not Notepad or Emacs, don't expect it to behave the same, just like you don't start driving manual transmission and expect it to behave like an auto with the same muscle memory.

 

The whole point of Vi is NOT be reliant on arrows/mouse/modifiers, but instead jump with B if you need to jump to a previous word (including going up a line) if you NEED to be on a (1) previous word. You press K if you only need to go up a line, or use any other appropriate function to get places.

 

CTRL is used for different functionality by default, if you read any source - it should have shown. Also, you can share clipboard/buffer between Vim and OS.

 

As I said before everything can be remapped in vanilla Vim and you don't need any plugins.

Also, If ESC is a drag, you can map it to CAPSLOCK in Vim or your OS, I don't think you need a CAPSLOCK, do you?! Or for example you can map it to CTRL-C in Vim, this way it will make more sense to you.

 

For commenting I use a plugin - it is more convenient.

 

As I suggested before, check out the resources provided to learn more.

 

So, if you want to fully embrace the beauty of Vim controls, you'll have to learn how to use the 'clutch'. FYI, it probably won't save you much time shredding Vi combos, but you will feel good doing it, just like driving a manual.

 

Edit:

 

I have remapped only JKL to NEI for example, due to Colemak and not wanting to deal with some funny muscle memory

Link to comment
Link to post

at first id like to point out that, im learning vim for a reason not, what are the chances that i found every other editor (with terminal interface) , to have enough stuff wrong with it to push me into learning a new editor after all that time...

in the beginning i just used nano, and pico, then i switched to Joe, and past year i was usig micro.

 

the reason i am not using any plugins and just the plain default vim (wich i explicitly stated) is because i figured that i should atleast know how to use it in that from, there  is no use in knowing only how to use an editor after 2 days of configurration , "yeah i can fix that server for you,.... gotta pay me two days extra because i first need to setup my editor , else i  cant work with it " seems a bit dumb.

On 7/28/2022 at 12:10 AM, rikitikitavi said:

This is not Notepad or Emacs, don't expect it to behave the same, just like you don't start driving manual transmission and expect it to behave like an auto with the same muscle memory.

 

i dont expect it to behave the same, i know that that would be ideotic, i do expect there to be logic , or at the verry least consistency in its behavior ...  and if an editor sets out to work towards a certain goal (be it ease of use or controllable completely from homerow , or  whatever,extensive configuration options, expandability) i expect there atleast to be a really good reason for when they make an exception to that goal ,.. 

also i expect that keys on a keyboard match their discription , when pressig the [A] key an A should appear (if an O would appear , yea we switched the vowels around on your keyboard , should have a really good reason if an editor does that)

I could rant about how , in normal mode Delete does remove the following character , but backspace doest remove the previous, but i wont because while not common , i understand the logic behind (i think) a tipewriter had a back space but could not remove an already typed character , backspace did offer the opportunity to go back a char , use whiteout , ant type a new letter over that. (type writers didnt have arrows so)

but for the following things the logic or reason why  illudes me ,if there are good reasons for them please feel free to inform me or point me to a document or site somewhere with an explanation...

(append to the list of stuff in my previos posts :)

  •  if the [H]-key in normal mode means go 1 char to the left and the [L] key means one char to the  right, why does the cursor travel completely to the place before the first character , but to the right it stops before the last character,  this might seem logic on first glance since the position of the cursor is at the start of the character space in both cases but this is only the case if that line is also the last line in the document ,  else the most right character is in fact the newline char,  one may argue that that is not a printable char and therefore the logic still makes sense, but it completely breaks with the following , in insert mode moving past that character and thus at the beginning of the newline character, pressing delete removes the newline charracter (and moves the content after it to the current line), if that wasnt enough, in normal mode , in that same posistion (most right , before the last "printable char") and pressing delete , removes the char before the cursor (ababa|b becomes abab|b) however , moving one char to the left and presing delete in that position , removes the character that follows (abab|ab also becomes abab|b)
  • the PgUp and PgDn ,also sport some od behavior , as they move the page but not the cursor with it,  okay no problem there , might seem logic , its not what other editors do by default , but there is no rules on the system so... what bothers me is that that is the only behavior , there is a ScrollLock key that should actually change this (thats the purpose of the damn key ,normally scroll lock off = scroll the page, scroll lock on = scroll the view... but inverting the two makes just as much sense , and i wouldnt fault em for that , but using the least used mode of the two as default and then not implementing the other mode is beyond my comprehension.

a clarification on something i said in a previous post: the way to close the document , and it not just asking to save yes/no/abort but instead giving the notification that you should use this command instead... when you do a :qa without a ! on a changed file,... you typed qa , its clear you wanna quit, having to go back the retyping it and including a ! or changing the command to wq , are the only possible options if you indeed wanted to close the files so a yes/no covers both and an abort the rare case you didnt actually wanted to quit. its not like the yes/no abort isnt in the program, if you have a temp file for a certain file and it prompts you to either use the on disk version or the temp version, you do get a diff,edit , delete .abort quit prompt,... why dont they just promt a text , use vim -d for diff mode -R for readonly rm x to remove the temp file or rm x, mv y x to open the temp version and then just exit the program ?

 

and iit would have been nice if they actually dumpte a version of the running config to .vimrc , and moved their config files to .config instead of just iin the homedir. (you could still have it check for files in the homedir for backwards compatibility but placing new files in the .config/vim/ dir for new versions would not be that hard...

Link to comment
Link to post

yet another one ...

i think its (really) awesome that vim has thes .swp files that save any previously unsaved work for you for files .  i really do,

but for god'sake, your a TEXT editor, the only files you will be manipulating will probably be TEXT files ,... (unless plugin.... deal with it on the plugin side then)

was it to much to ask to make the swp files TEXT aswell, dunno some sort of formatting to keep track or whatever but atleast something that could have been read by any other text editor without much trouble

i mean running

cat .file.swp |grep -a string 

on the files ,  and it returning actually returning (even with the -a ) something that resembles the lines of the file that match instead of the wole file as 1 single string with the search-"string" highlighted somewhere

i would have understood some sort of compression even if size was the issue  , running zcat instead of cat (or bat) is not such a biggie but this is less than helpfull for anything who's anatomy isnt silicon based ... image.thumb.png.41d059d3a160eb9680d8db5e2fff9d4d.png

Link to comment
Link to post
On 8/2/2022 at 2:47 PM, Herr.Hoefkens said:

there  is no use in knowing only how to use an editor after 2 days of configurration , "yeah i can fix that server for you,.... gotta pay me two days extra because i first need to setup my editor , else i  cant work with it " seems a bit dumb.

 

You can use it vanilla and do some extra steps.

 

You can have your customizations that can be easily distributed to other systems. No one says you can’t copy paste commands if you are against uploading your vim.rc for whatever reason.

 

Plugins might be a bit trickier if you are concerned with somehow compromising your client’s system. You want to skip em - your choice.

 

On 8/2/2022 at 2:47 PM, Herr.Hoefkens said:

i expect that keys on a keyboard match their discription , when pressig the [A] key an A should appear (if an O would appear , yea we switched the vowels around on your keyboard

 

In InsertMode you should have everything matched up (press A get ‘A’).

 

In NormalMode A is insert after

 

In SelectMode A is select around

 

On 8/2/2022 at 2:47 PM, Herr.Hoefkens said:

PgUp and PgDn

There are many ways to navigate, like zz or CTRL-d.

 

Imagine that Vim users use only 40-70% keyboards, and the furthest button from the home row is ESC.

 

As for the cursor - get used to it: before and on/after are two positions.

 

On 8/2/2022 at 2:47 PM, Herr.Hoefkens said:

go back the retyping it and including a !

Mu assumption is to avoid accidents, so no confirmation prompts.

 

On 8/2/2022 at 2:47 PM, Herr.Hoefkens said:

and iit would have been nice if they actually dumpte a version of the running config to .vimrc , and moved their config files to .config instead of just iin the homedir. (you could still have it check for files in the homedir for backwards compatibility but placing new files in the .config/vim/ dir for new versions would not be that hard...

You have to manually change destination for that.

 

Neovim’s default location is in .config/

 

On 8/7/2022 at 1:15 AM, Herr.Hoefkens said:

but for god'sake, your a TEXT editor, the only files you will be manipulating will probably be TEXT files ,... (unless plugin.... deal with it on the plugin side then)

was it to much to ask to make the swp files TEXT aswell,

Swap files are not made for you to tinker, but for Vim buffer management - so leave them be. Do you also try to access your OS swap?

 

You can disable SWP, or change the location if you just don’t want them there.

Link to comment
Link to post
On 8/8/2022 at 10:27 AM, rikitikitavi said:

You can have your customizations that can be easily distributed to other systems. No one says you can’t copy paste commands if you are against uploading your vim.rc for whatever reason.

i figured knowing how to work with the default is never a bad idea 🙂

 

 

ow and by the way this is not a cheap attemt to bash on vim because i hate it , because i actually dont hate it 🙂 its just the list of stuff that bothers me 🙂 , if i hated it id never use it and i wouldnt be able to say one bad thing about it...

like i hate iOS but i coulnt say any meaningfull thing about it that is bad imho, (as far as using it goes,... the stuff i hate about iOS make it a non starter before ive even used it)

i Can name 100things that i dislike about  Endavour (arch) , and prolly even more about Gentoo , yet gentoo is my distro of choice and i usually have a konsole window open somewhere that is chrooted into my endavour install...

 

that being said , still not really at home in vim , where i did start to use QuteBrowser allot more and has basicly become my goto browser for quick lookups.

i also find it a little sad that while there is a Gvim , there is no Qt version in similar fashion , there is nvim-qt but thats basicly just a dedicated window vor nvim console , and not like gvim....

On 8/8/2022 at 10:27 AM, rikitikitavi said:

Swap files are not made for you to tinker, but for Vim buffer management - so leave them be. Do you also try to access your OS swap?

i dont mean to tinker with , but a quick cat of it to see whats in it without actually having to open vim with that file , choose  what to do , then check what the difference is and close.

also it would have been nice that vims conf would be in .config/vim/vimrc and the swp files would go in /tmp or ~/.cache/vim by default , im sure  you can change the behavior pretty easy but just not cluttering any folder you edit a file in and or the root of the homefoldeer would have been a nice thing. all in all vim is not even the worst in this if iit were up to me .bash.profile and .bashrc would also be in .config by default , and so would every other . folder (looking at you .mozilla .steam .wine .java .kde .npm .vmware . eric7 .cxoffice .dbus )if its a configfile =>.config if its a .cachefile or temporary file like a cookie , .cahe if its actual program data (or wine prefix or ....) -> .local

On 8/8/2022 at 10:27 AM, rikitikitavi said:

Do you also try to access your OS swap?

there is a small difference here OS swap (if any ->running  my swap partition is on an nvme so im running with swapiness=1 with 32gb of ram ,to spare the dive a little , ) and where  swap of the os are pages swapped out from memory and not actual files... where the swp files kindof are just files (hidden ones) that vim writes to by default moving it on save. that being said i think vim also actually keeps the thing in memory when editing so its actually a double.,

and yes if a program is gonna clutter the directories it works in , i tend to wanna see whatsin them if they  leave any behind after closing ,... defenetly if i later on have to backup the directory or make a git repo of it and i expect a add all to only have the files i created  but when uploading all of a sudden some extra files show up... (if i were a Osx Fanboy the MACOS folder that gets shipped with anything made on a mac would seriously piss me off.

 

ps currently building Oni2 (onivim2)  to check that one out and see if its suitable as a IDE , not as an editor but  something that actually can run a debugger 🙂

Link to comment
Link to post

here's another one ....

yeah it supports regex replace by default...

 

sure it does, i know some regex , and like to use it and i dont know of any implementation besides vim where

\n , does not insert a newline , but instead inserts a null character.

what does insert a  new line?

\r , what actually is supposed to go to the beginning of the line , the carriage return , means newline in vim

on  windows a newline is actually a  \r\n  wich makes historically more sense then the unix way (since its  how typewriters worked) but i could agree with the unix way of reducing it to a single character on coputers

but vim , a unix editor mostly i think , we....elll lets do stuff differently then every other thing out there, not because its better or more practical noooo just because its different ... sounds a bit like an apple product

Link to comment
Link to post

and yet another reason why `hjkl` sucks for arrow key replacement.

 

the only reason they exist like that is that the creator of VI was just using what the arrow keys were on his terminal. and that was in a time where there was no standard, and most configurations really sucked anyone

thinking that there was any thought behind it and or that this is better than anything other because of insert reason.  ...

 

so when they(keyboard manufacturers) actually put some time into thinking out what would work for arrangement. they realized that the most used keys were⮜ , ➤ and ⮟, so they put them next to each other in a logical way⮜ ⮟ ➤  ,and moved ⮝ to the line above. .

 

with that  ⮜ ⮟ ⮝➤  ~  hjkl, makes for the two most used keys to be under the same finger while leaving 1 finger unused .. ergo : bad layout

 

note, yes yes that is VI, the og, the rest copied it without putting any tought into the thing

Link to comment
Link to post
×