justinmk / vim-dirvish

Directory viewer for Vim :zap:
Other
1.18k stars 64 forks source link

Behavior of "." when only one file is selected #147

Closed urbainvaes closed 4 years ago

urbainvaes commented 4 years ago

I like the "." mapping to :Shdo, but I'd like to propose two changes:

justinmk commented 4 years ago

Instead of mapping to :Shdo (with trailing whitespace), map to :Shdo (without trailing whitespace). It makes it easier to type ! when operating on the arglist

I don't see what that gains, since [count]. is easier in all cases if you want to work with the arglist. Whereas with the suggested behavior change, the non-arglist case now always has an extra step.

If no range is given and the local arglist is empty, map to :!| filename instead,

Done in https://github.com/justinmk/vim-dirvish/pull/156

urbainvaes commented 4 years ago

Many thanks for implementing and merging! :)

I just wanted to say that I disagree with this:

I don't think the argc() > 0 check is necessary. It's too surprising for . to have all of these conditions.

Here is why:

So I would be in favor of mapping . to :Shdo! when the arglist is nonempty, but of course this is up to you!

Many thank for a great plugin! :)

justinmk commented 4 years ago

Do any other vim commands behave in this manner?

1<c-g> for example