User forums > General (but related to Code::Blocks)

Vim plugin?

<< < (2/4) > >>

ayheos:
 :) Recently, I do some jobs to make codeblocks internal editor works like vim.
 
Try it, any feedback is welcome.

https://code.google.com/p/cbvike/

Thanks to codeblocks group.

ollydbg:

--- Quote from: ayheos on January 06, 2012, 12:36:49 pm --- :) Recently, I do some jobs to make codeblocks internal editor works like vim.
 
Try it, any feedback is welcome.

https://code.google.com/p/cbvike/

Thanks to codeblocks group.

--- End quote ---
I just build and test this plugin, at least it can switch between vim's normal mode and insert mode, and then I can move caret around by "h,j,k,l" key. I'm just a vim beginner, so I think this plugin is useful, at least it can move caret without the help of mouse. ;)

arthurzmj:

--- Quote from: ayheos on January 06, 2012, 12:36:49 pm --- :) Recently, I do some jobs to make codeblocks internal editor works like vim.
 
Try it, any feedback is welcome.

https://code.google.com/p/cbvike/

Thanks to codeblocks group.

--- End quote ---

I've made some improvement of this code.
https://github.com/zmj64351508/cbvike
Thanks to ayheos

scarphin:

--- Quote from: ollydbg on September 21, 2013, 08:26:17 am ---
--- Quote from: ayheos on January 06, 2012, 12:36:49 pm --- :) Recently, I do some jobs to make codeblocks internal editor works like vim.
 
Try it, any feedback is welcome.

https://code.google.com/p/cbvike/

Thanks to codeblocks group.

--- End quote ---
I just build and test this plugin, at least it can switch between vim's normal mode and insert mode, and then I can move caret around by "h,j,k,l" key. I'm just a vim beginner, so I think this plugin is useful, at least it can move caret without the help of mouse. ;)

--- End quote ---

If you want to move caret without the mouse or arrow keys (which are not practical while typing), you can use autohotkey software to define macros for key combinations, for example I use Right Alt+E,S,D,F to move the caret in corresponding directions.
http://www.autohotkey.com/

ollydbg:

--- Quote from: arthurzmj on October 07, 2013, 04:59:51 pm ---
--- Quote from: ayheos on January 06, 2012, 12:36:49 pm --- :) Recently, I do some jobs to make codeblocks internal editor works like vim.
 
Try it, any feedback is welcome.

https://code.google.com/p/cbvike/

Thanks to codeblocks group.

--- End quote ---

I've made some improvement of this code.
https://github.com/zmj64351508/cbvike
Thanks to ayheos

--- End quote ---
I suggest not using absolute paths in cbp, instead, you can try my patch:

--- Code: --- vike.cbp | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/vike.cbp b/vike.cbp
index a4e498d..868fd11 100644
--- a/vike.cbp
+++ b/vike.cbp
@@ -7,12 +7,13 @@
  <Option compiler="gcc" />
  <Build>
  <Target title="default">
- <Option output="..\..\..\devel\share\CodeBlocks\plugins\vike.dll" prefix_auto="0" extension_auto="0" />
- <Option object_output="..\..\..\.objs\plugins\contrib\vike" />
+ <Option output="$(#cb_sdk)/devel/share/CodeBlocks/plugins/vike.dll" prefix_auto="0" extension_auto="0" />
+ <Option object_output="$(#cb_sdk)/.objs/plugins/contrib/vike" />
  <Option type="3" />
  <Option compiler="gcc" />
- <Option parameters="--debug-log -na -ns -nd" />
- <Option host_application="..\..\..\devel\codeblocks.exe" />
+ <Option parameters="--debug-log -na -ns -nd -p debug" />
+ <Option host_application="$(#cb_sdk)/devel/codeblocks.exe" />
+ <Option run_host_application_in_terminal="0" />
  <Compiler>
  <Add option="-Winvalid-pch" />
  <Add option="-pipe" />
@@ -33,8 +34,8 @@
  </Linker>
  </Target>
  <Environment>
- <Variable name="WX_SUFFIX" value="u" />
  <Variable name="WX_CFG" value="" />
+ <Variable name="WX_SUFFIX" value="u" />
  </Environment>
  </Build>
  <VirtualTargets>
@@ -43,23 +44,22 @@
  <Compiler>
  <Add option="-Wall" />
  <Add option="-g" />
- <Add directory="..\..\..\include" />
- <Add directory="..\..\..\sdk\wxscintilla\include" />
+ <Add directory="$(#cb_sdk)/include" />
+ <Add directory="$(#cb_sdk)/sdk/wxscintilla/include" />
  <Add directory="$(#WX.include)" />
- <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)" />
- <Add directory="$(#WX)\contrib\include" />
+ <Add directory="$(#WX.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
+ <Add directory="$(#WX)/contrib/include" />
  </Compiler>
  <Linker>
  <Add library="codeblocks" />
  <Add library="wxmsw28$(WX_SUFFIX)" />
- <Add library="wxscintilla" />
- <Add directory="D:\Prog\CodeBlocks_bak" />
- <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)" />
- <Add directory="..\..\..\devel" />
+ <Add library="wxscintilla_cb" />
+ <Add directory="$(#WX.lib)/gcc_dll$(WX_CFG)" />
+ <Add directory="$(#cb_sdk)/devel" />
  </Linker>
  <ExtraCommands>
- <Add after="zip -j9 ..\..\..\devel\share\CodeBlocks\vike.zip manifest.xml" />
- <Add after="zip -j9 vike.cbplugin ..\..\..\devel\share\CodeBlocks\plugins\vike.dll ..\..\..\devel\share\CodeBlocks\vike.zip" />
+ <Add after="zip -j9 $(#cb_sdk)\devel\share\CodeBlocks\vike.zip manifest.xml" />
+ <Add after="zip -j9 vike.cbplugin $(#cb_sdk)\devel\share\CodeBlocks\plugins\vike.dll $(#cb_sdk)\devel\share\CodeBlocks\vike.zip" />
  <Mode after="always" />
  </ExtraCommands>
  <Unit filename="cbvike.cpp" />


--- End code ---

Note: you can define cb_sdk in C::B's settings->global variables to the root folder of C::B source.

BTW: I have contacted ayheos weeks ago, he said his cbvilike development freezes currently.

@scarphin: thanks, I finally think mouse is still necessary when editing under C::B.  ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version