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

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>
主站蜘蛛池模板: 广德县| 辽阳县| 弥渡县| 长沙市| 广昌县| 华阴市| 平舆县| 来凤县| 阿拉善右旗| 高要市| 阿克陶县| 资源县| 温宿县| 磐石市| 涿州市| 宁国市| 双牌县| 绥德县| 伊金霍洛旗| 大竹县| 白山市| 辽中县| 法库县| 平南县| 泰宁县| 滁州市| 宜兰县| 隆昌县| 阜南县| 临颍县| 大兴区| 芜湖县| 兴业县| 陇南市| 凤台县| 黑河市| 郑州市| 衡阳市| 天长市| 皮山县| 巧家县|