From c5d75fdf51e2163a1a82a1ad522c84a22f41838b Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 16 Dec 2021 14:10:30 +0100 Subject: Add Readme --- Readme.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..5a010ae --- /dev/null +++ b/Readme.md @@ -0,0 +1,94 @@ +rclone.nvim +=== + +Uses [rclone](https://rclone.org/) under the hood. + +`copy` or `sync` folders, +or copy the file in the current buffer +to a remote in your `rclone.conf` + + +## Table of Contents + +- [Commands](#commands) +- [Usage](#usage) +- [Install](#install) + + +## Commands + +``` +:Rclone [] [] [options] + +Arguments: +command Command to run: [copy, copyFile, sync] +remote Name of the remote section defined in rclone.conf + If only one remote is specified that remote is used by default. + Otherwise the remote with "vim_rclone_default = true" is used. + +Options: +--dry-run Print command to run and don't execute +``` + + +## Usage + +Example `rclone.conf` + +``` +[Test] +type = sftp +host = example.org +user = admin +pass = pa55w0rd +vim_rclone_local_path = . +vim_rclone_remote_path = /test + +[Test_another] +type = sftp +host = example.org +user = admin +pass = pa55w0rd +vim_rclone_local_path = ./test_another +vim_rclone_remote_path = /test/another +vim_rclone_default = true +``` + +`:Rclone copy` copies the local `test_another` folder to the remote `/test/another` because `vim_rclone_default` is set for the **Test_another** remote. + +To upload to the **Test** remote use `:Rclone copy Test`. + +The resulting command from the example above would be +```sh +rclone copy $PATH_TO_PROJECT/test_another Test_another:/test/another --config=./rclone.conf +--exclude=.git/ --exclude=.gitignore --exclude=.rcloneignore +--exclude-from=$PATH_TO_PROJECT/test_another/.gitignore --exclude-from=$PATH_TO_PROJECT/test_another/.rcloneignore +--log-level=INFO --log-file=${vim.fn.stdpath('data')}/rclone_nvim/rclone.log +``` + +### exclude files + +You can extend or overwrite the global `g:vim_rclone_configurable_default_exclude_patterns` variable. +The default patterns are +`{'.git/', '.gitignore', '.rcloneignore'}` + +`rclone.nvim` uses the patterns defined in a `.gitignore` and `.rcloneignore`. + +If you want to upload folders that are in the `.gitignore` like a `/build/` folder, then add `!/build/` to your `.rcloneignore`. + +**Caution:** + +[rclone exclude patterns](https://rclone.org/filtering/#pattern-syntax) for folders **need** a trailing slash. +If you have ignored folders in your `.gitignore` then you have to add a trailing slash to them, or define them separately in the `.rcloneignore`. + + +## Install + +Like any other nvim plugin. + +For example with [vim-plug](https://github.com/junegunn/vim-plug) + +```vim +Plug 'https://gitlab.com/dweipert.de/rclone.nvim' +``` + -- cgit v1.2.3