LoginSignup
1
2

More than 1 year has passed since last update.

[Vim] コマンド1つで下部に高さ10のターミナルを生成

Last updated at Posted at 2019-10-05

output.gif

やったこと

現代のイケてるテキストエディタはコマンド一発で下部にターミナルを出せるエディタが
多い(VSCode, JetBrains, Spacemacs など)と思います。かっこいいです。Vimでもやりたい。

コード

以下のコードにて、s; で下部に高さ10のターミナルが生成されます。

init.vim
" 下部に高さ10のコマンドラインを生成
nnoremap s; :<c-u>sp<cr><c-w>J:<c-u>res 10<cr>:<C-u>terminal<cr>:<c-u>setlocal noequalalways<cr>i 

説明

  1. :<c-u>sp<cr> ウィンドウを縦スプリット
  2. <c-w>J ウィンドウを下に持ってくる
  3. :<c-u>res 10<cr> ウィンドウを高さ10にリサイズ
  4. :<c-u>terminal<cr> ターミナルを開く
  5. :<c-u>setlocal noequalalways<cr> ウィンドウのサイズ自動調整無効化
  6. i インサートモード

その他

ぼくがかんがえた使用プラグイン80個以上の最強init.vim

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2