New answers tagged


Thunderbeef explained in the comments that this is caused by the difference in the way normal and command-line commands show output. With a command-line command, you see the whole output, but with a normal command, you only see the last line. You can work around this limitation by displaying all the desired output from your call to input(), which allows you ...


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 ...


The problem is that "tiny" is missing the +eval feature and that's what prevents it from seeing your function definitions. So you could try something like: if has('eval') function! Greet() echo "hello" endfunction endif But it turns out you can go even simpler than that, as :help no-eval-feature suggests: When the +eval feature was ...


Method 1.1 " from start of cWORD to cursor echo matchstr(getline('.'), '\S*\%'. col('.') .'c.') " from cursor to end of cWORD echo matchstr(getline('.'), '\%'. col('.') .'c.\S*')


One option is to take the current line, then the substring starting at the current position, split it into multiple words and take the first one. Or, in Vimscript: let word = split(getline('.')[col('.')-1:])[0] One alternative is to use a normal mode command such as yW and then access the contents of the default register (or, better, use a named register.) ...

Top 50 recent answers are included