@@ -34,6 +34,12 @@ if exists('g:ranger_choice_file')
3434 endif
3535endif
3636
37+ if exists (' g:ranger_command_override' )
38+ let s: ranger_command = g: ranger_command_override
39+ else
40+ let s: ranger_command = ' ranger'
41+ endif
42+
3743if ! exists (' s:choice_file_path' )
3844 let s: choice_file_path = ' /tmp/chosenfile'
3945endif
@@ -57,19 +63,19 @@ if has('nvim')
5763 endfunction
5864 enew
5965 if isdirectory (currentPath)
60- call termopen (' ranger --choosefiles=' . s: choice_file_path . ' "' . currentPath . ' "' , rangerCallback)
66+ call termopen (s: ranger_command . ' --choosefiles=' . s: choice_file_path . ' "' . currentPath . ' "' , rangerCallback)
6167 else
62- call termopen (' ranger --choosefiles=' . s: choice_file_path . ' --selectfile="' . currentPath . ' "' , rangerCallback)
68+ call termopen (s: ranger_command . ' --choosefiles=' . s: choice_file_path . ' --selectfile="' . currentPath . ' "' , rangerCallback)
6369 endif
6470 startinsert
6571 endfunction
6672else
6773 function ! OpenRangerIn (path , edit_cmd)
6874 let currentPath = expand (a: path )
6975 if isdirectory (currentPath)
70- silent exec ' !ranger --choosefiles=' . s: choice_file_path . ' "' . currentPath . ' "'
76+ silent exec ' !' . s: ranger_command . ' --choosefiles=' . s: choice_file_path . ' "' . currentPath . ' "'
7177 else
72- silent exec ' !ranger --choosefiles=' . s: choice_file_path . ' --selectfile="' . currentPath . ' "'
78+ silent exec ' !' . s: ranger_command . ' --choosefiles=' . s: choice_file_path . ' --selectfile="' . currentPath . ' "'
7379 endif
7480 if filereadable (s: choice_file_path )
7581 for f in readfile (s: choice_file_path )
0 commit comments