0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【備忘録】Vim エディタとしての環境を整える

0
Posted at

ディレクトリを開く

vim <任意のディレクトリのパス>

netrw(ファイルブラウザ)を縦分割で開く

:Vex

Vexはnetrwを縦分割で起動するExコマンド
その他、
:Sex: 横分割で開く(Split)
:Ex: 現在ウィンドウで開く(Explorer)

netrwとは

  • Vimにデフォルトで入っているファイル操作プラグイン
  • ファイル・ディレクトリの閲覧/移動/作成/削除が可能

ウィンドウ幅を変える

<C-w>>: 広げる
<C-w><: 狭める
5<C-w>>: 5文字分広げる
10<C-w><: 10文字分狭める

ウィンドウ(アクティブなウィンドウ)を切り替える

<C-w>h: 左へ
<C-w>l: 右へ
<C-w>k: 上へ
<C-w>j: 下へ


ファイラで選択したファイルを、ファイラ以外のウィンドウで開く

※縦にウィンドウが2分割されていてファイラが左側にある前提なら、右側でファイラが開かれる

" ~/.vimrc
let g:netrw_browse_split = 4

let: 変数に値を代入するコマンド
g:: 変数のスコープ。グローバル
netrw_browse_split: netrwプラグインの設定変数

複数ウィンドウがある状態で、一発でvimを終了する

:qall

参考サイト

https://qiita.com/picric_acid/items/ec987cf244ae86ff6fc4
https://blog.ojisan.io/my-netrw-configure/

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?