You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,8 @@ Trying to share my configuration to my friends, I found that they did't have pat
34
34
-[Buffer switcher](#buffer-switcher)
35
35
-[Function list](#function-list)
36
36
-[Help viewer](#help-viewer)
37
+
-[Preview tag](#preview-tag)
38
+
-[Preview quickfix](#preview-quickfix)
37
39
-[Customize](#customize)
38
40
-[How to change border style](#how-to-change-border-style)
39
41
-[How to change the color scheme](#how-to-change-the-color-scheme)
@@ -350,6 +352,14 @@ It will not interfere your work, and will immediately close if you move your cur
350
352
351
353
Usually the syntax highlighting and cursorline will help you when you are using it to peek symbol definitions.
352
354
355
+
User can scroll the content in the preview window by:
356
+
357
+
```VimL
358
+
quickui#preview#scroll(offset)
359
+
```
360
+
361
+
Parameter `offset` is an integer, above zero to scroll down and below zero to scroll up.
362
+
353
363
## Tools
354
364
355
365
Tools are build upon basic widgets.
@@ -395,6 +405,37 @@ See the screenshot:
395
405
396
406
The only one argument in `display_help` is the help tag name. With this tool, you can read the help text anytime, without creating a new split window.
397
407
408
+
### Preview tag
409
+
410
+
Sometimes I just want a glimpse to the definition of the current word under cursor without actually open that file. So, the tag previewer was made for this:
When you move the cursor around and press `<F3>`, the definition of current `<cword>` under cursor will display in the preview window. If there are multiple definitions, press `<F3>` again will circularly display the next one, and in the command line, you will see the details about how many definitions and source file name.
421
+
422
+
Don't forget to use `quickui#preview#scroll` to scroll the content in the preview window if you want to see more.
423
+
424
+
This feature requires ctags databases are loaded correctly in vim. A plugin [gutentags](https://github.com/ludovicchabant/vim-gutentags) can do it for you nicely in the background.
425
+
426
+
### Preview quickfix
427
+
428
+
If you have many items in the quickfix window, instead of open then one by one, you are able to press `p` in the quickfix window and preview them in the popup:
429
+
430
+
```VimL
431
+
augroup MyQuickfixPreview
432
+
au!
433
+
au FileType qf noremap <silent><buffer> p :call quickui#tools#preview_quickfix()<cr>
434
+
au FileType qf noremap <silent><buffer> P :call quickui#preview#close()<cr>
435
+
augroup END
436
+
```
437
+
438
+
This piece of code setup a `p` keymap in your quickfix window to preview items, and an upper case `P` to close the preview window.
0 commit comments