NG
Size: a a a
NG
v
v
let &shell='cmd.exe /k "C:\\Program\ Files\ (x86)\\Microsoft\ Visual\ Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"'
GK
:he shell-unquoting
:...
3. Inside quotes backslash preceding backslash means one backslash.
Backslash preceding quote means one quote. Backslash preceding
anything else means backslash and next character literally:
'"a\\b"' is the same as "a\b", '"a\\"b"' runs shell named literally
'a"b', '"a\b"' is the same as "a\b" again.
SB
v
NG
:echo &shell
выводит это.set shell=cmd.exe\ /k\ \"C:\\Program\ Files\ (x86)\\Microsoft\ Visual\ Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat\"Какие-то пробелы все равно не эканированы.
let&
настройку задавать.v
:he shell-unquoting
:...
3. Inside quotes backslash preceding backslash means one backslash.
Backslash preceding quote means one quote. Backslash preceding
anything else means backslash and next character literally:
'"a\\b"' is the same as "a\b", '"a\\"b"' runs shell named literally
'a"b', '"a\b"' is the same as "a\b" again.
SB
let &shell='cmd.exe /k call C:/Users/vehlwn/vim-shell.bat'
NG
SB
YS
" Taken from http://stackoverflow.com/a/6271254 and "fixed"
function! s:GetVisualSelection() abort
" Why is this not a built-in Vim script function?!
let [line_start, column_start] = getpos("'<")[1:2]
let [line_end, column_end] = getpos("'>")[1:2]
if column_end == 1
let line_end -= 1
let column_end = col([line_end, '$'])
endif
let lines = getline(line_start, line_end)
if len(lines) == 0
return ''
endif
let lines[-1] = lines[-1][: column_end - (&selection == 'inclusive' ? 1 : 2)]
let lines[0] = lines[0][column_start - 1:]
return join(lines, "\n")
endfunction
SB
" Taken from http://stackoverflow.com/a/6271254 and "fixed"
function! s:GetVisualSelection() abort
" Why is this not a built-in Vim script function?!
let [line_start, column_start] = getpos("'<")[1:2]
let [line_end, column_end] = getpos("'>")[1:2]
if column_end == 1
let line_end -= 1
let column_end = col([line_end, '$'])
endif
let lines = getline(line_start, line_end)
if len(lines) == 0
return ''
endif
let lines[-1] = lines[-1][: column_end - (&selection == 'inclusive' ? 1 : 2)]
let lines[0] = lines[0][column_start - 1:]
return join(lines, "\n")
endfunction
JC
let &shell='cmd.exe /k call C:/Users/vehlwn/vim-shell.bat'