Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim c++ configuration [closed]

Tags:

c++

vim

I am a newbie in vim. I want to use it as C++ IDE or something like this. I already install these plugins:

But I still cannot use them there is different errors or issues. Also I have a lot of questions how to configure vim to run/build/debug c++ code, for example with cmake, how to make it quick and professional with debug/release configuration separately. Can any sophisticated c++ vim programmers show me what do they use and with which configurations and at which point of their configuration I should pay attention?

Thanks.

I think zir archive with vim would be good to learn this stuff.

like image 724
Kron Avatar asked Nov 05 '22 06:11

Kron


1 Answers

Some of the most important IDE's features are:

  • Editing
  • Searching
  • Tags ("Goto Definition" in Visual Studio)
  • Source Control Integration
  • Building
  • Debugging

Emacs has typically tried to accomplish all of these things and more (including running a shell inside Emacs). Vi has typically been more lightweight but has gotten more functionality since the advent of Vim. I have not seriously tried to use Vim for building or debugging -- I find it difficult when I go to new projects that are using different build and debug environments.

However, there are many things that I do to integrate Vim with various IDE's and stay in Vim as much as possible.

See https://stackoverflow.com/a/8897164/1113528 for Tags, Source Control Integration, Clipboard, IDE integration (ability to jump to build errors). I also have a custom search plugin -- I think you would be better off looking for a more standard search vim plugin.

In order to switch between Visual Studio, Eclipse and Vim, I setup external spawning of Vim for Ctrl+Shift+V. To set this up, do the following:

Visual Studio

  1. Tools | External Tools | Add
  2. Title:Vim | Command:C:\Vim\vim73\gvim.exe | Arguments:--servername ext --remote-silent +$(CurLine) $(ItemPath)
  3. Move up to first position
  4. Tools | Options | Environment | Keyboard
  5. Show commands containing: Tools.ExternalCommand1
  6. Press shortcut keys: Ctrl+Shift+V
  7. Apply, OK

Eclipse

  1. Run | External Tools | External Tool Configurations
  2. Location: C:\Vim\vim73\gvim.exe
  3. Arguments: --servername ext --remote-silent ${resource_loc}
  4. Window | Preferences | General | Keys
  5. Filter Run Last
  6. Binding Ctrl+Shift+V
  7. Apply, OK
like image 184
RunHolt Avatar answered Nov 12 '22 19:11

RunHolt