update bin and README
This commit is contained in:
parent
5f3a75d94f
commit
1a2edbce94
|
@ -71,7 +71,7 @@ $ vim +PluginInstall +qall
|
||||||
* `let g:snips_email = "Your email"`
|
* `let g:snips_email = "Your email"`
|
||||||
* `let g:snips_github = "Your website"`
|
* `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`.
|
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/`.
|
`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 (
|
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]) == '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], $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')
|
(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]) == '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]) == 'hr')
|
||||||
||
|
||
|
||||||
(isset($html[$u + 1], $html[$u + 2]) && strtolower($html[$u + 1].$html[$u + 2]) == 'br')
|
(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 {
|
} else {
|
||||||
if (file_exists($argv[1])) {
|
if (file_exists($argv[1])) {
|
||||||
if (preg_match('/.js(on)?$/', $argv[1])) {
|
if (preg_match('/.js(on)?$/', $argv[1])) {
|
||||||
$code = shell_exec(sprintf('%s %s', '/usr/local/bin/js-beautify', escapeshellarg($argv[1])));
|
$cmd = sprintf('%s -f %s -o %s', '/usr/local/bin/js-beautify', escapeshellarg($argv[1]), escapeshellarg($argv[1]));
|
||||||
file_put_contents($argv[1], $code);
|
$code = shell_exec($cmd);
|
||||||
} elseif (preg_match('/.css$/', $argv[1])) {
|
} 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;s/ /\t/g"', 'lessc', escapeshellarg($argv[1])));
|
||||||
//$code = shell_exec(sprintf('%s %s | sed "s/\}/\}\n/g"', 'lessc', escapeshellarg($argv[1])));
|
//$code = shell_exec(sprintf('%s %s | sed "s/\}/\}\n/g"', 'lessc', escapeshellarg($argv[1])));
|
||||||
|
|
Loading…
Reference in a new issue