Add support for fish shell

The `&&` and the `||` operators aren't available in fish.
The equivalents are `; and` and `; or`.
Also single parentheses are used for command substitution.
The fish equivalents are `begin` and `end`.
But they aren't needed here.
This commit is contained in:
Manuel Johannes Messner
2015-08-17 09:27:51 +02:00
committed by Andy Stewart
parent fe10e6474d
commit 0ca15c8ad2
2 changed files with 22 additions and 10 deletions

View File

@@ -131,7 +131,8 @@ function! gitgutter#utility#file_relative_to_repo_root()
endfunction
function! gitgutter#utility#command_in_directory_of_file(cmd)
return 'cd ' . gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()) . ' && ' . a:cmd
let l:fish = &shell =~# 'fish'
return 'cd ' . gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()) . (l:fish ? '; and ' : ' && ') . a:cmd
endfunction
function! gitgutter#utility#highlight_name_for_change(text)