update bin and README

このコミットが含まれているのは:
Simon Vieille 2019-03-28 13:20:46 +01:00
コミット 1a2edbce94
署名者: deblan
GPGキーID: 03383D15A1D31745
2個のファイルの変更7行の追加3行の削除

ファイルの表示

@ -71,7 +71,7 @@ $ vim +PluginInstall +qall
* `let g:snips_email = "Your email"`
* `let g:snips_github = "Your website"`
GVim are configured to use `Fantasque Sans Mono`: https://fontlibrary.org/en/font/fantasque-sans-mono
GVim is configured to use `Fantasque Sans Mono`: https://fontlibrary.org/en/font/fantasque-sans-mono
If you want to use another one, edit `set guifont=Fantasque\ Sans\ Mono\ 14`.
`F1` is mapped to run a script named `indentation`. It's a personal and ugly script that indents the html, css and javascript. If you want to use it, you must install `node` and run `sudo cp .vim/bin/* /usr/local/bin/`.

ファイルの表示

@ -163,6 +163,8 @@ function indent($str)
if (
(isset($html[$u + 1], $html[$u + 2], $html[$u + 3]) && strtolower($html[$u + 1].$html[$u + 2].$html[$u + 3]) == 'img')
||
(isset($html[$u + 1], $html[$u + 2], $html[$u + 3]) && strtolower($html[$u + 1].$html[$u + 2].$html[$u + 3]) == 'col')
||
(isset($html[$u + 1], $html[$u + 2], $html[$u + 3], $html[$u + 4], $html[$u + 5]) && strtolower($html[$u + 1].$html[$u + 2].$html[$u + 3].$html[$u + 4].$html[$u + 5]) == 'input')
||
(isset($html[$u + 1], $html[$u + 2], $html[$u + 3], $html[$u + 4]) && strtolower($html[$u + 1].$html[$u + 2].$html[$u + 3].$html[$u + 4]) == '?xml')
@ -171,6 +173,8 @@ function indent($str)
||
(isset($html[$u + 1], $html[$u + 2], $html[$u + 3], $html[$u + 4]) && strtolower($html[$u + 1].$html[$u + 2].$html[$u + 3].$html[$u + 4]) == 'meta')
||
(isset($html[$u + 1], $html[$u + 2], $html[$u + 3], $html[$u + 4]) && strtolower($html[$u + 1].$html[$u + 2].$html[$u + 3].$html[$u + 4]) == 'path')
||
(isset($html[$u + 1], $html[$u + 2]) && strtolower($html[$u + 1].$html[$u + 2]) == 'hr')
||
(isset($html[$u + 1], $html[$u + 2]) && strtolower($html[$u + 1].$html[$u + 2]) == 'br')
@ -234,8 +238,8 @@ if (!isset($argv[1]) || (isset($argv[1]) && $argv[1] == '-')) {
} else {
if (file_exists($argv[1])) {
if (preg_match('/.js(on)?$/', $argv[1])) {
$code = shell_exec(sprintf('%s %s', '/usr/local/bin/js-beautify', escapeshellarg($argv[1])));
file_put_contents($argv[1], $code);
$cmd = sprintf('%s -f %s -o %s', '/usr/local/bin/js-beautify', escapeshellarg($argv[1]), escapeshellarg($argv[1]));
$code = shell_exec($cmd);
} elseif (preg_match('/.css$/', $argv[1])) {
$code = shell_exec(sprintf('%s %s | sed "s/\}/\}\n/g;s/ /\t/g"', 'lessc', escapeshellarg($argv[1])));
//$code = shell_exec(sprintf('%s %s | sed "s/\}/\}\n/g"', 'lessc', escapeshellarg($argv[1])));