I’m currently modifying a plugin that I like, to suit my needs. I have come across the problem that I need to know in what buffer I’m in, within VimL’s limitations.
I need to be able to refer to the buffer by name, specifically I need to know when I’m within Vim’s own [Command Line] buffer. Which BTW, you can achieve using q:, q/ or q?.
The plugin I’m modifying is the following: https://github.com/jeffkreeftmeijer/vim-numbertoggle
And this is my fork: https://github.com/Greduan/vim-numbertoggle
What I want to do is know when I’m in this specific buffer, called [Command Line] and not use relative line numbers when I’m in it.
Thanks for any help you can provide!
You could check for some options set by Vim when it creates the command-line window.
create this file and directories:
What you put in this file is only executed by Vim when you edit a file with the corresponding
filetype.add the following self-explanatory code to that file:
It works, here. I think that you can easily adapt it to your needs by adding
&filetype == "vim".