Add initial support for settings to overwrite ale shell
This commit is contained in:
parent
1d4f985538
commit
cbc029b2b8
@ -11,6 +11,12 @@
|
|||||||
" A setting for wrapping commands.
|
" A setting for wrapping commands.
|
||||||
let g:ale_command_wrapper = get(g:, 'ale_command_wrapper', '')
|
let g:ale_command_wrapper = get(g:, 'ale_command_wrapper', '')
|
||||||
|
|
||||||
|
" A setting for the shell used to execute commands
|
||||||
|
let g:ale_shell = get(g:, 'ale_shell', &shell)
|
||||||
|
|
||||||
|
" A setting for the arguments we pass to the shell when executing commands
|
||||||
|
let g:ale_shell_arguments = get(g:, 'ale_shell_arguments', &shellcmdflag)
|
||||||
|
|
||||||
if !has_key(s:, 'job_map')
|
if !has_key(s:, 'job_map')
|
||||||
let s:job_map = {}
|
let s:job_map = {}
|
||||||
endif
|
endif
|
||||||
@ -188,11 +194,11 @@ function! ale#job#PrepareCommand(buffer, command) abort
|
|||||||
return 'cmd /s/c "' . l:command . '"'
|
return 'cmd /s/c "' . l:command . '"'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if &shell =~? 'fish$\|pwsh$'
|
if g:ale_shell =~? 'fish$\|pwsh$'
|
||||||
return ['/bin/sh', '-c', l:command]
|
return ['/bin/sh', g:ale_shell_arguments, l:command]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return split(&shell) + split(&shellcmdflag) + [l:command]
|
return [g:ale_shell] + split(g:ale_shell_arguments) + [l:command]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Start a job with options which are agnostic to Vim and NeoVim.
|
" Start a job with options which are agnostic to Vim and NeoVim.
|
||||||
|
18
doc/ale.txt
18
doc/ale.txt
@ -1984,6 +1984,24 @@ g:ale_windows_node_executable_path *g:ale_windows_node_executable_path*
|
|||||||
scripts are executed with whatever executable is configured with this
|
scripts are executed with whatever executable is configured with this
|
||||||
setting.
|
setting.
|
||||||
|
|
||||||
|
g:ale_shell *g:ale_shell*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: `'&shell'`
|
||||||
|
|
||||||
|
This variable is used to determine which shell ale will use to execute
|
||||||
|
commands. This variables defaults to the value of the vim option '&shell'
|
||||||
|
which corresponds to the $SHELL environment variable. For example
|
||||||
|
if `$SHELL == '/bin/bash'`, but you want to use zsh, set `g:ale_shell = '/bin/zsh'.`
|
||||||
|
|
||||||
|
g:ale_shell_arguments *g:ale_shell_arguments*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: `'&shellcmdflag'`
|
||||||
|
|
||||||
|
This variable is used to determine what commands vim will pass to the shell
|
||||||
|
to execute it's commands. By default, `&shellcmdflag` would be set to the
|
||||||
|
value of '`-c'`.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
6.1. Highlights *ale-highlights*
|
6.1. Highlights *ale-highlights*
|
||||||
|
Loading…
Reference in New Issue
Block a user