Navigation in vi

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Navigation in vi

Ven Tadipatri
After some difficulties I had with my c++ IDE I decided to switch to
using vi. I have a lot to learn, but already I'm really impressed by
the possibilities of navigation. It offers so much more than the
standard arrow keys and page up/page down/home/end keys in a standard
IDE:
- you can mark a point in the code and go to it
- ctrl I and O allow you to navigate back and forth
- / and f allow you to find
- w and b move you back and forth across words and with numbers you
can navigate across multiple words
- you can fold parts of the code and navigate across the folds
- it's integrated fully with the shell itself, so you can open up a
new window with ctrl+w, and execute whatever commands you want.
-I'm sure there's lots more, this is just from a first glance what
struck me as far superior to navigation I see in most editors.

There are still difficulties I'm trying to get over, like navigating
across multiple files and autocompletion, but I think I'm definitely
on the right track in switching to vi from an IDE like Eclipse or
Netbeans.
   Eclipse works well for java, but when I tried using it for C++, I
got so frustrated with it, despite the fancy graphical interface, I
wanted an editor with good code navigation. In fact, oddly enough, the
fact that most IDE's have a graphical interfaces actually causes more
problems. Whereas in VI, a few keystrokes can get you to where you
want (granted there's a learning curve), in an IDE, there's a dialog
that pops up, you're restricted to the buttons and textboxes they give
you, plus there's the extra GUI load time. And it's the customization
feature of vi that makes it really powerful. You can make the
shortcuts you want, and it's all self-contained within a single
.vimrc. There's no digging through Eclipse plugin configuration files.
   If anyone can point me to good tutorials for using VIM as an
effective IDE (for C++ specifically), I would greatly appreciate it.
There's so many subtle things about VIM I really don't know where to
go to learn more about using it effectively.

Thanks,
Ven

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Navigation in vi -> vim for programmers

Sven Guckes-3
* Ven Tadipatri <[hidden email]> [2010-09-08 17:03]:
> If anyone can point me to good tutorials for using
> VIM as an effective IDE (for C++ specifically),
> I would greatly appreciate it.

  http://www.guckes.net/vim_for_programmers.en.txt

it's just an overview to the commands you might need.
everything else is explained with ":help command".
happy reading!

Sven

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Navigation in vi -> vim for programmers

Yang Zhou-2
Hi Sven,
 
Unfortunately, I can't open the link.

On Wed, Sep 8, 2010 at 11:21 PM, Sven Guckes <[hidden email]> wrote:
* Ven Tadipatri <[hidden email]> [2010-09-08 17:03]:
> If anyone can point me to good tutorials for using
> VIM as an effective IDE (for C++ specifically),
> I would greatly appreciate it.

 http://www.guckes.net/vim_for_programmers.en.txt

it's just an overview to the commands you might need.
everything else is explained with ":help command".
happy reading!

Sven

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



--
Best regards,
Yang Zhou
------------------------------------------------------------------
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Navigation in vi -> vim for programmers

Sven Guckes-3
* Yang Zhou <[hidden email]> [2010-09-09 03:46]:
> On Wed, Sep 8, 2010 at 11:21 PM, Sven Guckes <[hidden email]> wrote:
> >  http://www.guckes.net/vim_for_programmers.en.txt
> > it's just an overview to the commands you might need.
> > everything else is explained with ":help command".
> Unfortunately, I can't open the link.

oops.. forgot the directory name.  here is the link again:
http://www.guckes.net/talks/vim_for_programmers.en.txt

Sven

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Navigation in vi

Vivek Bhat
In reply to this post by Ven Tadipatri
On Wednesday, September 08, 2010 08:26:33 pm Ven Tadipatri wrote:

> After some difficulties I had with my c++ IDE I decided to switch to
> using vi. I have a lot to learn, but already I'm really impressed by
> the possibilities of navigation. It offers so much more than the
> standard arrow keys and page up/page down/home/end keys in a standard
> IDE:
> - you can mark a point in the code and go to it
> - ctrl I and O allow you to navigate back and forth
> - / and f allow you to find
> - w and b move you back and forth across words and with numbers you
> can navigate across multiple words
> - you can fold parts of the code and navigate across the folds
> - it's integrated fully with the shell itself, so you can open up a
> new window with ctrl+w, and execute whatever commands you want.
> -I'm sure there's lots more, this is just from a first glance what
> struck me as far superior to navigation I see in most editors.
>
> There are still difficulties I'm trying to get over, like navigating
> across multiple files and autocompletion, but I think I'm definitely
> on the right track in switching to vi from an IDE like Eclipse or
> Netbeans.
>    Eclipse works well for java, but when I tried using it for C++, I
> got so frustrated with it, despite the fancy graphical interface, I
> wanted an editor with good code navigation. In fact, oddly enough, the
> fact that most IDE's have a graphical interfaces actually causes more
> problems. Whereas in VI, a few keystrokes can get you to where you
> want (granted there's a learning curve), in an IDE, there's a dialog
> that pops up, you're restricted to the buttons and textboxes they give
> you, plus there's the extra GUI load time. And it's the customization
> feature of vi that makes it really powerful. You can make the
> shortcuts you want, and it's all self-contained within a single
> .vimrc. There's no digging through Eclipse plugin configuration files.
>    If anyone can point me to good tutorials for using VIM as an
> effective IDE (for C++ specifically), I would greatly appreciate it.
> There's so many subtle things about VIM I really don't know where to
> go to learn more about using it effectively.
>
> Thanks,
> Ven
Check this plugin for C++ http://www.vim.org/scripts/script.php?script_id=213.
Here is VIM wiki for code completion in C++
http://vim.wikia.com/wiki/C%2B%2B_code_completion. If using Linux with KDE,
you can also try kdevelop editor. Check Vim Wiki for lots of trips and tricks
http://vim.runpaint.org/ and I found this website really very good for
learning Vim http://vim.runpaint.org/

For navigating across multiple files you can either use "buffers" or firefox
like tabs. For using tabs like you do in firefox put this in .vimrc (Linux) or
_vimrc (windows):

nmap <C-tab> :tabnext<CR>
nmap <C-S-tab> :tabprevious<CR>
map <C-S-tab> :tabprevious<CR>
map <C-tab> :tabnext<CR>
imap <C-S-tab> <Esc>:tabprevious<CR>i
imap <C-tab> <Esc>:tabnext<CR>i
nmap <C-t> :tabnew<CR>
imap <C-t> <Esc>:tabnew<CR>


Thanks
Vivek Bhat

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Navigation in vi

Alessandro Antonello
> Check this plugin for C++ http://www.vim.org/scripts/script.php?script_id=213.
> Here is VIM wiki for code completion in C++
> http://vim.wikia.com/wiki/C%2B%2B_code_completion. If using Linux with KDE,
> you can also try kdevelop editor. Check Vim Wiki for lots of trips and tricks
> http://vim.runpaint.org/ and I found this website really very good for
> learning Vim http://vim.runpaint.org/
>

May I add some personal thoughts?

The clean visual of VIM/GVIM is very good but, in the beginning, I missed the
functionality of a well organized "Project Explorer" like I had with
UltraEdit32. To accomplish that I started using Project plugin:
"http://www.vim.org/scripts/script.php?script_id=69"
With this plugin I can also configure other plugins as the project needs.
Deferents projects with diferents tags files and configurations can be done
using plain VIM scripts loaded as needed.

Also I don't like much the implementation of TABs in VIM. The perspective of
buffers in VIM is much more similar to a MDI interface on Windows
which I find most
useful so, I also use MiniBufExplorer:
"http://www.vim.org/scripts/script.php?script_id=159"
With it I can organize the loaded buffers as of "tabs" in my environment and
still see the project explore and the splited windows where I am working on.

This makes to me a really powerful IDE for programming.

--
Alessandro Antonello

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Navigation in vi

Benjamin Fritz


On Sep 9, 12:36 am, Alessandro Antonello <[hidden email]>
wrote:
>
> Also I don't like much the implementation of TABs in VIM. The perspective of
> buffers in VIM is much more similar to a MDI interface on Windows
> which I find most
> useful so, I also use MiniBufExplorer:
> "http://www.vim.org/scripts/script.php?script_id=159"
> With it I can organize the loaded buffers as of "tabs" in my environment and
> still see the project explore and the splited windows where I am working on.
>

I'm glad you found a solution, but to me, the "tabs as workspaces"
idea that Vim has instead of the "1 tab per file" of most editors is
very useful. Though "tab" is probably a bad name for them...

I'd suggest:

http://vim.wikia.com/wiki/Special:Search?search=IDE&go=1
http://vim.wikia.com/wiki/All_the_right_moves
http://vim.wikia.com/wiki/Category:Getting_started
http://vim.wikia.com/wiki/Category:Tabs

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php