def getlines(self, bufnr=None):
        """Get all lines of a buffer as a list.

        Args:
            bufnr (Optional[int]): A Vim buffer number, current if ``None``.

        Returns:
            List[str]
        """
        buf = self._vim.buffers[bufnr] if bufnr else self._vim.current.buffer
        return buf[:]
Get all lines of a buffer as a list.

        Args:
            bufnr (Optional[int]): A Vim buffer number, current if ``None``.

        Returns:
            List[str]