尤川豪   ·  2年前
445 貼文  ·  275 留言

第一次碰 Vim

電腦送修 拿 mac 來擋著用,順便學習 vim

How to open a project?

cd to the repo and just type vim

How to open new file in the project?

:find THE_FILE_PATH

and the tab button is working here!

How to auto-complete the rest code?

Ctrl + N
Ctrl + P

but this only works for the opened tabs.

how to make it work for the entire project?

and how to make it work in real-time?

How to open file in new tab?

:tabnew THE_FILE_PATH

switch between the tabs

gt (next)
gT (previous)
{n}gt (to nth tab)

How to enable syntax highlighting?

syntax on 

https://www.quora.com/Is-there-a-way-to-enable-syntax-highlighting-for-PHP-in-vi

預設已經支援很多語言,開啟一個設定即可

  分享   共 960 次點閱
按了喜歡:
共有 2 則留言
Kevin Hou   ·  2年前
4 貼文  ·  20 留言

我現在都用 phpstorm + vim 外掛
又能享受 vim 編輯的方便 又有人幫我管理設定
不然 .vimrc 都已經寫ㄔㄠ了快 200 行 還是覺得不太順手
至於 VSCode + vim 雖然又輕便又好用 但 vim 模式太常被其他熱鍵破壞掉
還要先解除再恢復 游標行為才能回歸正常

 
按了喜歡:
Kevin Hou   ·  2年前
4 貼文  ·  20 留言

還有 裝這個應該能夠大幅加速上手時間
而且可以讓日常各種動作更加流暢:
https://github.com/philc/vimium

 
按了喜歡:
您的留言
尤川豪
445 貼文  ·  275 留言

Devs.tw 是讓工程師寫筆記、網誌的平台。隨手紀錄、寫作,方便日後搜尋!

歡迎您一起加入寫作與分享的行列!

查看所有文章