-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
gi/gI: Add cursor filename at line [count] #1515
Comments
The idea was that this could be extended so that
This isn't a bad idea, but it's a bit awkward, as you would need to input
A flag is absolutely off the table. More work for me, more confusion for users. It's like if cars had an option to swap the gas and break pedals, albeit with lower stakes. Either it's good enough to justify the growing pains of replacing it or it isn't.
I made There is some good food for thought here, and perhaps it will inspire future functionality, but for now, I don't think it justifies breaking changes. |
The way
fugitive_gi
/fugitive_gI
have been implemented implies the following 2 choices:.gitignore
and.git/info/exclude
To do so, the following 2 degrees of freedom were used:
gi
-gI
distinguishes between "open" and "open+write"{count}gi
-gi
and{count}gI
-gI
distinguish between.gitignore
and.git/info/exclude
which reduces
[count]
to a boolean flag (through its existence, not value).Instead, I feel (possibly wrongly) that it would be more intuitive [2] to "invert" the DoFs and use:
gi
for one file,gI
for the other [1];gi
/gI
for opening the file,{count}gi
/{count}gI
for also adding the filename under the cursorwhich has the added benefit that
[count]
can now be used, for example, as the target line to receive the filename (remotely resembling{address}
, as used by:copy
).Would it be possible to implement such mappings? Now, I understand that changing a user-facing interface like this might not be desired, in order to avoid unnecessarily confusing existing users. If this is the case and if the proposal above is sensible, would a flag toggling the behaviour of
gi
/gI
be a considerable option?[1]: the choice between
gi
=.gitignore
&gI
=.git/info/exclude
andgi
=.git/info/exclude
&gI
=.gitignore
is somewhat arbitrary but I would probably pick the former as "
.gitignore
" is "smaller" (as in shorter) than.git/info/exclude
, just likei
is "smaller" thanI
andgi
reminds me of.{g}it{i}gnore
whilegI
could be for.{g}it{/i}nfo/exclude
.[2]:
i
orI
) is symmetrically present in both commandsi
andI
(as opposed to{count}
and[count]
requires "more work", just like what the mapping does and, conceptually,{count}gi
/{count}gI
could be seen as always adding the filename to the file at line[count]
withgi
/gI
(no count) being the special case using the "null line" (similarly to/dev/null
and"_
).The text was updated successfully, but these errors were encountered: