顯示具有 Vim 標籤的文章。 顯示所有文章
顯示具有 Vim 標籤的文章。 顯示所有文章

2011年7月30日 星期六

(Vim) 設定 Vim 開發環境,使用 Vundle [on Windows]

0 意見
步驟1:安裝 msysgit
參考:https://github.com/gmarik/vundle/wiki/Vundle-for-Windows
記得選擇:Run git from Windows command prompt


步驟2:將 curl.cmd 放到 C:\Program Files (x86)\Git\cmd
這一步完成後,才可以使用 BundleSearch 之類的指令

步驟3:設定 Vundle

$ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

步驟4:設定 _vimrc
參考:https://github.com/gmarik/vundle/blob/master/README.md

步驟5:放入 ctags.exe
可以放到 C:\Program Files (x86)\Vim\vim73 路徑下,
也就是 GVIM.exe 的相同目錄下

---
我的 vimrc:https://github.com/bcswlmpke/hank.vim




2011年7月23日 星期六

Vi Input Manager

0 意見
下載:http://www.corsofamily.net/jcorso/vi/


Vi Input Manager
by: Jason Corso
This bundle patches the Cocoa Text System to add a Vi-like command mode. After entering command-mode (typically, by hitting escape in Vi), ordinary Vi commands can be typed and the text field will be updated accordingly. Essentially, this add Vi command functionality (albeit a small subset) to any (and all) text editors that use the Cocoa text system; e.g., Safari, TeXShop, XCode, etc. Note, however, this does not work for other programs that do not use the Cocoa system.
All the text windows, will initialize in "input" mode (standard cocoa text input). You invoke the Vi-command window (exit the input mode) by hitting ` (the back-apostrophe key, this is customizable, see installation instructions) and then key in your favorite Vi commands. For example, move down a line 'j', move right 'l', delete two lines 'd2d', and so on. You enter back into "input" mode by typing the 'i'. You get the idea. Right now, you should be thinking -- "you mean the editor in XCode will behave like Vi?" Answer: Yes.

How do iOS programmers develop applications using Vim?

0 意見
原文出處:http://www.quora.com/Vim/How-do-iOS-programmers-develop-applications-using-Vim


  
How:
  1. Install macvim,
  2. Install cocoa.vim and snipMate.vim plugins by Michael Sanders.
  3. You'll still need to use xCode for a lot of things (find definition, , use Cmd-0 to toggle back to the xCode environment.
  4. get an app for dividing your screen quickly, i use left 2/3 for xcode and right 2/3 for macvim, with a 1/3 overlap in the middle on my laptop, otherwise 1/2 and 1/2 when plugged into a monitor.
  5. use : Ctl-x Ctl-o to for auto completion options
  6. if you get no match on your autoComplete on a method call using bracket syntax then try dot syntax for the correct auto complete
  7. Cmd-0 to toggle to xCode, Cmd-Shft-R to open console and Cmd-B to build to quickly do a build and see debug output
  8. Need to look up something quickly? Cmd-0 to toggle to Xcode, Cmd-Alt-Shft-? to open up xcode documentation window
  9. C-p to show local completion options (matches within currently open buffers)
  10. set macvim to open files in a new tab in same window
  11. set folding, nocompat, incsearch, virtualedit and other options in .vimrc according to your preference.

2011年4月22日 星期五

[Visual Studio 2010] 目前我使用的 plugin

0 意見
1. VSVim
我有將 Ctrl + F, Ctrl + B 的 key mapping 讓 VSVim 控制

2. ProPowerTools
我有設定 Current Line Color (Active, Inactive)

2011年3月17日 星期四

Visual Studio 2010 + Vim

0 意見
今年過年後,我在工作方面轉換跑道,
未來主要是 Focus on iPad/iPhone programming, C#/Silverlight programming,
以前用 Vim 習慣後,
hjkl 實在是抹之不去啊~
可想而知,雖然知道 XCode, Visual Studio 等整合開發環境的方便性,
但還是忘不了 Vim 的好啊!

因此,冒出了想在 Visual Studio 2010 上面使用 Vim 的念頭~
經過 Google 之後,發現有這個想法的人很多 ^^

廢話不多說~請參考下面網址吧!
http://kkbruce.blogspot.com/2010_12_01_archive.html
http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329/
http://www.viemu.com/

2011/4/17
附註:Ctrl + Shift + F12 可以 Enable/Disable VSVim 這個功能

2010年11月2日 星期二

(Vim)modeline設定

0 意見
設定 .vimrc 時,通常我會設定 tabstop=4,
Tab 將會用四個 space 取代;
但是在寫 Makefile 時,
通常必須要使用 Tab 做為開頭,
此時,
為了使用真正的 Tab, 而不想用 space 取代,
我們可以在 Makefile 開頭使用 modeline 設定,
其實,不同格式的檔案,都可以在它們的開頭加上 modeline 設定,
Vim 會去讀取這些控制參數。

ex. 以 Makefile 為例
最上方加上 # vim: set ts=4 sw=4 noet:
記得 # 與 vim 之間要有一個空格。

這樣子在 Makefile 裡面按 Tab 就不會被 space 取代了。

enjoy!



參考網址:http://edt1023.sayya.org/vim/node10.html

2010年9月2日 星期四

在Vim中將 source code 轉換成 html

0 意見
今天 google 時突然看到在 vim 中將 source code 轉換成 html 的指令,
在指令模式下輸入 :TOhtml
然後存檔即可。

e.g.
程式檔名為 test.cpp
透過 :TOhtml 指令產生並存檔,html檔名為 test.cpp.html

而且原本在 Vim 裡面的 color scheme 以及 color 都會保存在 html 檔案內,
大家可以試看看。

2010年7月31日 星期六

gVim 7.3b lang en error

0 意見
使用的是 windows 的版本
目前解決的方式是修改 _vimrc
將 lang mes en 移到檔案的最開頭
且後面不再設定 lang en
目前修改後看起來是正常的

2010年4月14日 星期三

cscope

0 意見
find . -name "*.h" -o -name "*.c" -o -name "*.cpp" > cscope.files
cscope -bqkR

然後可以至 vim 去載入 cscope.out,
R 表示會搜尋子目錄

如果專案很大,或是涉及到 linux kernel 時,
我不曉得 cscope 處理的時間會不會很久;
同事是建議可以用 eclipse,
而且 IDE 的操作據說也很方便,
我不曉得 eclipse 遇到相同的情況是怎麼去建立索引的,
不過 trace code 時必須快速在 function 間跳來跳去,
所以一個好的工具的確是很重要。

青菜蘿蔔每個人各有喜好,
目前我的專案都還不是很大,
所以 vim + cscope + taglist 已足夠應付我大部份需求了。

2010年4月12日 星期一

0 意見
列出自己較常用的 vim plugin:

autocomplpop.vim
cscope_maps.vim
minubufexpl.vim
NERD_tree.vim
taglist.vim

2010.11.1 補充
在Ubuntu,先安裝 exuberant-ctags,搭配 taglist 使用