diff --git a/doc_src/cmds/fish_clipboard_copy.rst b/doc_src/cmds/fish_clipboard_copy.rst new file mode 100644 index 000000000..90abf77fc --- /dev/null +++ b/doc_src/cmds/fish_clipboard_copy.rst @@ -0,0 +1,36 @@ +.. _cmd-fish_clipboard_copy: + +fish_clipboard_copy - copy text to the system's clipboard +============================================================== + +Synopsis +-------- + +.. synopsis:: + + fish_clipboard_copy + + foo | fish_clipboard_copy + +Description +----------- + +The ``fish_clipboard_copy`` function copies text to the system clipboard. + +If stdin is not a terminal (see :doc:`isatty `), it will read all input from there and copy it. If it is, it will use the current commandline, or the current selection if there is one. + +It is bound to :kbd:`Control`\ +\ :kbd:`X` by default. + +``fish_clipboard_copy`` works by calling a system-specific backend. If it doesn't appear to work you may need to install yours. + +Currently supported are: + +- ``pbcopy`` +- ``wl-copy`` using wayland +- ``xsel`` and ``xclip`` for X11 +- ``clip.exe`` on Windows. + +See also +-------- + +- :doc:`fish_clipboard_paste` which does the inverse. diff --git a/doc_src/cmds/fish_clipboard_paste.rst b/doc_src/cmds/fish_clipboard_paste.rst new file mode 100644 index 000000000..9833df2b1 --- /dev/null +++ b/doc_src/cmds/fish_clipboard_paste.rst @@ -0,0 +1,38 @@ +.. _cmd-fish_clipboard_paste: + +fish_clipboard_paste - get text from the system's clipboard +============================================================== + +Synopsis +-------- + +.. synopsis:: + + fish_clipboard_paste + + fish_clipboard_paste | foo + +Description +----------- + +The ``fish_clipboard_paste`` function copies text from the system clipboard. + +If its stdout is not a terminal (see :doc:`isatty `), it will output everything there, as-is, without any additional newlines. If it is, it will put the text in the commandline instead. + +If it outputs to the commandline, it will automatically escape the output if the cursor is currently inside single-quotes so it is suitable for single-quotes (meaning it escapes ``'`` and ``\\``). + +It is bound to :kbd:`Control`\ +\ :kbd:`V` by default. + +``fish_clipboard_paste`` works by calling a system-specific backend. If it doesn't appear to work you may need to install yours. + +Currently supported are: + +- ``pbpaste`` +- ``wl-paste`` using wayland +- ``xsel`` and ``xclip`` for X11 +- ``powershell.exe`` on Windows (this backend has encoding limitations and uses windows line endings that ``fish_clipboard_paste`` undoes) + +See also +-------- + +- :doc:`fish_clipboard_copy` which does the inverse. diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index 7fb0516c8..b6b38be67 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -303,7 +303,7 @@ Some bindings are common across Emacs and Vi mode, because they aren't text edit - :kbd:`Control`\ +\ :kbd:`W` moves the previous path component (everything up to the previous "/", ":" or "@") to the :ref:`killring`. -- :kbd:`Control`\ +\ :kbd:`X` copies the current buffer to the system's clipboard, :kbd:`Control`\ +\ :kbd:`V` inserts the clipboard contents. +- :kbd:`Control`\ +\ :kbd:`X` copies the current buffer to the system's clipboard, :kbd:`Control`\ +\ :kbd:`V` inserts the clipboard contents. (see :doc:`fish_clipboard_copy ` and :doc:`fish_clipboard_paste `) - :kbd:`Alt`\ +\ :kbd:`D` moves the next word to the :ref:`killring`.