parent
34a69f064d
commit
8d840e4077
|
@ -334,11 +334,11 @@ function! s:progress_opt(base)
|
||||||
\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
|
\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if s:is_win
|
|
||||||
function! s:rtp(spec)
|
function! s:rtp(spec)
|
||||||
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
|
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
if s:is_win
|
||||||
function! s:path(path)
|
function! s:path(path)
|
||||||
return s:trim(substitute(a:path, '/', '\', 'g'))
|
return s:trim(substitute(a:path, '/', '\', 'g'))
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -353,25 +353,29 @@ if s:is_win
|
||||||
|
|
||||||
" Copied from fzf
|
" Copied from fzf
|
||||||
function! s:wrap_cmds(cmds)
|
function! s:wrap_cmds(cmds)
|
||||||
return map(['@echo off', 'for /f "tokens=4" %%a in (''chcp'') do set origchcp=%%a', 'chcp 65001 > nul'] +
|
let use_chcp = executable('sed')
|
||||||
\ (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) +
|
return map([
|
||||||
\ ['chcp %origchcp% > nul'], 'v:val."\r"')
|
\ '@echo off',
|
||||||
|
\ 'setlocal enabledelayedexpansion']
|
||||||
|
\ + (use_chcp ? [
|
||||||
|
\ 'for /f "usebackq" %%a in (`chcp ^| sed "s/[^0-9]//gp"`) do set origchcp=%%a',
|
||||||
|
\ 'chcp 65001 > nul'] : [])
|
||||||
|
\ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds])
|
||||||
|
\ + (use_chcp ? ['chcp !origchcp! > nul'] : [])
|
||||||
|
\ + ['endlocal'],
|
||||||
|
\ 'v:val."\r"')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:batchfile(cmd)
|
function! s:batchfile(cmd)
|
||||||
let batchfile = tempname().'.bat'
|
let batchfile = tempname().'.bat'
|
||||||
call writefile(s:wrap_cmds(a:cmd), batchfile)
|
call writefile(s:wrap_cmds(a:cmd), batchfile)
|
||||||
let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 1})
|
let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0})
|
||||||
if &shell =~# 'powershell\.exe$'
|
if &shell =~# 'powershell\.exe'
|
||||||
let cmd = '& ' . cmd
|
let cmd = '& ' . cmd
|
||||||
endif
|
endif
|
||||||
return [batchfile, cmd]
|
return [batchfile, cmd]
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
function! s:rtp(spec)
|
|
||||||
return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:path(path)
|
function! s:path(path)
|
||||||
return s:trim(a:path)
|
return s:trim(a:path)
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -818,6 +822,7 @@ function! s:chsh(swap)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:bang(cmd, ...)
|
function! s:bang(cmd, ...)
|
||||||
|
let batchfile = ''
|
||||||
try
|
try
|
||||||
let [sh, shellcmdflag, shrd] = s:chsh(a:0)
|
let [sh, shellcmdflag, shrd] = s:chsh(a:0)
|
||||||
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
||||||
|
@ -831,7 +836,7 @@ function! s:bang(cmd, ...)
|
||||||
finally
|
finally
|
||||||
unlet g:_plug_bang
|
unlet g:_plug_bang
|
||||||
let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
|
let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
|
||||||
if s:is_win
|
if s:is_win && filereadable(batchfile)
|
||||||
call delete(batchfile)
|
call delete(batchfile)
|
||||||
endif
|
endif
|
||||||
endtry
|
endtry
|
||||||
|
@ -910,7 +915,7 @@ function! s:checkout(spec)
|
||||||
let output = s:system('git rev-parse HEAD', a:spec.dir)
|
let output = s:system('git rev-parse HEAD', a:spec.dir)
|
||||||
if !v:shell_error && !s:hash_match(sha, s:lines(output)[0])
|
if !v:shell_error && !s:hash_match(sha, s:lines(output)[0])
|
||||||
let output = s:system(
|
let output = s:system(
|
||||||
\ 'git fetch --depth 999999 && git checkout '.s:esc(sha).' --', a:spec.dir)
|
\ 'git fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir)
|
||||||
endif
|
endif
|
||||||
return output
|
return output
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -1028,7 +1033,7 @@ function! s:update_impl(pull, force, args) abort
|
||||||
let s:clone_opt = get(g:, 'plug_shallow', 1) ?
|
let s:clone_opt = get(g:, 'plug_shallow', 1) ?
|
||||||
\ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : ''
|
\ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : ''
|
||||||
|
|
||||||
if has('win32unix')
|
if has('win32unix') || has('wsl')
|
||||||
let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input'
|
let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1115,12 +1120,12 @@ function! s:update_finish()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
call s:log4(name, 'Checking out '.tag)
|
call s:log4(name, 'Checking out '.tag)
|
||||||
let out = s:system('git checkout -q '.s:esc(tag).' -- 2>&1', spec.dir)
|
let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir)
|
||||||
else
|
else
|
||||||
let branch = s:esc(get(spec, 'branch', 'master'))
|
let branch = get(spec, 'branch', 'master')
|
||||||
call s:log4(name, 'Merging origin/'.branch)
|
call s:log4(name, 'Merging origin/'.s:esc(branch))
|
||||||
let out = s:system('git checkout -q '.branch.' -- 2>&1'
|
let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1'
|
||||||
\. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only origin/'.branch.' 2>&1')), spec.dir)
|
\. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir)
|
||||||
endif
|
endif
|
||||||
if !v:shell_error && filereadable(spec.dir.'/.gitmodules') &&
|
if !v:shell_error && filereadable(spec.dir.'/.gitmodules') &&
|
||||||
\ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir))
|
\ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir))
|
||||||
|
@ -1164,7 +1169,7 @@ function! s:job_abort()
|
||||||
silent! call job_stop(j.jobid)
|
silent! call job_stop(j.jobid)
|
||||||
endif
|
endif
|
||||||
if j.new
|
if j.new
|
||||||
call s:system('rm -rf ' . plug#shellescape(g:plugs[name].dir))
|
call s:rm_rf(g:plugs[name].dir)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
let s:jobs = {}
|
let s:jobs = {}
|
||||||
|
@ -2000,9 +2005,9 @@ function! plug#shellescape(arg, ...)
|
||||||
let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {}
|
let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {}
|
||||||
let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh')
|
let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh')
|
||||||
let script = get(opts, 'script', 1)
|
let script = get(opts, 'script', 1)
|
||||||
if shell =~# 'cmd\.exe$'
|
if shell =~# 'cmd\.exe'
|
||||||
return s:shellesc_cmd(a:arg, script)
|
return s:shellesc_cmd(a:arg, script)
|
||||||
elseif shell =~# 'powershell\.exe$' || shell =~# 'pwsh$'
|
elseif shell =~# 'powershell\.exe' || shell =~# 'pwsh$'
|
||||||
return s:shellesc_ps1(a:arg)
|
return s:shellesc_ps1(a:arg)
|
||||||
endif
|
endif
|
||||||
return shellescape(a:arg)
|
return shellescape(a:arg)
|
||||||
|
@ -2043,6 +2048,7 @@ function! s:with_cd(cmd, dir, ...)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:system(cmd, ...)
|
function! s:system(cmd, ...)
|
||||||
|
let batchfile = ''
|
||||||
try
|
try
|
||||||
let [sh, shellcmdflag, shrd] = s:chsh(1)
|
let [sh, shellcmdflag, shrd] = s:chsh(1)
|
||||||
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
||||||
|
@ -2052,7 +2058,7 @@ function! s:system(cmd, ...)
|
||||||
return system(cmd)
|
return system(cmd)
|
||||||
finally
|
finally
|
||||||
let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
|
let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
|
||||||
if s:is_win
|
if s:is_win && filereadable(batchfile)
|
||||||
call delete(batchfile)
|
call delete(batchfile)
|
||||||
endif
|
endif
|
||||||
endtry
|
endtry
|
||||||
|
@ -2375,6 +2381,7 @@ function! s:preview_commit()
|
||||||
wincmd P
|
wincmd P
|
||||||
endif
|
endif
|
||||||
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
|
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
|
||||||
|
let batchfile = ''
|
||||||
try
|
try
|
||||||
let [sh, shellcmdflag, shrd] = s:chsh(1)
|
let [sh, shellcmdflag, shrd] = s:chsh(1)
|
||||||
let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
|
let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
|
||||||
|
@ -2384,7 +2391,7 @@ function! s:preview_commit()
|
||||||
execute 'silent %!' cmd
|
execute 'silent %!' cmd
|
||||||
finally
|
finally
|
||||||
let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
|
let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
|
||||||
if s:is_win
|
if s:is_win && filereadable(batchfile)
|
||||||
call delete(batchfile)
|
call delete(batchfile)
|
||||||
endif
|
endif
|
||||||
endtry
|
endtry
|
||||||
|
@ -2478,7 +2485,7 @@ function! s:revert()
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:system('git reset --hard HEAD@{1} && git checkout '.s:esc(g:plugs[name].branch).' --', g:plugs[name].dir)
|
call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir)
|
||||||
setlocal modifiable
|
setlocal modifiable
|
||||||
normal! "_dap
|
normal! "_dap
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
|
|
3
init.vim
3
init.vim
|
@ -1,6 +1,6 @@
|
||||||
" Syntax coloration and color theme
|
" Syntax coloration and color theme
|
||||||
syntax enable
|
syntax enable
|
||||||
set background=light
|
set background=dark
|
||||||
colorscheme solarized
|
colorscheme solarized
|
||||||
|
|
||||||
" Filetype detection
|
" Filetype detection
|
||||||
|
@ -139,6 +139,7 @@ Plug 'scrooloose/nerdtree'
|
||||||
Plug 'tpope/vim-fugitive' " git
|
Plug 'tpope/vim-fugitive' " git
|
||||||
Plug 'Xuyuanp/nerdtree-git-plugin'
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||||
Plug 'https://github.com/editorconfig/editorconfig-vim'
|
Plug 'https://github.com/editorconfig/editorconfig-vim'
|
||||||
|
Plug 'sheerun/vim-polyglot'
|
||||||
" Auto completion
|
" Auto completion
|
||||||
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
||||||
Plug 'zchee/deoplete-jedi' " source for python autocompletion
|
Plug 'zchee/deoplete-jedi' " source for python autocompletion
|
||||||
|
|
|
@ -26,3 +26,10 @@ jour-là
|
||||||
mortifères
|
mortifères
|
||||||
semble-t-il
|
semble-t-il
|
||||||
hyper-industrialisés
|
hyper-industrialisés
|
||||||
|
l'arrache-cœur
|
||||||
|
sidération
|
||||||
|
mortifère
|
||||||
|
Vivons-la
|
||||||
|
porte-conteneurs
|
||||||
|
fera-t-elle
|
||||||
|
l'anthropocène
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue