Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux gvim vs vim [closed]

Tags:

linux

vim

vi

editor

is there a difference between gvim and vim on a linux machine ?

I installed an enhanced version of VIM editor which includes recent enhancements:

vim-enhanced-2:7.2.411-1.8.el6(x86_64)

And after installation, I could see .viminfo and .vimrc in my home directory. I even made changes on .vimrc and intentionally put some wrong codes in there and it errored out. So, I know for sure that it is calling .vimrc upon invoking vim. I also had a .vimrc from past for GVIM, and I copied that file into this new .vimrc, and again there is no complain.

So far so good.

But now, when I open VIM, it opens the file in the terminal! And it is not opening a new window for GVIM. But I can see that it has almost all of GVIM capabilities!

How could I make this open in a separate window when I open a file?

like image 482
Rudy01 Avatar asked Mar 19 '14 20:03

Rudy01


People also ask

Is Gvim better than Vim?

Functionally there is no difference between VIM and GVIM. They both work the same and have same keyboard sequences. VIM does not need a Graphical User Interface (GUI) and uses terminal shell environment to provide text editing features.

Is Gvim same as Vim?

Both GVim and Vim are the same, the difference is that Gvim offers an interface that doesn't run in a terminal window. Basically, Gvim has GUI-like menus and toolbar. Here are quotes from Quora that provide more information: VIM is designed for using the keyboard efficiently and not for using the mouse.

How do I close all instances in Vim?

Yes - "killall vim".

What is the difference between Gvim and Gvim easy?

Gvim-easy is just the same as Gvim except for the fact that it does additional initialization listed in help (see @Tim quote): sources one script.


2 Answers

if you are asking the difference between vim and gvim... there are some (personal opinions):

color support

vim runs in terminal, if you set up your terminal correctly, vim supports 256 (or 88) colors. however gvim can support from 000000 - FFFFFF colors.

difficulty of some key mappings

again, depending on the terminal you used. some key mapping may be difficult to achieve. E.g. I wanted to map insert mode alt-i/j/k/l in my vim, I tried a lot, unfortunately, so far it doesn't work for me. But in gvim it is much easier.

gvim is easier to be started by other GUI applications

(plugins may needed) like browser or other IDEs

Gvim needs X

You can start vim as long as you can get a terminal. even tty or pts. But with Gvim you have to have GUI installed.

with vim you can get benefit from ctrl-Z

if you want to test your codes in shell/terminal, or execute some shell commands during your editing. In vim you can just ctrl-z to back to terminal do what you want, and fg back to vim. With Gvim, you cannot do that.

it is great work with vim in tmux/screen

When you are in gvim, you have that single window, switching to other program/application is not as easy (read comfortable) as vim in tmux/screen.

There may be more, but at this point I just think of those. Personally 90% time I use vim.

like image 111
Kent Avatar answered Oct 03 '22 20:10

Kent


On some systems, gvim is just vim -g: you can edit a file in a GVim window from your shell with $ vim -g filename or simply $ gvim filename.

On other systems, like RedHat IIRC, vim and gvim are two different executables built at the same time with the same features: you can edit a file in a GVim window from your shell with $ gvim filename.

Either way, you should try to get your hands on a more recent build because 7.2.411 is almost exactly four years old and quite a lot happened in the mean time.

like image 28
romainl Avatar answered Oct 03 '22 20:10

romainl