官术网_书友最值得收藏!

Netrw

Netrw is a built-in file manager in Vim (if we want to get technical, it's a plugin that ships with Vim). It allows you to browse directories and functions, similar to any other file manager you've worked with in your favorite OS.

Use :Ex (the full command is :Explore) to open the file navigation window:

Netrw is fully integrated with Vim, so executing an edit command on a directory (for example,  :e . to open a current directory) actually opens Netrw. This also makes it so that you have one less command to remember.

Here, you can see all of the files within our workspace. Netrw already provides a quick help section in a status bar, but here are the main controls you'll need to know:

  • Enter opens files and directories
  • - goes up a directory
  • D deletes a file or directory
  • R renames a file or directory

A Netrw window can be open in split windows or new tabs as well:

  • :Vex opens Netrw in a vertical split
  • :Sex opens Netrw in a horizontal split
  • :Lex opens Netrw in a leftmost full-height vertical split

Netrw is a powerful tool, which supports remote editing as well; for instance, to get a directory listing over SFTP, you can run the following:

:Ex sftp://<domain>/<directory>/

You can substitute :Ex with :e for the same results. You can edit individual files as well. Here's how to open a file over SCP:

:e scp://<domain>/<directory>/<file>
主站蜘蛛池模板: 凤山市| 嵊泗县| 扶绥县| 枣阳市| 辽中县| 怀仁县| 获嘉县| 公主岭市| 福贡县| 曲阜市| 宁陕县| 富川| 福泉市| 昆明市| 大厂| 西乌珠穆沁旗| 恩施市| 育儿| 石首市| 琼海市| 林芝县| 新昌县| 永胜县| 宜兰市| 莫力| 海门市| 禹州市| 汝州市| 三亚市| 平江县| 长岛县| 阳谷县| 岢岚县| 海盐县| 绥芬河市| 乐安县| 邳州市| 汕头市| 确山县| 朔州市| 杭锦后旗|