srdusr
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/vim.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/vim.md b/tools/vim.md
index e69de29..bc4ff5a 100644
--- a/tools/vim.md
+++ b/tools/vim.md
@@ -0,0 +1,13 @@
+## Copy text from (n)vim to
+```
+* linux:
+ :w !xclip -sel c # copy the whole file
+ $ xclip -o sel -c # paste from the clipboard
+or
+ :w !xsel -b # copy the whole file
+ $ xsel -o -b # paste from the clipboard
+-- Note: In case neither of these tools (xsel and xclip) are preinstalled on your distro, you can probably find them in the repos
+* macos:
+ :%w !pbcopy # copy the whole file
+ :r !pbpaste # paste from the clipboard
+```