記錄一下在 goland 使用 vim plugin 的資料,plugin IdeaVim
Reference
- Emulate Vim in IntelliJ IDEA | IntelliJ IDEA
- JetBrains/ideavim: Vim emulation plugin for IDEs based on the IntelliJ Platform - Vim emulation plugin for IDEs based on the IntelliJ Platform
記錄一下在 goland 使用 vim plugin 的資料,plugin IdeaVim
最近開始嘗試寫 GoLand,寫的過程中,發現沒有一個好用的 IDE,在寫 go code 上,滿不方便的
尤其是,目前對於要如何找 API document 是有個滿大的困擾的
所以囉,就安裝了 JetBrains 的 GoLand 來試用。
因為,我習慣了用 vim 來編輯,就也是希望能在 GoLand 中,可以用 vim 的 keybinding
安裝好 plugin 後,就發現無法一直按著 h j k l 來移動
這對於一個 vim 的使用者來說,很不方便,就找找看變更的方式囉
$ cat /Applications/GoLand.app/Contents/Info.plist | grep -A 5 -B 5 -i BundleIdentifier
defaults write com.jetbrains.goland ApplePressAndHoldEnabled -bool false
gd
Ctrl+O
在重新玩 vim 的過程中,有找到一個 for chrome 的 extension
試了之後,還滿好玩的,加以記錄之
d/u
:下一頁,上一頁x
:關閉 tabgt/gT
:切換到下一個 tab, 上一個 tab最近有花了一些時間看一下 vim
就剛好有看到一個滿有趣的 theme - Dracula theme,這在 dark mode 的 theme 聽說還滿有名的
在試用 dracula theme 時,有看到幾篇還滿不錯的文章,就加以記錄囉
一直以來都喜歡,也習慣用 vim。想說,多多用些大家常用的 package 來幫助日常的 coding
也試著將 coding 的部分,多以不離開 vim 就可以做到的方式,來多多練習
nerdtree 一直都是滿多人推薦在 vim 中使用的,有安裝但是沒有特別使用,這次想說多來用用看
Ctrl-N
:開啟 & 關閉 nerdtreeCtrl-W L
, Ctrl-L
:切換到 右邊的視窗Ctrl-W H
,Ctrl-H
:切換到 左邊的視窗列一下,今天學到的 vim 技巧
如何在 NERDTree 中,新增一個檔案
m
開啟 NERDTree Filesystem Menu a
,新增一個 child node目前是用 powerline 來當作 vim status bar 的顯示,記錄一下用 powerline 遇到的情形
$ pip install powerline-status
列一下,我有用到的 vim plugin,還有常用到的 設定 or keymap (key binding)
之前用 vim 時,會不喜歡多一個 window 顯示 folder,隨著對 window 的熟悉,有開一個 folder 的側邊也滿好的
<c-p>
呼叫 CtrlP fuzzy find 的功能<c-f>
and <c-b>
to cycle between modes.<c-d>
to switch to filename only search instead of full path.<c-r>
to switch to regexp mode.<c-j>
, <c-k>
or the arrow keys to navigate the result list.,
, + cc
,文件是的說明是 [count]<leader>cc
, + cu
, + cA
,在這行的結尾加上 comment,並進入 insert mode,可以多試試看1 | " easier moving between tabs |
1 | """""" windows split shortcut |
藉由這次重新設定 & 安裝 vim,同時整理一下目前使用 vim 的方式
現在的 vim 想使用的進階功能,會用到 vim + python 的功能,所以需要重新安裝 vim。
目前用 brew install vim 滿方便,又快速的,就是要記得將執行 brew update,取得最近的 vim 設定
1 | $ brew update |
如果看到 python3 沒有 enable 的話,記得確認一下 vim 是那一版
1 | $ which vim |