Is it possible to reset the sequence of indices that vim uses for file buffers?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Dream Voyager Looping
--
Chapters
00:00 Is It Possible To Reset The Sequence Of Indices That Vim Uses For File Buffers?
00:31 Accepted Answer Score 13
00:59 Answer 2 Score 4
01:12 Thank you
--
Full question
https://superuser.com/questions/372015/i...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#vim #buffer
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Dream Voyager Looping
--
Chapters
00:00 Is It Possible To Reset The Sequence Of Indices That Vim Uses For File Buffers?
00:31 Accepted Answer Score 13
00:59 Answer 2 Score 4
01:12 Thank you
--
Full question
https://superuser.com/questions/372015/i...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#vim #buffer
#avk47
ACCEPTED ANSWER
Score 13
No, not without restarting Vim. There are a number of reasons why they cannot be reset, some of them internal, some having to do with avoiding surprises with Vim scripts that store buffer numbers.
Are you aware that you can do :buffer some_partial_buffer_name
to jump to another buffer, as long as the string you supply (some_partial_buffer_name
) is unique?
ANSWER 2
Score 4
Creating a session (:mksession!
), closing vim and opening the session (:so Session.vim
) will reorder you indices starting from 2 (1 is used to source the session).