You are not logged in.

#1 2008-10-13 10:13:01

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 305

gvim for coding

I usually use Kate to code. I usually work on relatively small programming projects (around 30 .cpp and .h files) with it.

The good thing about Kate is, you can save this as sessions, so you can just launch Kate, load your session, and start working on your project without having to open the 30 files.

Kate is however completely trashed by its developers since KDE 4: the search function isn't really usable for serious programming projects anymore because you have to retype your search term in each separate file you want to search in and there's no "whole word" option anymore, it doesn't remember anymore that you don't want static word wrap, and more negative decisions they made for KDE 4.

Now someone told me that gvim is popular for programming. However he didn't really know how to open multiple files with it. I tried it and there's two menu options: open file, and open file in new tab. However, both options only allow selecting 1 file in the file dialog.

So to open the 30 files of my programming project, I'd have to press 30 times "open file in new tab" and select a file.

That's really not a good way to open a programming project smile

How can gvim be used in a way where you can load complete programming projects, with many files, and with a good overview of those files? (30 tabs isn't really a good overview, a list or tree is better)

Last edited by aardwolf (2008-10-13 10:18:36)

Offline

#2 2008-10-13 12:22:05

Lord Illidan
Member
From: Malta
Registered: 2007-10-25
Posts: 248

Re: gvim for coding

Perhaps you could use an IDE?

Offline

#3 2008-10-13 12:31:12

N30N
Member
Registered: 2007-04-08
Posts: 273

Re: gvim for coding

aardwolf wrote:

The good thing about Kate is, you can save this as sessions.

(g)vim also supports sessions.

aardwolf wrote:

How can gvim be used in a way where you can load complete programming projects, with many files

Use ":args *.cpp *.h" to open all the .cpp and .h files in the current working directory and then ":tab ball" to open the buffers in tabs. Generally I just open a couple of files and use gf (go to file) and Ctrl-] (go to symbol's definition) to jump to additional files as needed.

aardwolf wrote:

a list or tree is better

See :Explore and :Tlist (requires vim-taglist from the extra repo).

Offline

#4 2008-10-13 12:31:55

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: gvim for coding

I usually use:

arael[~]$gvim -p *.html *.js *.php *.whatelse

to open many files in tabs.

But I don't know if this is what you mean. There are also project plugins for vim but I found them not so comfortable to use.

Offline

#5 2008-10-13 12:34:48

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: gvim for coding

N30N wrote:

Use ":args *.cpp *.h" to open all the .cpp and .h files in the current working directory and then ":tab ball" to open the buffers in tabs. Generally I just open a couple of files and use gf (go to file) and Ctrl-] (go to symbol's definition) to jump to additional files as needed.

Wow!! Thank you for the tip. Didn't know about :tab ball. Very useful. wink

Offline

#6 2008-10-13 12:41:06

lman
Member
From: CZ
Registered: 2007-12-18
Posts: 255

Re: gvim for coding

Well you should try some plugins, for example: tabbar/minibufexplorer, sessions, project, NERD_tree. Some of them you can find in AUR, the others you can download from www.vim.org.

I personally use tabbar instead of tabs.

Offline

#7 2008-10-13 12:43:23

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,563

Re: gvim for coding

Maybe this will cheer you up wink

http://hamberg.no/erlend/2008/06/27/gso … ate-kpart/

And I recommend adding a KDE bug report for the problems you're having with the now-crippled find.

Good luck!

Offline

#8 2008-10-13 15:48:19

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 305

Re: gvim for coding

Lord Illidan wrote:

Perhaps you could use an IDE?

KDevelop is good for huge projects! But mine is only midsized. KDevelop is overkill for it, I don't like using it for that.

Offline

#9 2008-10-13 15:50:32

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: gvim for coding

Have you tried Geany ?
It's great and it's in the repos. Just a "pacman -Sy geany" away.

Last edited by moljac024 (2008-10-13 15:51:19)


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#10 2008-10-13 17:37:01

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: gvim for coding

Scite is also very good.

Offline

#11 2008-10-13 19:39:10

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: gvim for coding

How about Acme? You can dump your environment to a file, then load it later.

Offline

#12 2010-04-28 06:38:43

marvin
Member
From: Milk Way Galaxy
Registered: 2010-04-26
Posts: 19
Website

Re: gvim for coding

Acme is my favorite programming environment.

For people used to more 'conventional' editors it can be hard to get used to, but if you get over your prejudices it starts to grow on you, specially the mouse-chording is awesome and once you get the handle of it you will miss it in every other app. (Of course it also means that to take full advantage of acme you need a proper three button mouse, which sometimes can be hard to find.)

Offline

#13 2010-04-28 08:33:49

wiley
Member
Registered: 2009-07-04
Posts: 3

Re: gvim for coding

For using vim as a IDE I think that the following plugins are "must haves":

"NERDtree" - In my opinion the best file-explorer
"a" - A plugin for alternating between .h and it's corresponding .c or .cpp-file
"ctags" - for intellisense and much more.

With these (g)Vim is very usable even for big projects.

Offline

#14 2010-04-28 12:28:39

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: gvim for coding

Don't forget :split and :vsplit


neutral

Offline

#15 2010-04-28 12:40:20

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: gvim for coding

or ^W s and ^W v smile
:h ^W

Offline

#16 2010-04-28 15:36:01

Cyrusm
Member
From: Bozeman, MT
Registered: 2007-11-15
Posts: 1,053

Re: gvim for coding

aardwolf wrote:

Now someone told me that gvim is popular for programming. However he didn't really know how to open multiple files with it. I tried it and there's two menu options: open file, and open file in new tab. However, both options only allow selecting 1 file in the file dialog.

So to open the 30 files of my programming project, I'd have to press 30 times "open file in new tab" and select a file.

That's really not a good way to open a programming project smile

I agree with all of the advice above, and suggest you look into/practice working with buffers in vim.  It's really easy to open several files, split the window in any way that suites you, and cycle through all of the open files using :bn and other buffer commands.  in my experience (using emacs, geany, eclipse, visual studio, and others)  vim seems to be the best all around way to manage code or any text file.  of course this is just my opinion and I urge you to try something that works for what you need. there are no shortage of options out there cool


Hofstadter's Law:
           It always takes longer than you expect, even when you take into account Hofstadter's Law.

Offline

#17 2010-04-29 06:23:02

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: gvim for coding

Then again, I never liked how vim handled buffers and multiple files, but like how emacs does it.
You should try everything you could think of and see what works best for you.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

Board footer

Powered by FluxBB