tags:

views:

1246

answers:

6

Hello Stackoverflow!

I'm currently starting to learn how to use Vim, and it seems pretty cool. However, I'm kinda wondering if I should use the terminal for my editing, or gVim?

I'm running Linux (Ubuntu).

A: 

I think it's up to you to decide. gVim will be easier for new user.

Sergey Olontsev
A: 

Use whichever you're more comfortable with. The main difference, as far as I know, is that if you use 'vim' from a terminal, that terminal becomes dedicated to editing that file; if ou use 'gvim', then a gVim window opens, and the terminal is released for you to continue working with other files or tasks.

lacqui
+1  A: 

What are you editing? A few scripts and other text files? Then I don't see it matters much. What differences do you perceive when using either?

Personally I like to have a new window open to edit in, so I'd probably use gVim if that's what it does.

However if you're editing, say, a Java application then I would find an IDE that understands the language and allows easy navigation between different modules. Ecplise is available for Java..

djna
I'm editing roughly 100-500 lines of PHP code in different files, and also CSS + Html.
Sirupsen
+2  A: 

I recently switched to using MacVim (which is roughly equivalent to gVim) after more than a decade of "all terminal, all the time," and for me it did make a pretty significant difference in the work flow. Using vim in a terminal felt more... "integrated," I suppose, with the command line and file system navigation. I would pop in and out of vim to edit different files, used a lot of splits and opened new files from within vim, and I was always very aware of what directory I was editing from. Using MacVim, text editing feels much more like a distinct operation from navigating the file system. Visually, it's in a different window, and since the vi command returns immediately, if I need to change directories or edit more files, I do it all from the terminal and tend to have a half dozen vim tabs open at a time. It may not sound like a profound difference, but it's been a significant change for me, which I'm still acclimating to.

Overall, I prefer the MacVim/gVim experience. I like having the dedicated "this is where I edit text" space on my screen, and having the terminal tie in to that feels like the right amount of integration to me. On the other hand, for better or worse, you'll probably learn vim a lot faster if you don't have all the menus and such to help you out.

John Hyland
+1  A: 

In my opinion, the only advantage you would have of using vim instead of gVim is that you will still be able to use your favorite editor remotely using a non-graphical connection.

Otherwise, it may also force you to learn some keyboard shortcuts, as you won't be able to use your mouse in vim...

Wookai
+3  A: 

If you really want to get used to using vi, I would recommend that you disable or ignore the menu and mouse. IIRC, you set guioptions in gVim to disable the menu. I don't go this far usually. Just don't use it. Most of the real power of vi comes from its heavy usage of keyboard commands and using a mouse just slows you down when you are editing.

The only real difference between Vim and gVim is whether your terminal is consumed by the editor or not. If your window manager allows for quick window switching (ala Alt+Tab or Cmd+Tab), then using gVim makes sense. If you use a window manager that uses the mouse for application focus, like more conventional X11 managers, then switching windows requires the mouse so I would go with Vim in a console.

From a learning perspective:

  1. drop the menus
  2. ignore the mouse
  3. run in compatibility mode for a while
  4. spend some time learning sed (and maybe ed)
  5. expend some effort really learning regular expressions

Then again... I learned in vi over a telnet session so my opinion is a little skewed. Once you get a decent feel for things, start using multiple screens (those Ctrl-W modified movements), ctags, and really cool stuff like the zip file plugin and file system editor.

D.Shawley