My nvim configuration
| 1 | vim.cmd([[ |
| 2 | function! NumberedTabPages() |
| 3 | let s = '' |
| 4 | for i in range(tabpagenr('$')) |
| 5 | " Get the tab-local cwd for tab (i+1) |
| 6 | let l:cwd = fnamemodify(getcwd(-1, i+1), ':t') |
| 7 | |
| 8 | " Highlight current tab |
| 9 | if i + 1 == tabpagenr() |
| 10 | let s .= '%#TabLineSel#' |
| 11 | else |
| 12 | let s .= '%#TabLine#' |
| 13 | endif |
| 14 | |
| 15 | " Add clickable label: tab number + cwd |
| 16 | let s .= '%' . (i+1) . 'T ' . (i+1) . ':' . l:cwd . ' ' |
| 17 | endfor |
| 18 | let s .= '%#TabLineFill#%T' |
| 19 | return s |
| 20 | endfunction |
| 21 | |
| 22 | let g:qfjobs=[] |
| 23 | function! JobHandler(c, d, n) abort |
| 24 | let lines = filter(copy(a:d), 'v:val !=# ""') |
| 25 | if empty(lines) |
| 26 | return |
| 27 | endif |
| 28 | |
| 29 | " Step 1: save current qf |
| 30 | let old = getqflist() |
| 31 | |
| 32 | " Step 2: parse new lines into qf entries using errorformat |
| 33 | cgetexpr lines |
| 34 | let new = getqflist() |
| 35 | |
| 36 | " Step 3: merge |
| 37 | let merged = old + new |
| 38 | |
| 39 | " Step 4: set back |
| 40 | call setqflist(merged, 'r') |
| 41 | endfunction |
| 42 | ]]) |