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

Feature request: increase max # files which can be opened by the leader key (V2) #1823

Closed
kgfly opened this issue Nov 14, 2018 · 14 comments
Closed

Comments

@kgfly
Copy link

kgfly commented Nov 14, 2018

environment

vim: vim8
vim-airline: latest
OS: Linux/Mac/Win
Have you reproduced with a minimal vimrc: feature request
What is your airline configuration: feature request

Currently, the max # of files which can be opened with the leader key is only nine, which too small for a practical use on large project.

Is it possible to provide two modes (controlled by a flag maybe):

Mode #1: which is the current style. The count # is from 1-9.
Mode #2: The count # is from 11-99.

When in mode #2, user always need press and 2 number keys to switch. So there will be no delay issue.

I posted this suggestion on the previous request link. But I don't hear from you. So I posted a V2 suggestion. Wish this would not make you feel too mad ^_^

@chrisbra
Copy link
Member

I am not convinced. How do you know what number to use?

@kgfly
Copy link
Author

kgfly commented Nov 14, 2018

The only diff between mode #1 and #2 is the # range. The # always increases sequentially.

In mode #1, 1st file-> 1, 2nd file -> 2, 3rd file -> 3 .... 9th file -> 9 (arrow means map)
In mode #2, 1st file-> 11, 2nd file -> 12, 3rd file -> 13, ....., 89th file -> 99.

I understand that mapping 1st file -> 11 looks bit weird. But it's handy when switching file. What do you think?

@chrisbra
Copy link
Member

But how do you know, that you need to press e.g. <leader>21 and not <leader>22? Where do you get the number from. Surely you cannot remember for each buffer its buffernumber.

@chrisbra
Copy link
Member

Also please note, according to the documentation, you can already map

nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab

That supports v:count1 so using that you can use any number you need to switch buffers/tabs.

@kgfly
Copy link
Author

kgfly commented Nov 14, 2018

No,I don't need remember the buffer number of each buffer.

Assume, my files are AA, AB, AC ... AZ, BA, BB, .... BZ, ....
This is what currently looks like on 4k monitor.

image

Currently (mode #1), assume I am opening AA, if I need open AH, I watch and check the bar. And I find the it's # is 8. So I press leader + 8 to switch to AH. Even in mode #1, I don't remember.

Mode #2 is similar. AA has buffer # 11, AB has buffer #12 ... AJ (10th file) has buffer #20. Assume I am opening AA, if I need open AJ, I watch and check the bar. And I find the it's # is 20. So I press leader + 20 to switch to AJ.

@kgfly
Copy link
Author

kgfly commented Nov 14, 2018

BTW, in the above image, after BL, it shows E541. Is it a bug? I though it should show BM, then BN, then BO .....

@kgfly
Copy link
Author

kgfly commented Nov 14, 2018

Also please note, according to the documentation, you can already map

nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab

That supports v:count1 so using that you can use any number you need to switch buffers/tabs.

is not good, because it requires you to either remember or run "ls" to figure out the buffer # of the buffer you want to switch to, before you switch.

@chrisbra
Copy link
Member

Regarding E541, that is a limitation of Vim. As mentioned in the documentation, it only allows 80 items inside the statusline/tabline. I thought there was a wishlist issue already open for vim, to increase this limit, but I cannot find it. You might open a new one and explain your usecase (4k monitor, many buffers, etc) and show the screenshot. For the other thing, I'll have to reconsider.

@kgfly
Copy link
Author

kgfly commented Nov 15, 2018

Though 9 is small # when working on a large project, 80 should be fine to me.

Anyway, whether you approve the feature request or not, I appreciate your reconsideration.

@kgfly
Copy link
Author

kgfly commented Feb 7, 2019

Hi chrisbra, May I ask you a quick question? Do you know if anyone is working on this feature request? And do you have a draft idea when it could be implemented? Thanks.

@chrisbra
Copy link
Member

chrisbra commented Feb 7, 2019

just included the feature experimentally.

@kgfly
Copy link
Author

kgfly commented Feb 7, 2019

Thank you very much. I really appreciate!!!

Just tried.

One minor request: could you please adjust the 1st file number from 10 to 11? Reason: assuming 1st file is the most commonly used file, to type "10", you need use little finger from two hands. But to type "11", you only need little finger from one hand.

What do you think?

@chrisbra
Copy link
Member

chrisbra commented Feb 8, 2019

okay, I have just pushed a slight modification.

@kgfly
Copy link
Author

kgfly commented Feb 8, 2019

Thanks. Really appreciate.

YCbCr pushed a commit to YCbCr/vim-airline that referenced this issue May 26, 2019
YCbCr pushed a commit to YCbCr/vim-airline that referenced this issue May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants