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

Use silent! execute and <unique> to create non-clobbering mappings? #88

Closed
kshenoy opened this issue Sep 14, 2014 · 4 comments
Closed

Comments

@kshenoy
Copy link

kshenoy commented Sep 14, 2014

Hi, I started using vim-textobj-line again and I realized that its mappings conflict with that of this plugin. Since, I've been using n/l for next/last for quite some time now, I changed textobj-line's mappings to use _ since _ kind of represents a line-textobj. However, this still conflicts with targets.vim

Would it be possible to use :silent! execute and <unique> while creating the maps so that any user-defined mappings are not overwritten?

I was also reading your response here and was intrigued by the idea of using n/N instead of n/l. Is this something that you have tried or plan on supporting? If not, I'll just hack it in my work-area and see how it feels.

Thanks for an awesome plugin :) 👍

@kshenoy kshenoy changed the title Use silent and <unique> to create non-clobbering mappings? Use silent! and <unique> to create non-clobbering mappings? Sep 14, 2014
@kshenoy kshenoy changed the title Use silent! and <unique> to create non-clobbering mappings? Use silent! execute and <unique> to create non-clobbering mappings? Sep 14, 2014
@wellle
Copy link
Owner

wellle commented Sep 14, 2014

Good points! I will check the conflicts and respond here again.

@wellle
Copy link
Owner

wellle commented Sep 15, 2014

Here are the options you currently have:

Disable l in targets.vim and use default textobj-line by putting this in your vimrc:

let g:targets_nlNL = 'nN  '

Disable _ in targets.vim and use textobj-line with _ by putting this in your vimrc:

let g:targets_separators = ', . ; : + - = ~ * # / \ | & $'
let g:textobj_line_no_default_key_mappings = 1
xmap a_ <Plug>(textobj-line-a)
omap a_ <Plug>(textobj-line-a)
xmap i_ <Plug>(textobj-line-i)
omap i_ <Plug>(textobj-line-i)

I will consider using <unique> in the future, thanks!

@kshenoy
Copy link
Author

kshenoy commented Sep 15, 2014

Thanks for the prompt response! 👍

@wellle
Copy link
Owner

wellle commented Oct 18, 2014

@kshenoy: I started to use <unique> in the mappings in #90.

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

No branches or pull requests

2 participants