Replies: 2 comments 1 reply
|
Sorry if I'm missing the point, but did you try trimming the selection before moving to paste it? here're snippets from my yank/paste-ing sections [keys.normal.y]
j = [ 'save_selection', 'trim_selections', 'yank_joined', 'jump_backward' ]
y = 'yank'
c = [ 'trim_selections', 'yank' ]
l = [ 'save_selection', 'extend_line', 'yank', 'jump_backward' ]
[keys.normal.p]
o = { l = [ 'extend_line', 'delete_selection_noyank', 'paste_before' ], w = [ 'move_prev_word_start', 'extend_next_word_end', 'delete_selection_noyank', 'paste_before' ], c = ':clipboard-paste-replace', o = 'replace_with_yanked', t = [ 'trim_selections', 'delete_selection_noyank', ':insert-output tpb' ] } |
1 reply
|
Replace the opened line with the register, then pipe it so it always ends in one newline. [keys.normal."["]
p = [
"open_above",
"normal_mode",
"extend_to_line_bounds",
"replace_with_yanked",
":pipe python3 -c \"import sys; sys.stdout.write(sys.stdin.read().rstrip('\\n')+'\\n')\"",
"goto_line_start",
]
[keys.normal."]"]
p = [
"open_below",
"normal_mode",
"extend_to_line_bounds",
"replace_with_yanked",
":pipe python3 -c \"import sys; sys.stdout.write(sys.stdin.read().rstrip('\\n')+'\\n')\"",
"goto_line_start",
]Helix already treats a trailing newline as linewise, so |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi !
In neovim I have keybind
[pto paste above the current line:I have one for pasting below the current line but it's the same thing basically.
I tried to copy this to Helix:
It works fine IF I don't copy the newline character when copying the text. If I do, then there will end up being an extra empty line which I don't want. In neovim, this extra empty line doesn't happen for some reason.
Doesn't work even if I do
paste_afterinstead ofpaste_beforeThen I tried this :
It works fine IF I copy the newline character when copying text, but doesn't if I don't copy it (say I copy only a word)
How do I make
[Pwork in both ways? This is a pretty important keybind for me. In neovim it works fine both ways.All reactions