How to successfully use VIM as an external editor for Code :: Blocks?

I really like Code :: Blocks for its build system and debugging capabilities - that is, I really like to use wrappers for gcc / gdb more than using them from Makefiles or the command line. The problem is that I am so damaged by the brain (or damaged, some may say) over the years of using VIM that I cannot edit in a standard Windows text editor.

So, I install Code :: Blocks to use VIM as a .cpp / .c / * file handler. h and together with the VIM parameters --server-name and --remote-tab, you can right-click the files in my C :: B project window and select to open them using the file extension handler and they appear as new tabs in one VIM window - then I return to C :: B, press F9 to build and run, etc.

I would like to improve my workflow, so the question is twice:

  • Can I make C :: B open VIM by default when I double-click a file in the project file list instead of right-clicking → open with the file extension handler?

  • Can I make a binding in VIM that would allow me to click a button and have Code :: Blocks build / run / debug my project?

WRT 2, I know that C :: B has command line options for rebuilding the project, but it's not the same as opening a C :: B window and seeing compilation / view log windows. I also note that C :: B has a very simple DDE interface - can I use VIM to send DDE commands? Perhaps there is a simple SendKeys plugin that I have not found so that I can hack work?

Alternatively, is there an easy and minimal IDE such as C :: B, which makes using an external editor very easy? I'm not ready to run Eclipse, and using Microsoft compilers in Visual Studio makes me a gag.

Any help was appreciated.

Thanks Johan

+7
c ++ vim ide codeblocks
source share
1 answer
  • After digging, I must conclude that the answer is no. The Open option is intended to be opened only inside C :: B.
  • Vim supports the creation of projects using built-in commands. If you have C :: B generating your Makefile (as it should be - I never got it the way I wanted), then make sure the Vim working directory ( :cd ), then you can simply type :make and Vim, by default, will call make in the current directory. You can :set makeprg run any script it needs, including running any configure scripts. I also added this to my .vimrc :

     :map <F8> :make<CR> :imap <F8> <Esc>:make<CR>a :vmap <F8> <Esc>:make<CR>a 

    This works well for my purposes, because :make also puts error checking and warning messages from the GCC output into the window. :cn moved to a file containing the following error.

+3
source share

All Articles