diff options
author | JeeBak Kim <jeebak.kim@gmail.com> | 2019-12-31 07:37:21 -0800 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2021-01-16 14:28:43 +0100 |
commit | 4ffa9989c4546c0696edeed8668baac245648973 (patch) | |
tree | 214cd87f5d0ebb25696717f31f84246309d5ba98 /README.md | |
parent | 11db7309463ae7afeb08fc07271e38a223b234d6 (diff) | |
download | vis-fzf-open-4ffa9989c4546c0696edeed8668baac245648973.tar.gz |
Add a complex example for plugin_vis_open.fzf_args
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 38 |
1 files changed, 37 insertions, 1 deletions
@@ -19,7 +19,7 @@ While in `fzf`: In `visrc.lua`: ```lua -plugin_vis_open =require('plugins/vis-fzf-open/fzf-open') +plugin_vis_open = require('plugins/vis-fzf-open/fzf-open') -- Path to the fzf executable (default: "fzf") plugin_vis_open.fzf_path = ( @@ -28,3 +28,39 @@ plugin_vis_open.fzf_path = ( -- Arguments passed to fzf (default: "") plugin_vis_open.fzf_args = "-q '!.class ' --height=40%" ``` + +Complex example for `plugin_vis_open.fzf_args`: + +```lua +my_fzf_args = string.gsub([[ + --bind=$my_fzf_key_bindings \ + --color fg:242,bg:236,hl:65,fg+:15,bg+:239,hl+:108 \ + --color info:108,prompt:109,spinner:108,pointer:168,marker:168 \ + --delimiter / --nth -1 \ + --height=70% \ + --inline-info \ + --no-mouse \ + --preview-window=up:70% \ + --preview="( + bat --style=changes,grid,numbers --color=always {} || + highlight -O ansi -l {} || + coderay {} || + rougify {} || + cat {} + ) 2> /dev/null | head -1000" +]], +'%$([%w_]+)', { + my_fzf_key_bindings=table.concat({ + "alt-j:preview-down", + "alt-k:preview-up", + "ctrl-f:preview-page-down", + "ctrl-b:preview-page-up", + "?:toggle-preview", + "alt-w:toggle-preview-wrap", + "ctrl-z:clear-screen" + }, ",") +}) + +-- Arguments passed to fzf (default: "") +plugin_vis_open.fzf_args = my_fzf_args +``` |