How to setup <tab> in gvim?

Mac OS X 平台上程式設計的相關問題討論

版主: bryanchangdigdog謝孟叡

回覆文章
內容
發表人
頭像
luisehsu
留言破百
文章: 147
註冊時間: 07/04/2001 1:01 am
來自: Nowhere to Nowhere
聯繫:

How to setup <tab> in gvim?

#1 文章 luisehsu »

sorry, this question might not be really relative to os x but unix:
1. in bbedit i edit a line like:
<tab><tab><tab>this is a test
when i move the cursor, the location of cursor would jump to each <tab>'s position
2. in gvim i edit the same line:
<tab><tab><tab>this is another test
save it, and open in bbedit. it seems <tab> is replaced by spaces, and cursor is moved space by space but not by <tab>
3. however, if i open the file edited by bbedit in gvim, the <tab> shows the correct behavior
4. in my .vimrc i setup
set ts=4 "tabstop"
set sw=4 "shiftwidth"
that's all
5. how do i setup the <tab> in gvim so the <tab> is not replaced by space
6. hope my description is clear enough to be understood :lol:

thanks
Fortune favors the bold.
- Virgil (70 BC - 19 BC)
頭像
luisehsu
留言破百
文章: 147
註冊時間: 07/04/2001 1:01 am
來自: Nowhere to Nowhere
聯繫:

Re: How to setup <tab> in gvim?

#2 文章 luisehsu »

自問自答:
set noet
其實我並不是很懂expand tab 與 suppress tab 之間的不同
有人能解釋一下嗎?

好像版上的人用emacs比較多 :D
Fortune favors the bold.
- Virgil (70 BC - 19 BC)
頭像
digdog
討論區管理員
文章: 1297
註冊時間: 05/02/2001 1:01 am
聯繫:

#3 文章 digdog »

expand tab 是把 tab expands 成 blanks

代碼: 選擇全部

expand -4 tabfile > blankfile
suppress tab 應該就是相反吧?
回覆文章