前言
Vim 是一款相當給力的源自UNIX平臺的命令行文本編輯器,不過不給力的是,Mac OS X下并沒有諸多Linux發行版上VIM那些牛逼哄哄的神馬代碼高亮顯示啊,自動縮進之類的。
(譯者注:通常Linux發行版可以通過編輯/etc/vimrc文件更改全局VIM設定或者針對某個用戶的~/.vimrc進行個性化配置)
為了彌補這個缺憾,請按如下方法操作:
實現方法
主要是修改~/.vimrc
文件
文件內容如下:
set ai " auto indentingset history=100 " keep 100 lines of historyset ruler " show the cursor positionsyntax on " syntax highlightingset hlsearch " highlight the last searched termfiletype plugin on " use the file type plugins" When editing a file, always jump to the last cursor positionautocmd BufReadPost */ if ! exists("g:leave_my_cursor_position_alone") |/ if line("'/"") > 0 && line ("'/"") <= line("$") |/ exe "normal g'/"" |/ endif |/ endif
保存退出即可。
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家學習或者操作vim能有所幫助,如果有疑問大家可以留言交流。謝謝大家對VEVB武林網的支持。
新聞熱點
疑難解答
圖片精選