Changing chcp breaks cmd.exe if switching from multi-byte to 65001.
cmd.exe depends on codepage to parse batchfile
so batchfile cannot have unicode characters.
Target powershell if unicode support is required.
User should fix their terminal font to display unicode characters.
Terminal programs can only use Wide String APIs.
For Vim, this requires +multi_byte feature and `set encoding=utf-8`
in the user's vimrc.
Neovim always defaults to `set encoding=utf-8`.
https://dev.to/mattn/please-stop-hack-chcp-65001-27db
git v2.10.0 adds "log.showSignature" config
so that "git log --show-signature" runs by default.
Changing the commit format via "--pretty" does not prevent the signature
from appearing.
Only "--no-show-signature" prevents this.
Close#728
Warn user if shellslash and shell are incompatible.
Set/unset shellslash for file functions on Windows. Based on 16fc6862a8/plugin/fzf.vim (L30-L107)
Support shellescape for git-bash
Windows user may not set shellslash but wish to use git-bash.
This requires custom shellescape for sh,bash shells
because builtin shellescape() depends on shellslash.
Tested on Vim
It was using s:esc() which escapes spaces with a backslash.
This does not work on Windows.
&shell could be escaped on because of spaces.
See patch-8.0.1455 and related 8.1.x patches that address this
for $SHELL on Unix and git-bash on Windows.
Related #852, #908Close#890
Having a trailing slash with &rtp entries is problematic when removing
them later: if loading on demand is used, s:reorg_rtp might fail to
remove the previous runtime paths.
Test case has been using maktaba (which triggers unsetting s:middle in
s:reorg_rtp), but because of the trailing slashes being used, the
previous rtp entries were not removed.
chcp parsing is fragile because of the system locale. There's no convenient way to parse out the codepage value without regex just by relying on cmd.exe builtins and default binaries in PATH.
Vim can be used to parse chcp output but it requires an additional `system` per `s:system` and `chcp` can change within the same console so caching the value won't work on the terminal.
Powershell supports regex but it has a long startup even with `-NoProfile` so running it when `&shell` is not powershell slows down `:PlugInstall` more.
Neovim provides `stdpath` to abstract the directory paths that it uses based on the OS. It respects `XDG` specification on Linux and uses `%LOCALAPPDATA%` on Windows.
1. Use `stdpath('data') . '/plugged'` for plugin directory.
2. Use `stdpath('config')` for user-config directory. This is `~/.config/nvim/` on Linux and `%LOCALAPPDATA%\nvim\` on Windows.
* output of chcp was not parsed correctly
On Windows, when wrapping a batch command with the function s:wrap_cmds(),
when calling 'chcp' to get the current code page, the code assumed that
the output was in the format "active code page: XXX" (where XXX is the
code page), whereas the actual output is localized (for instance, in
French, the output would be: "page de code active: XXX").
The parsing of the output relied on that, and this failed for a
message different from "active code page" (i.e., English).
This patch changes the parsing to split the output of chcp on the colon
instead of spaces. Assuming that the output is always in the format
"<localized message>: XXX", regardless of the locale, hopefully, this is
a bit more robust.
Travis defaults to it since this year.
Ubuntu trusty reached EOL since April 2019.
Ubuntu bionic provides Vim 8.
Simplify OS install with Travis' apt addon
so that only Vim nightly will be compiled from source.
Ubuntu 14.04.6 provides ruby v.1.9.3, not 1.8.x or older.
Use it to test the ruby provider for backward compatibility.
Signed-off-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Excerpt from `:h shell-powershell`:
To use powershell (on Windows):
set shell=powershell shellquote=( shellpipe=\| shellxquote=
set shellcmdflag=-NoLogo\ -NoProfile\ -ExecutionPolicy\ RemoteSigned\ -Command
set shellredir=\|\ Out-File\ -Encoding\ UTF8
Previously, `:PlugDiff` would show every new commit to a plugin's git
repo. This makes sense for the general case, but makes less sense when a
plugin lives in a subdirectory of the repo (and is configured with the
'rtp' option). This makes it difficult to determine which commits relate
to the plugin and which are unrelated.
This changes `:PlugDiff` to filter out any commits outside of the 'rtp'
folder.
Some consequences:
* This does not change the `:PlugUpdate` UI. This means `:PlugUpdate`
may pull down non-plugin commits, display that it has updated the
plugin, and then `:PlugDiff` will show no updates (since such commits
fall out of the 'rtp' path).
* It also means there's no UI to revert non-plugin updates, as they
don't show up in `:PlugDiff`.
Git v2.8 introduced support for parallel fetching of submodules. This
can result in a substantial performance boost when performing a "git
submodule update" in a repository with many submodules, potentially
further magnified when updating submodules recursively.
This commit introduces a check on the Git version to see if it supports
parallel submodule fetching. If it does, we add the '--jobs=N' argument
to our call to "git submodule update", where N is g:plug_threads or the
vim-plug default of 16.
This allows you to override the default behavior of `o' or `<cr>'
binding in PlugDiff window.
e.g.
" Move to preview window
autocmd! FileType vim-plug nmap <buffer> o <plug>(plug-preview)<c-w>P
Close#749Close#768
`writefile()` always output LF without CR each lines.
But batch file on Windows needs CR and LF, at end of lines.
And if the path of home directory contains non-ASCII
characters like Japanese username (e.g. `C:\Users\太郎`),
batch file without CR can't be executed correctly.
Close#635Close#668Close#539
Use a temporary batchfile for :!, system(), and jobs and run it in cmd.exe.
This bypasses Vim/Neovim issues in Windows and reduces the need to set more options.
Also, s:shellesc_cmd works in a batchfile only.
Set shellredir for system() in Windows
$SHELL sets the default value of 'shell' (see :h 'shell').
This affects shellredir but cmd.exe requires '>%s 2>&1'.