Skip to content

Commit 3b64cb5

Browse files
author
Lifepillar
committed
Improve q and <tab> mappings in the quickfix list.
Use <c-w><c-p> instead of <c-w><c-w> because the former would always move the cursor to the previously accessed window. Modify the <tab> mapping to do the same (always move to the previously accessed window). The command works as follows: 1. <c-w><c-p> moves to the previously accessed window 2. @=winnr("#") computes the window number of the quickfix window 3. <c-w>c closes the quickfix window (because it is preceded by a count)
1 parent 0532edf commit 3b64cb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/ledger.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ function! ledger#output(report)
539539
call append(0, a:report)
540540
setlocal nomodifiable
541541
" Set local mappings to quit window or lose focus.
542-
nnoremap <silent> <buffer> <tab> <c-w><c-w>
543-
nnoremap <silent> <buffer> q <c-w>c
542+
nnoremap <silent> <buffer> <tab> <c-w><c-p>
543+
nnoremap <silent> <buffer> q <c-w><c-p>@=winnr("#")<cr><c-w>c
544544
" Add some coloring to the report
545545
syntax match LedgerNumber /-\@1<!\d\+\([,.]\d\+\)\+/
546546
syntax match LedgerNegativeNumber /-\d\+\([,.]\d\+\)\+/

0 commit comments

Comments
 (0)