.gitignore
Unityの場合、以下の設定を.gitignoreに追加。
/.idea/
ideavim
Settings内の「Vim Emulation」でキー入力をVimで取るか、IDEで取るか選択出来る。
注意点として、Vimを選択してもIDEに取られる場合がある。その場合、「Keymap」でバッティングしてるショートカットが無いか探す。例えばVisualStudioのキーマップを選択してるとかなりバッティングが起こるので、Defaultなどに戻してから、.ideavimrcからIDEのコマンドを呼びだすのが良い。
:action CommandName
で指定のIDEのコマンドを呼び出せる。
ホームディレクトリに.ideavimrc
を作成。以下設定例。
" vim keymap
nnoremap j gj
nnoremap k gk
nnoremap x "_x
vnoremap x "_x
nnoremap Q <Nop>
nnoremap s <Nop>
vnoremap s <Nop>
nnoremap <Space> <Nop>
vnoremap <Space> <Nop>
nnoremap gh gT
nnoremap gl gt
" vim setting
set clipboard=unnamed,autoselect
set surround
set hlsearch
set incsearch
set ignorecase
set smartcase
set scrolloff=5
" idea action
nnoremap se :action SearchEverywhere<CR>
nnoremap sg :action FindInPath<CR>
nnoremap ss :action FileStructurePopup<CR>
nnoremap <Space>a :action GotoAction<CR>
vnoremap <Space>a :action GotoAction<CR>
nnoremap gd :action GotoDeclaration<CR>
nnoremap gs :action GotoSuperMethod<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gb :action JumpToLastChange<CR>
nnoremap U :action FindUsages<CR>
nnoremap R :action RenameElement<CR>
nnoremap == :action ReformatCode<CR>
vnoremap == :action ReformatCode<CR>
nnoremap cc :action CommentByLineComment<CR>
vnoremap cc :action CommentByLineComment<CR>
nnoremap <C-CR> :action ShowIntentionActions<CR>
https://ikenox.info/2017-12-25-ideavim-introduction/
コンソールの文字化けを治す
vmoptionsでencodingを修正する
C:\Program Files\JetBrains\JetBrains Rider 2018.2.1\bin
にあるrider64.exe.vmoptions
に以下の内容を追記。
-Dfile.encoding=UTF-8
https://stackoverflow.com/questions/29695918/intellij-idea-console-issue
で治るらしいけど、なぜか手元の環境では治らず…(Rider2018.2)、調査中。
ロケール設定してなかっただけでした…。以下を.bashrc
に追記
export LANG=ja_JP.UTF-8
自動保存無効化
好みはあるかもしれないけど、自動保存に慣れなかったので無効化。 「Appearance & Behavior」 -> 「System Settings」の「Save files on frame deactivation」をOFFに。