mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
[preview] Support bat for syntax highlighting in preview.rb
One can still take advantage of `bat` as a syntax highlighter, when ruby is available but other ruby-based highlighter packages are not installed.
This commit is contained in:
committed by
Junegunn Choi
parent
974d366b33
commit
b73d141b74
@@ -4,7 +4,7 @@
|
||||
|
||||
require 'shellwords'
|
||||
|
||||
COMMAND = %[(highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null]
|
||||
COMMAND = %[(highlight -O ansi -l {} || coderay {} || rougify {} || bat --style=numbers --color=always {} || cat {}) 2> /dev/null]
|
||||
ANSI = /\x1b\[[0-9;]*m/
|
||||
REVERSE = "\x1b[7m"
|
||||
RESET = "\x1b[m"
|
||||
@@ -55,3 +55,4 @@ IO.popen(['sh', '-c', COMMAND.gsub('{}', Shellwords.shellescape(path))]) do |io|
|
||||
end
|
||||
end
|
||||
end
|
||||
print RESET
|
||||
|
||||
Reference in New Issue
Block a user