これは、ホスト ファイルを新しいタブで開くためのキー マッピングです。
nnoremap <Leader>hs :tabe /etc/hosts<cr>:set noreadonly<cr>
これで、Vim は readonly について私を悩ませなくなりました。これは素晴らしいことです。ただし、セーブすると強制的にヒットする場合があります⌘</kbd>s or :w
. I would like to overwrite both (are they the same?) calls to call our normal NVW (nasty Vim way) to write as sudo:
:w !sudo tee % >/dev/null<cr>
しかし、hosts ファイルのように、この current buffer に対してのみこれを行いたいと思います。いくつかのsetlocal
魔法?