余ってるマシンにUbuntu Serverを入れたことをきっかけに、Vimに入門した。手早く快適な環境を手に入れたかったので、便利プラグイン盛り盛りセットのAstroNvimってやつを使うことにした。
超便利で、普段使いしているVSCodeからの乗り換えを検討するぐらい気に入ったんだけど、一つ不満なのがタイトルの件。初期状態では左側のExplorerが閉じている。自分としては常に開いててほしい。結果、「起動 → space + o」を毎回タイプすることになる。
やるべきことは明確で、space + o でやっている処理を初期化時にも実行すればいいはずである。.config/nvim/lua/user/init.lua
に以下のように書いておくとよい。
-- This function is run last and is a good place to configuring -- augroups/autocommands and custom filetypes also this just pure lua so -- anything that doesn't fit in the normal config locations above can go here polish = function() vim.cmd.Neotree "focus" end
- ref: mappings.lua
こちらが出来上がったものです。よかったですね。