The line(".")
, command gets the line in the current buffer. Whats the command to get line in an arbitrary buffer, using buffer numbers?
1 Answer
The getbufinfo()
returns a list of dictionaries. One of the dictionary key is lnum
- line number. One other key is bufn
- buffer number.
-
Note this function is a rather recent addition to vim's libraries (post 7.4.2204, Aug 2016) Mar 26, 2017 at 14:32
:h getbufline()