Skip to content

Commit

Permalink
add support for shell=fish
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Mar 26, 2015
1 parent 0992511 commit eb3718e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 6 additions & 1 deletion ftplugin/latex-box/common.vim
Expand Up @@ -264,7 +264,12 @@ function! LatexBox_View(...)
if has('win32')
let cmd = '!start /b ' . cmd . ' >nul'
else
let cmd = '!' . cmd . ' &>/dev/null &'
let cmd = '!' . cmd . ' '
if fnamemodify(&shell, ':t') ==# 'fish'
let cmd .= ' >/dev/null ^/dev/null &'
else
let cmd .= ' &>/dev/null &'
endif
endif
silent execute cmd
if !has("gui_running")
Expand Down
18 changes: 15 additions & 3 deletions ftplugin/latex-box/latexmk.vim
Expand Up @@ -166,7 +166,11 @@ function! LatexBox_Latexmk(force)
elseif match(&shell, '/tcsh$') >= 0
let env = 'setenv max_print_line ' . max_print_line . '; '
else
let env = 'max_print_line=' . max_print_line
if fnamemodify(&shell, ':t') ==# 'fish'
let env = 'set max_print_line ' . max_print_line . '; and '
else
let env = 'max_print_line=' . max_print_line
endif
endif

" Set environment options
Expand All @@ -177,7 +181,11 @@ function! LatexBox_Latexmk(force)
" Make sure to switch drive as well as directory
let cmd = 'cd /D ' . texroot . ' && '
else
let cmd = 'cd ' . texroot . ' && '
if fnamemodify(&shell, ':t') ==# 'fish'
let cmd = 'cd ' . texroot . '; and '
else
let cmd = 'cd ' . texroot . ' && '
endif
endif
let cmd .= env . ' latexmk'
if ! g:LatexBox_personal_latexmkrc
Expand All @@ -203,7 +211,11 @@ function! LatexBox_Latexmk(force)
if has('win32')
let cmd .= ' >nul'
else
let cmd .= ' &>/dev/null'
if fnamemodify(&shell, ':t') ==# 'fish'
let cmd .= ' >/dev/null ^/dev/null'
else
let cmd .= ' &>/dev/null'
endif
endif

if g:LatexBox_latexmk_async
Expand Down

0 comments on commit eb3718e

Please sign in to comment.