Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File keymap yank file name #3064

Closed
wants to merge 2 commits into from
Closed

File keymap yank file name #3064

wants to merge 2 commits into from

Conversation

QiBaobin
Copy link
Contributor

@QiBaobin QiBaobin commented Jul 14, 2022

Fixes #2985

@sudormrfbin
Copy link
Member

sudormrfbin commented Jul 15, 2022

Going the special register route and storing the filename on the % register like vim and kakoune might be better here since registers can be used in prompt areas like the command line and picker directly.

@sudormrfbin
Copy link
Member

Ah I didn't see #3008. If it adds % as the filename register, I don't think we need a separate keybind for copying filenames since it can be done with "%y or "%<space>y".

@QiBaobin
Copy link
Contributor Author

Ah I didn't see #3008. If it adds % as the filename register, I don't think we need a separate keybind for copying filenames since it can be done with "%y or "%<space>y".

Does "%y or "%<space>y" copy the selection to the register instead of copying from it?

@sudormrfbin
Copy link
Member

sudormrfbin commented Jul 16, 2022

Nope, y always copies from the register, and "% selects the register to copy from. Since the % register would hold the name of the file, "%y would copy the the filename into the default register and "%<space>y would copy the filename to the system clipboard.

@QiBaobin
Copy link
Contributor Author

Nope, y always copies from the register, and "% selects the register to copy from. Since the % register would hold the name of the file, "%y would copy the the filename into the default register and "%<space>y would copy the filename to the system clipboard.

This is not what I understand, I think "%y mean copy the selection to register %, this is constant with the behavior as below:

yank_file_name.mov

To copy content from a register to another, I think we need paste from it and select it then copy to another. Let me know if I miss some features here.

@sudormrfbin
Copy link
Member

sudormrfbin commented Jul 16, 2022

You're right, I mixed up y and ctrl-r in insert mode, sorry for the confusion 😅. In that case I think it's better to have a typable :command instead of a keybind for copying the filename to the system clilpboard. I don't think it's a frequent enough thing to do that would require a default keybind, but if required it can be easily binded in the config file.

@QiBaobin
Copy link
Contributor Author

You're right, I mixed up y and ctrl-r in insert mode, sorry for the confusion 😅. In that case I think it's better to have a typable :command instead of a keybind for copying the filename to the system clilpboard. I don't think it's a frequent enough thing to do that would require a default keybind, but if required it can be easily binded in the config file.

Sure

@QiBaobin QiBaobin closed this Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a command to copy the filename and cursor line number in the clipboard.
2 participants