Sunday, March 29, 2009

vi

vi in an ancient text editor present on Unix-like operating systems, known for its two modes: a normal mode where letters and numbers mean commands such as move one word to the left, delete 3 lines et cetera, and an insert mode where chars are inserted into the text. Normal chars can also be deleted with backspace, but somehow \n (newline) can't. If you accidentally press q in the middle of the line, you can press Backspace and undo that. If you accidentally press Enter in the middle of the line, or for some reason you want to join two lines, you hit Esc to exit insert mode, then Shift-j to Join the lines, then i to enter insert mode again. That's wonderful ain't it? Now, on large computers people can use whatever editor they want if they hate vi. But on small embedded systems such as home routers and set-top boxes, vi seems to be preferred (due to its inclusion in the BusyBox userland, which is probably due to it being part of the UNIX standard), and even though there are ways to install other software, it takes time which I may not want to waste. Therefore - fuck vi, vi sucks.

6 comments:

Michael said...

My boss uses VI. For some unknown reason, it is the best XML editor I've seen because of the way it uses colors to highlight each different piece of text. It's like the dude that created the XML editor module read my mind and figured out how to make it look perfect. This is why I hate it. It's crap. It has this beautiful interface (and I'm way too lazy to replicate it in Notepad++) but it also has all those crazy shortcuts that make it useless.

Andrei said...

I use vim(Vi IMproved) for most of my coding. It is a pretty efficient editor, and if you properly configure your .vimrc you can do wonders with it. I also consider gvim the only usable solution for programming if I'm on a windows operating system.

Vlad Dogaru said...

If you were dealing with Vim, I think the 'backspace' option might have helped. Also, the manual suggests :fixdel as a possible solution to Backspace and Delete going nuts.

Out of curiosity: are you an emacs person, or just plain angry at vi?

razvan784 said...

I know vim is better, I'm not disputing that. You don't have vim on embedded systems, you just have a basic vi. That sucks. I'm not an emacs person.

Andrei said...

Guess that's why they improved it. Why can't you have vim on embedded systems, what are the limitations that vi passes and vim doesn't, memory, space?

razvan784 said...

There are space limitations (a typical example would be 8 MB of Flash and 32 MB RAM), but you could install it. You can cross-compile it for a mips/arm/whatever processor and a certain libc and copy it to the device. That's not the point. I'm not going to cross-compile a text editor just to edit a few lines in a shell script. It's much quicker to just Esc J etcetera. But it sucks.