I still don't get buffers
I still don't get buffers
I still don't get buffers
Nevermind simply having an OS-level clipboard manager...
Win+V works decently enough for me.
I'm don't know why but I've never used windows clipboard manager, which is weird because I go out of my way to make sure I have one when I'm on linux
There is for windows, and it's further improved if you get power toys too
Application specific buffers are the first thing I disable on emacs. The OS one isn't just integrated with every other normal piece of software, it's also more powerful and easier to use.
... at least on my Linux, YMMV.
The os buffer is just another buffer that I can yank into.
Windows also has it, but it's disabled by default for some reason
It's not disabled.
Nah that'd be too intuitive
In all seriousness though, I kinda appreciate moving things around in my editor without losing that one snipet I copied for later
ive never had to think about clipboard buffers until i used a modal editor.
now i spend %60 of my time trying to figure out where the copied symbol went.
I don't have the name handy, but there's at least one plugin for vim that shows buffer previews in a popup. I've got it mapped to leader-sb (for "show buffer").
Telescope?
yah, helix has that in the info bar oob.
im just not thinking about that when im copying shit, i just want to copy paste like it's 1999.
You can see all registers in use with :registers
, to paste from a register say "2
in insert mode use key combination <ctrl-r>2
or in normal mode "2p
. You can check out more in :help registers
. Unnamed register or ""
is the system clipboard I think. To copy texts in a register you can prepend yank (/delete/cut, etc.) with that register "_
(for black hole register[^black_hole])
This is for neovim. Have keybinds for them and there saved you a plugin :D
[^black_hole]: Text yanked in this register is gone, i.e. it's not saved in any register.
So far I haven't been brave enough for that feature. It's either "that main place yank goes", "system clipboard", or "that place that makes it disappear" for me
Gee, X11! How come your mom lets you have THREE clipboards?
then theyre all ignored by x-clip
xD
Wait is that an actual thing?
Yes. X11 replaced X10's obsolete cut buffers (which can be modified by any process) with state-of-the-art selections. There are three selections in X11: a primary, a secondary, and a clipboard.
In modern desktops, the primary selection is overwritten every time you select some text (including in the terminal), which makes its content very ephemeral. You can paste it with the middle mouse button.
The secondary selection is generally not used, but it's present in the specification, and you can use xclip -selection secondary
to access it. Wayland doesn't seem to have a secondary selection.
The clipboard selection is what most people understand to be THE clipboard. You have to write to it explicitly (through a keyboard shortcut, API, or CLI tool), and its content persists until it is overwritten, explicitly cleared, or the X server is killed. While the primary and secondary can only contain text, the clipboard can contain many kinds of data.
I'm an idiot and I think I confused the two haha
My thought process based on when I setup my config: "yank copies to my main 'buffer',
<leader>
yank copies to system clipboard through that special 'buffer', and<leader>
delete deletes without replacing what's in my main 'buffer'. I have multiple clipboards!"Completely forgot they're called registers and that buffers are just "where text is" (at least as far as I understand it)
I kind of assumed that his comment was independent of the meme he posted and served more to underline a perceived power that vim has over other editors. In this case a power OP doesn't even understand/use himself.
Y'all haven't heard of Windows clipboard history? Windows + V will change your life, I tell ya!
Last I checked you have to enable it, which is annoying.
And I still don't really know how to use registers in vim 😂 I just use yy and paste 🥲
You just do " (listen for next character as register name)
Then, say q,w,e etc, then yy to yank as normal.
So "wyy
To retrieve it you use "wp
To add to it "Wyy
To view them :reg
Remember you can make "w anything, like "x or "p
And each time you yank it gets pushed into the default register history "0 "1 "2 etc
I didn't know about registers, thank you for this!
Ok I have to save that 🥲 thanks!
Great explanation. Thank you!
I only know how to use them with q. I hope that's a register, otherwise I will look foolish.
They are. Registers are just "named boxes" where you can store some text and/or keystrokes. When yanking and pasting, the unnamed register is used if you don't specify a name (you can still see or edit it explicitly). For recording a macro there is no default register, though. You need to give it a name.
Same thing but reversed with multiple cursors :/
That's actually the biggest thing I miss about VSCode
https://github.com/mg979/vim-visual-multi
I also missed multiple courses, but I started using vim-visual-multi in my nvim config and it's been great. There's a few others I tried that I couldn't get to work quite right (usually some weird conflict with nvim-cmp) but I've had the best success with vim-visual-multi.
huh?
any emacs elitists here?
they have no use for copy buffers, they are still configuring emacs.
Obligatory boo and/or hiss
I've also been meaning to give emacs a try but haven't found the time or energy to figure out how to exit vim
just get QT browser and search it with any search engine
I had to learn emacs for my engineering computation class, up to the point that we were required to present our code in emacs if we had questions to ask during office hours.
I got quite used to it by the end of that course.
I'm just an emacs ... enjoyer (...?) and I just don't understand the post. I'm pretty sure buffers here refer to something different from emacs buffers as they're completely unrelated to clipboards. Then from a quick scan of the plug-in mentioned it seems to mimic the clipboard ring emacs has had for many decades (always?).
Basically I have no idea what's going on here.
We be rocking that kill ring !
What would an operating system need yank registers for? Maybe if you get a good text editor to go with it, like Evil Mode 😉
Buffers are great. Comes very handy when creating macros in vim.
I think you mean registers not buffers. buffers are file(s) loaded in memory while registers contain text yanked/deleted/last command/last search, etc.
Yeah sorry, I meant registers.
Do you yank to places outside the regular target when you create macros?
What do you mean by regular target? I am either yanking from the OS buffer or yanking things from 2 different buffers. Or I have 2 macros where they yank from different buffers.
What’s annoying about them is that there isn’t a simple way to clear a register which means you have to use both “r and “R in macros.
Give CopyQ a try. Open source, cross platform clipboard manager with tons of features.
One example option is being able to only ever paste plain text. It also has lots of programming hooks, I have a few for doing things like converting a line-feed delimited list into one delimited by commas and quoting the values.
I like vim and use it almost every day, but sometimes I miss Strg+D and Alt+F3 from Sublime (multi edit). Block select + c isn't as useful as this.
the vim-visual-multi plugin tries to do this. It takes some time to get the hang of it, but, even if using only the simplest features, it's way better than not having the option.
Thank you, I will try it.
Seems that I need to remap a few keys like for NerdTree and my tab switch.
Works like a charm. Thanks again. Even mouse selection.
Give the Kakoune editor a try for native multi cursor editing. Or better yet, if you are a developer, the Helix editor.
I'm a web developer and transitioned quite seamlessly to the Helix editor from Visual Studio Code without much hassle.
The Helix editor is growing and gaining new functionality all the time.
Are they also replacing X with q! ?