Jump to content
Cybes

"Your problem with vim is that you don't grok vi."

Recommended Posts

This one is probably useful to both this and the Programming forum (since they're both primarily programmer's editors), but unix has these editors as stock, whereas any other platform has to download them 'special-like.

 

 

 

http://stackoverflow.com/questions/1218390...1220118#1220118

 

^Possibly the most useful answer I have ever seen, and also the most in-depth. If you've ever wondered how the heck vi/vim ever got to be considered a great editor when a 'simple' c&p operation can appear so convoluted, you need to read this.

 

Hell, even accomplished vi users need to read this. :P

Share this post


Link to post
Share on other sites

This one is probably useful to both this and the Programming forum (since they're both primarily programmer's editors), but unix has these editors as stock, whereas any other platform has to download them 'special-like.

 

 

 

http://stackoverflow.com/questions/1218390...1220118#1220118

 

^Possibly the most useful answer I have ever seen, and also the most in-depth. If you've ever wondered how the heck vi/vim ever got to be considered a great editor when a 'simple' c&p operation can appear so convoluted, you need to read this.

 

Hell, even accomplished vi users need to read this. :P

I just built the latest GNU Emacs from source, and that is better than that convoluted POS. Whoever thought that would be a good idea to have such complex commands, when you could use the menus in something like Emacs. I know you can build a GTK gvim, but I like Emacs better.

 

At least vim is easier than the vanilla vi... My brain was melting reading that.

Share this post


Link to post
Share on other sites

At least vim is easier than the vanilla vi... My brain was melting reading that.

Cue vi vs Emacs war.

 

If you seriously think Emacs is any less arcane than vi to newcomers, you've forgotten what it was like to be a newcommer. Editors have to be the most contentious issue in IT. The flamewars in that debate are legendary - rivalling even godbotherers vs atheists.

 

My point was that the legend was earned, not awarded capriciously, and that these monolithic editors are far more capable than you might realise - you just need to look a little further than the surface.

Share this post


Link to post
Share on other sites

I struggled with vi when I started, but since I went to vim it's not an issue.

 

I tried nano and emacs but they are hard to get used to when using vi/m only.

So yeah, no matter what editor you are using it's hard to start out.

Share this post


Link to post
Share on other sites

Nice pic midnighter. Oh yeah, I meant to say....

 

vi has got me out of trouble sooooo many times when all I needed to do was comment out a line and add a new one in a graphic-less shell.

 

But I've never used vi to write a program (or emacs ever).

 

My 2cents.

 

Regards Glenn

 

Na! that doc is way too complex for what I use vi for. :)

Edited by GlennsPref

Share this post


Link to post
Share on other sites

gVim gets the work done here to be honest... I might only use about 5% of its capabilities, but I find it to be the most suitable for my needs.

 

Yes, I could probably do it with vi... but vim is a little frendlier... and gVim means I don't have to know all the commands, there is a means of accessing the features without knowing the commands. If I desire the command interface though; it's there, and I can explore it at my leisure.

 

For the record, back in the day I was an emacs user too. ;-) Jumped ship when I installed SuSE 5.3 on my 386, and only had room for vim -- I did the vimtutor, and never looked back.

Share this post


Link to post
Share on other sites

^Possibly the most useful answer I have ever seen, and also the most in-depth. If you've ever wondered how the heck vi/vim ever got to be considered a great editor when a 'simple' c&p operation can appear so convoluted, you need to read this.

This comment shows (or part of it) one of the long term problems with the programing world, think about it, to this day a lot of programs are still written in C/C++ when the language itself has no support for any sort of multi-threading (the fork command comes from POSIX, industry standard yes but not mandatory) despite the desperate need for better multi-threading commands due to the rise of multi-core CPU's

Share this post


Link to post
Share on other sites

Multithreadded apps can be written in theoretically any language.

 

Multithreadding merely means the machine code runs with a separate stack, but shares its heap with other threads. How the machine code is generated is not of the concirn of the kernel.

 

Fork is different, in that the heap is copied as well, and so the process is a mostly separate instance.

 

On userland applications, libpthread is one means of achieving multithreadding. It's targetted at C, but you could also do those calls from asm, or higher level languages if you wish with the right bindings. Not sure what the Winblows equivalent is, but I know there is one.

 

I do some multithreadded programming at work... using the FreeRTOS kernel. Again, C does fine for this job.

 

You are right in saying that C was written from the mindset of a single thread, but that does not mean you cannot achieve multithreadding with C.

Share this post


Link to post
Share on other sites

On userland applications, libpthread is one means of achieving multithreadding. It's targetted at C, but you could also do those calls from asm, or higher level languages if you wish with the right bindings. Not sure what the Winblows equivalent is, but I know there is one.

You basically get all threading calls when you include windows.h. Actual methods are in system32.dll or user32.dll can't remember off the top of my head. Windows has some differences but on the whole is pretty much the same as posix/pthreads.

Share this post


Link to post
Share on other sites

Not sure what the Winblows equivalent is, but I know there is one.

The threading API is in kernel32.dll

 

But .NET means you don't have to fart around with that:

 

ThreadStart threadDelegate = new ThreadStart(Class.Sub);
Thread newThread = new Thread(threadDelegate);
newThread.Start();

Share this post


Link to post
Share on other sites

Well one good thing with vim is you can type `vim example.c +456` to edit line 456 and it will open the file right there. That is one very good feature that I think Emacs lacks. And it is the most useful feature of vim.

Share this post


Link to post
Share on other sites

Well one good thing with vim is you can type `vim example.c +456` to edit line 456 and it will open the file right there. That is one very good feature that I think Emacs lacks. And it is the most useful feature of vim.

Wasn't aware of that one... I usually just run vim example.c then type :456 to jump to that line.

 

Learn something new every day. :-)

Share this post


Link to post
Share on other sites

gVim gets the work done here to be honest... I might only use about 5% of its capabilities, but I find it to be the most suitable for my needs.

 

Yes, I could probably do it with vi... but vim is a little frendlier... and gVim means I don't have to know all the commands, there is a means of accessing the features without knowing the commands. If I desire the command interface though; it's there, and I can explore it at my leisure.

 

For the record, back in the day I was an emacs user too. ;-) Jumped ship when I installed SuSE 5.3 on my 386, and only had room for vim -- I did the vimtutor, and never looked back.

I'm gonna have to take a look at gVim. That sounds perfect for me. The rest of your reply (minus the "emacs user" bit) sounds just like me.

 

I used to use vi for black and white and vim for color (syntax) depending on whether I wanted to read a text file or write a script. I'm too lazy to put in a command option if I can have a separate version of the program with it's own customized rc file. Three simultanious versions of vi is even better than two.

 

I do the vimtutor about once every other month or so just to freshen up on the basics ... but I'm a bit afraid to go in-depth with it because I'll likely just end up forgetting all of the fancier commands by lack of common usage. The one thing that I adore about vi is the fact that I can touch-up any file with it without it making changes to the whole file (Microsoft "editor" and "notepad" don't allow me to touch-up compiled files). I can use it to super-cheat at video games. And that's just awesome.

 

One thing that I've noticed after switching from Fedora Core to Mandriva is my vim behaves a bit differently. In Fedora, vim would let me use the arrow keys in insert mode to move around freely while adding and deleting text. In Mandriva, I have to use the JKL: keys to move around; so I have to ESC out of insert mode to move my cursor. The touch-up commands (such as replace and yank) have become more necessary than they used to be.

Share this post


Link to post
Share on other sites

One thing that I've noticed after switching from Fedora Core to Mandriva is my vim behaves a bit differently. In Fedora, vim would let me use the arrow keys in insert mode to move around freely while adding and deleting text. In Mandriva, I have to use the JKL: keys to move around; so I have to ESC out of insert mode to move my cursor. The touch-up commands (such as replace and yank) have become more necessary than they used to be.

Sounds like something is broken in Mandriva... cursor keys work on both Win32 and in Gentoo/MIPS for me.

Share this post


Link to post
Share on other sites

One thing that I've noticed after switching from Fedora Core to Mandriva is my vim behaves a bit differently. In Fedora, vim would let me use the arrow keys in insert mode to move around freely while adding and deleting text. In Mandriva, I have to use the JKL: keys to move around; so I have to ESC out of insert mode to move my cursor. The touch-up commands (such as replace and yank) have become more necessary than they used to be.

Sounds like something is broken in Mandriva... cursor keys work on both Win32 and in Gentoo/MIPS for me.

 

Sounds possible. The cursor keys do work in vim (same as JKL:); they just don't work in insert mode. In insert mode, it inserts a line above the current line with a single character in the new line (A for up, B for down, C for right, and D for left). So I've gone back to using JKL: for my cursor keys rather than the arrow keys just to keep my mistakes easy to clean up (it's also easier to reach on the keyboard).

Share this post


Link to post
Share on other sites

I'm running Mandriva and have no such problems with insert mode and vi, wlayton27. Don't know why....

 

<edit>

maybe, I have vi as the default keys in zsh, but maybe, I always type vi. Not vim.

</edit>

Edited by GlennsPref

Share this post


Link to post
Share on other sites

nano ftw

+1

 

:D

 

that, or use scite on my windows box and then paste the text into nano using an ssh shell connection.

:D

Edited by clockworkman

Share this post


Link to post
Share on other sites

nano ftw

that, or use scite on my windows box and then paste the text into nano using an ssh shell connection.

:D

 

Now that's cheating. :-P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×