Thursday, April 28, 2011

Set a hidden buffer as 'nobuflisted'

How may I set a hidden buffer as 'nolisted' from a vim script?
I tried:
call setbufvar(2, 'buflisted', 1)

From stackoverflow
  • You have to add ampersand sign to 'buflisted' to show to Vim that it is the option:

    call setbufvar(2, '&buflisted', 1)
    
    Ricardo : To set the value of an option, should be like this? setbufvar(2, '&buftype', 'nofile')
    Mykola Golubyev : or if the buffer is already opened let &optionname = value; or set optionname=value

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.