vim:read_and_write_remote_files

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vim:read_and_write_remote_files [2020/04/14 00:41] petervim:read_and_write_remote_files [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 37: Line 37:
 <code bash> <code bash>
 vim ftp://user@remotesystem/path/to/file vim ftp://user@remotesystem/path/to/file
 +</code>
 +
 +
 +----
 +
 +===== Read and Write remote files within Vim session =====
 +
 +If you are already inside a Vim session, you can then read and write remote files using Nread (NetRead) and Nwrite (NetWrite) commands.
 +
 +Open Vim editor in your local system using the following command:
 +
 +<code bash>
 +vim
 +</code>
 +
 +You’re now inside the Vim session.  To read remote file from within the local Vim session in a new buffer, simply run:
 +
 +<code bash>
 +:e scp://peterk@192.168.1.69/test.txt
 +</code>
 +
 +Alternatively, you can use the “Nread” command like below.
 +
 +<code bash>
 +:Nread scp://peter@192.168.1.69/test.txt
 +</code>
 +
 +Or,
 +
 +<code bash>
 +:Nread "scp://peter@192.168.1.69/test.txt"
 +</code>
 +
 +
 +
 +For more details, type the following command inside the Vim session:
 +
 +<code bash>
 +:Nread ?
 +</code>
 +
 +After reading the file, type :q to exit.
 +
 +Similarly, to write the remote file, run:
 +
 +<code bash>
 +:e scp://peter@192.168.1.69/test.txt
 +</code>
 +
 +Press “i” to enter into insert mode and start writing /modifying it.
 +
 +You can also use :w command to create and write files. But this command will create new empty file only.
 +
 +<code bash>
 +:w scp://peter@192.168.1.69/test.txt
 +</code>
 +
 +After writing, press ESC and type :wq to save and exit.
 +
 +Alternatively, use “Nwrite” command to create to write files like below.
 +
 +<code bash>
 +:Nwrite scp://peter@192.168.1.69/test.txt
 +</code>
 +
 +To know more details about Nwrite, type the following in the Vim session:
 +
 +<code bash>
 +:Nwrite ?
 </code> </code>
  
  
vim/read_and_write_remote_files.1586824885.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki