New answers tagged


append() (or appendbufline()) do not allow \r or \n to insert new lines. You should use List instead. For instance, call appendbufline(l:bufnr, '$', repeat([''], winheight(winnr())))


First off, are you sure you need to add actual content to your buffer? If the goal is just to get it the same height as a single, current window, there's a much simpler method in normal mode: <C-W>= Or in Vimscript: :wincmd = The problem with your append command is that you're passing a string, which explicitly tells it add the content to a single ...


Use _u to open last buffer,_U to view last buffers. It can be improved. let g:lastWindows= [] let g:lastWinName = "" function! SaveLastWindow() if &bt == '' || &bt == 'help' || &ft == 'netranger' "|| &bt == 'nofile' let cur= expand( '<afile>' ) if cur == g:lastWinName || cur =="" return endif call add(g:...

Top 50 recent answers are included