Add a section on Text Objects and special registers like clipboard and blackhole.
fixes: #17808
https://github.com/vim/vim/pull/18105
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dlejay commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux) + + 1. Clipboard registers + and * : + - "+y - Yank to system clipboard (e.g. "+yy for current line) + - "+p - Paste from system clipboard + - "* is primary clipboard on X11 (middle-click), "+ is clipboard (Ctrl-C/V) + +---> Try: "+yy then paste into another application with Ctrl-V
Better avoid talking about Ctrl-C/V since they will not work on macOS.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
> +---> Practice: "_diw on this word to delete it without affecting yank history
Which word is “this word” ?
Also, there needs to be more practice → the person following the tutorial needs to be give more instructions to see that indeed _diw did not affect the yank history.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks ! For the TextObject section, I’d suggest trying to invert the proportions of theory vs practice if possible ; the Vimtutor is practice first.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@brianhuster commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux)
What about telling users a way to check this? E.g :echo has("clipboard")
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I was trying to avoid a complex description, that may not even always be correct. E.g. it does not explain why the clipboard odes not work when using Vim on a non-X11/Wayland UI. Or when ssh into a server.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@chrisbra commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux) + + 1. Clipboard registers + and * : + - "+y - Yank to system clipboard (e.g. "+yy for current line) + - "+p - Paste from system clipboard + - "* is primary clipboard on X11 (middle-click), "+ is clipboard (Ctrl-C/V) + +---> Try: "+yy then paste into another application with Ctrl-V
they don't? And what do you use there, I suppose Cmd-C/V ?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@chrisbra commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux)
probably we should rather use echo has('clipboard_working') instead then?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@brianhuster commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux)
Yes
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
The problems I have seen others have
with it have been due to their inexperience or due to various Linux
distributions' packaging of Vim without the clipboard or X enabled.
That's on the distributions, not Vim, and that statement should say
that.
Note that not just Linux distributions, even the official Vim appimage release also has a version without X11 clipboard support. So saying "that's on the distributions" is not very true
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Simply enabling X11 or Wayland in Vim isn't enough either, as using clipboard also requires X11 or Wayland to be actually running. One may run Vim on a server (via SSH) with no X11 or Wayland available.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dlejay commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux) + + 1. Clipboard registers + and * : + - "+y - Yank to system clipboard (e.g. "+yy for current line) + - "+p - Paste from system clipboard + - "* is primary clipboard on X11 (middle-click), "+ is clipboard (Ctrl-C/V) + +---> Try: "+yy then paste into another application with Ctrl-V
macOS has a UX consistent with UNIX : Ctrl-c sends an interrupt, exactly like in Vim itself.
Copy is ⌘-c.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.![]()
@chrisbra commented on this pull request.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.4: THE BEAUTY OF MARKS + Lesson 2.1.4: SPECIAL REGISTERS + + ** Use system clipboard and blackhole registers for advanced editing ** + + Note: The use of the clipboard depends on your exact Vim version and + system environment and may not be available (especially on Linux)
that just doesn't work on tiny Vims :)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Note that not just Linux distributions, even the official Vim appimage release also has a version without X11 clipboard support.
That is not a very convincing argument, considering that I wrote it :)
So saying "that's on the distributions, not Vim" is not very true
It is, you just need to be able to always install Wayland/X11 libraries/dependencies, which of course nobody wants.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@chrisbra pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
okay I reordered the content slightly (I noticed the clipboard register used text objects, so those need to be introduced earlier) and updated the docs on when clipboard feature is available.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()