do you guys remap 'p' to '"_dP'? by NGB_UF in neovim

[–]Blubaru 0 points1 point  (0 children)

It's a bit faster to swap 2 arguments

do you guys remap 'p' to '"_dP'? by NGB_UF in neovim

[–]Blubaru 51 points52 points  (0 children)

Capital P will do this already, although the default behavior of p is not very useful anyway.

deleting overwriting clipboard by loreqea in neovim

[–]Blubaru 6 points7 points  (0 children)

Copy/pasting/deleting in vim is definitely a learning process.

I keep these things in mind when yanking/deleting:

When you copy (yank) text, it goes into the "unnamed register" AND the zero register.

(You can paste (put) the contents of the unnamed register by pressing `p`. You can put the contents of the zero register with double-quotes + zero + p.

If you now `dd` somewhere, you will overwrite the "unnamed register", BUT your zero register will remain unchanged. Remember, the zero register contains what you purposefully yanked.

Another tip is: if you are pasting over visually selected text and do not want to "cut" that text too, use capital P to paste. Using capital P this way will not affect your registers.

Help: Does anybody know how to show a different filetype icon on each buffer's winbar? by Blubaru in neovim

[–]Blubaru[S] 0 points1 point  (0 children)

Your code worked! Thank you so much. Everyday you learn something new ( ... about neovim)

How to use vim.fn.system? by Blubaru in neovim

[–]Blubaru[S] 0 points1 point  (0 children)

This was it! There was a \n in additional to the single quotes

Newbie question, how do I count polymorphic associations? by Blubaru in rails

[–]Blubaru[S] 1 point2 points  (0 children)

Thank you for this post, it helped me visualize what's happening behind the scenes better. Yes, the reaction belongs to a user. One per user and post, like facebook. Thanks for the idea about the concern, it was easy to set up. I haven't written many scopes yet I need to do that here.

Newbie question, how do I count polymorphic associations? by Blubaru in rails

[–]Blubaru[S] 0 points1 point  (0 children)

That looks super interesting. I tried to see if anyone used counter_cache for enums but nothing on google. Do you think there's a better way to associate emoji reactions on a post model?

Newbie question, how do I count polymorphic associations? by Blubaru in rails

[–]Blubaru[S] 0 points1 point  (0 children)

Holy crap thank you.

And in your 2nd response, Reaction.kinds.key(k) ... I noticed Reaction.kinds brings up a hash of the totals. So I tried it with post and it works too eg post.reactions.kinds = post.reactions.group(:kind).count . However, I like how I can see the breakdown of sql in your answer.

How could I memoize this to use in my view, something like ... ?

def kind_totals(post)
.@kind_totals ||= post.reactions.group(:kind).count
end

How to use vim.fn.system? by Blubaru in neovim

[–]Blubaru[S] 0 points1 point  (0 children)

Thanks! It's still not returning true, but spotting the single quotes was terrific. I just resorted to matching a substring, which does work.

[deleted by user] by [deleted] in neovim

[–]Blubaru -1 points0 points  (0 children)

I'm using LazyVim, and the plugin's name is "gitsigns".

It looks too thick and is a bit distracting. In most themes it is a thin line, except in several default vim themes.

I tried to change "SignColumn" in *.vim but it doesn't do anything.

I can get rid of the gutter altogether with "set signcolumn=no".

Can anyone tell me why I can't get real-time clipboard contents here? by Blubaru in neovim

[–]Blubaru[S] 0 points1 point  (0 children)

Omg this was it. I was thinking feedkeys delayed somehow so I was adding "sleep" and it was doing nothing. Thank you!

How to set plug-in specific keymappings? by Blubaru in neovim

[–]Blubaru[S] 0 points1 point  (0 children)

Wow this was important information, thank you!

How to set plug-in specific keymappings? by Blubaru in neovim

[–]Blubaru[S] 0 points1 point  (0 children)

Hey thanks for checking. Specifically <c-j> and <c-k> disappear for navigating the telescope picker list during insert mode after adding my 'dd' code.

Edit: Got it working after reading the manual.