[preview] Clean up preview scripts

- Use preview.sh instead of preview.rb by default
- Try bat syntax highlighter with the highest priority
- Remove "-v" option as the latest version of fzf sets up $LINES
- Allow users to customize the preview command via $FZF_PREVIEW_COMMAND
  - *EXPERIMENTAL / EVOLVING / UNDOCUMENTED*
  - Should be a command template with {} placeholder expression
    - e.g. "nl {}"
This commit is contained in:
Junegunn Choi
2018-11-09 15:57:17 +09:00
parent b73d141b74
commit 0dbcfb28c4
4 changed files with 28 additions and 40 deletions

View File

@@ -32,7 +32,7 @@ let s:is_win = has('win32') || has('win64')
let s:layout_keys = ['window', 'up', 'down', 'left', 'right']
let s:bin_dir = expand('<sfile>:h:h:h').'/bin/'
let s:bin = {
\ 'preview': s:bin_dir.(executable('ruby') ? 'preview.rb' : 'preview.sh'),
\ 'preview': s:bin_dir.'preview.sh',
\ 'tags': s:bin_dir.'tags.pl' }
let s:TYPE = {'dict': type({}), 'funcref': type(function('call')), 'string': type(''), 'list': type([])}
if s:is_win