From 083187dea92a9c10fd941d0ecb58f7fcc538426d Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Sat, 14 Dec 2019 10:54:21 +0300 Subject: [PATCH 01/15] vim: set wildignorecase --- etc/soft/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/soft/vim/vimrc b/etc/soft/vim/vimrc index c7e8d3c..30fbb7c 100644 --- a/etc/soft/vim/vimrc +++ b/etc/soft/vim/vimrc @@ -155,6 +155,7 @@ set hlsearch " Подсветка результатов поиска set wrapscan " Не останавливать поиск при достижении конца файла set ignorecase " Игнорировать регистр букв при поиске set smartcase " Учитывать регистр, если есть заглавные буквы +set wildignorecase " Не учитывать регистр при дополнении команд " }}}--------------------------------------------------------------------------- From aa74ae756528a25a04eace86493e154cc243f70f Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Sun, 15 Dec 2019 16:01:23 +0300 Subject: [PATCH 02/15] bash: aliases: dfc: ++osxfuse --- etc/shell/bash/aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/shell/bash/aliases b/etc/shell/bash/aliases index 93b4bb5..cc4825e 100755 --- a/etc/shell/bash/aliases +++ b/etc/shell/bash/aliases @@ -31,7 +31,7 @@ alias less="less -R" #noindex alias lss='\ls --format=single-column' #noindex alias nl="nl -b a" #noindex alias df='df -hT' #noindex -alias dfc='dfc -t apfs,ext4,fuseblk -w' #noindex +alias dfc='dfc -t apfs,ext4,fuseblk,osxfuse -w' #noindex alias du='du -hs' #noindex alias free="free -m" #noindex alias wget='wget -c -T 5' #noindex From c20b75e2457eb4e43beb6d110eea3e2556373217 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Mon, 16 Dec 2019 14:28:56 +0300 Subject: [PATCH 03/15] macos: iterm2 --- etc/soft/iterm/com.googlecode.iterm2.plist | Bin 17272 -> 17275 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/etc/soft/iterm/com.googlecode.iterm2.plist b/etc/soft/iterm/com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 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 etc/shell/bash/bash_profile diff --git a/etc/shell/bash/bash_profile b/etc/shell/bash/bash_profile old mode 100644 new mode 100755 index a75c85c..58d307d --- a/etc/shell/bash/bash_profile +++ b/etc/shell/bash/bash_profile @@ -11,5 +11,6 @@ fi # export BASH_ENV # export PATH="~/.cw/df:$PATH" +command -v rbenv >&- && eval "$(rbenv init -)" export PATH="$HOME/.cargo/bin:$PATH" diff --git a/etc/shell/bash/bashrc_macos b/etc/shell/bash/bashrc_macos index da26e1f..18aaa0a 100644 --- a/etc/shell/bash/bashrc_macos +++ b/etc/shell/bash/bashrc_macos @@ -1,4 +1,4 @@ -PATH="$SHELLRC/bin:$SHELLRC/bin/scripts:/usr/local/opt/ruby/bin:/usr/local/opt/coreutils/libexec/gnubin/:/Applications/:~/go/bin/:~/Library/Python/3.7/bin/:$HOME/.cabal/bin:${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/bin:$PATH:~/.cargo/bin" +PATH="$SHELLRC/bin:$SHELLRC/bin/scripts:$HOME/.rbenv/shims:/usr/local/opt/coreutils/libexec/gnubin/:/Applications/:~/go/bin/:~/Library/Python/3.7/bin/:$HOME/.cabal/bin:${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/bin:$PATH:~/.cargo/bin" test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" From a8918ae859108d8b3aa883726e419d646be155c8 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Wed, 18 Dec 2019 12:59:52 +0300 Subject: [PATCH 05/15] macos: Update to Catalina --- etc/rc.darwin18 | 75 --------------------------------------------------------- etc/rc.darwin19 | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 etc/rc.darwin18 create mode 100644 etc/rc.darwin19 diff --git a/etc/rc.darwin18 b/etc/rc.darwin18 deleted file mode 100644 index 470e5ab..0000000 --- a/etc/rc.darwin18 +++ /dev/null @@ -1,75 +0,0 @@ -# --------------------------------------------------------------- -# [ GNU/LINUX ] -# --------------------------------------------------------------- - -mkdir -p ~/.config/dunst - -# --------------------------------------------------------------- - -# [ Shell ] - -+ shell/bash/bash_profile ~ -+ shell/bash/bashrc ~ -- shell/guile/guile ~ -- shell/tcl/tclshrc ~ -- shell/tcl/wishrc ~ -- shell/screen/screenrc ~ -- shell/hstr/hh_blacklist ~ - -# [ X.org ] - -- X/Xdefaults ~ -- X/XCompose ~ -- X/xinitrc.$(uname -i) ~ -- wm/gtk/gtkrc-2.0 ~ -- wm/gtk/gtk-bookmarks ~ -- wm/musca/musca_start.$(uname -i) ~ -- wm/fonts/fonts.conf ~ -+ wm/fonts/nerd-fonts ~/.fonts/ - -# [ Net ] - -- net/ssh ~ -- net/rtorrent/rtorrent.rc ~ -- net/lftp/lftprc ~ -- net/snownews ~ -- mail/mailcap/mailcap ~ -- mail/procmail/procmailrc ~ - -# [ Soft ] - -- media/ncmpcpp ~ -- media/moc ~ -- media/scmpc ~ -- soft/bar/barrc ~ -- soft/conky/conkyrc.$(uname -i) ~ -- soft/ctags/ctags ~ -- soft/htop ~/.config -- soft/dunst/dunstrc ~/.config/dunst -- soft/mc ~/.config -+ soft/vim/vim ~ -+ soft/nvim ~/.config -+ soft/vifm ~ -+ soft/vim/vimrc ~ -- soft/vimperator ~ -- soft/vimperator/vimperatorrc ~ -+ soft/git/gitconfig ~ -- soft/git/gitk ~ -+ soft/iterm/com.googlecode.iterm2.plist ~/Library/Preferences/ -- soft/stalonetray/stalonetrayrc ~ - -: --------------------------------------------------------------- - -mkdir -pv ../var/{shell,log,mpd,scmpc,vim} -mkdir -pv ../var/vim/{backup,undo,mru,swp,view,yankring} -mkdir -pv net/ssh/sessions - -: --------------------------------------------------------------- - -#xdg-mime default zathura.desktop application/pdf -#xdg-mime default gpicview.desktop image/gif -#xdg-mime default gpicview.desktop image/jpg -#xdg-mime default gpicview.desktop image/png - -: --------------------------------------------------------------- - diff --git a/etc/rc.darwin19 b/etc/rc.darwin19 new file mode 100644 index 0000000..6568eff --- /dev/null +++ b/etc/rc.darwin19 @@ -0,0 +1,75 @@ +# --------------------------------------------------------------- +# [ GNU/LINUX ] +# --------------------------------------------------------------- + +mkdir -p ~/.config/dunst + +# --------------------------------------------------------------- + +# [ Shell ] + ++ shell/bash/bash_profile ~ ++ shell/bash/bashrc ~ +- shell/guile/guile ~ +- shell/tcl/tclshrc ~ +- shell/tcl/wishrc ~ +- shell/screen/screenrc ~ +- shell/hstr/hh_blacklist ~ + +# [ X.org ] + +- X/Xdefaults ~ +- X/XCompose ~ +- X/xinitrc.$(uname -i) ~ +- wm/gtk/gtkrc-2.0 ~ +- wm/gtk/gtk-bookmarks ~ +- wm/musca/musca_start.$(uname -i) ~ +- wm/fonts/fonts.conf ~ ++ wm/fonts/nerd-fonts ~/.fonts/ + +# [ Net ] + +- net/ssh ~ +- net/rtorrent/rtorrent.rc ~ +- net/lftp/lftprc ~ +- net/snownews ~ +- mail/mailcap/mailcap ~ +- mail/procmail/procmailrc ~ + +# [ Soft ] + +- media/ncmpcpp ~ +- media/moc ~ +- media/scmpc ~ +- soft/bar/barrc ~ +- soft/conky/conkyrc.$(uname -i) ~ +- soft/ctags/ctags ~ +- soft/htop ~/.config +- soft/dunst/dunstrc ~/.config/dunst +- soft/mc ~/.config ++ soft/vim/vim ~ ++ soft/nvim ~/.config ++ soft/vifm ~ ++ soft/vim/vimrc ~ +- soft/vimperator ~ +- soft/vimperator/vimperatorrc ~ +- soft/git/gitconfig ~ +- soft/git/gitk ~ ++ soft/iterm/com.googlecode.iterm2.plist ~/Library/Preferences/ +- soft/stalonetray/stalonetrayrc ~ + +: --------------------------------------------------------------- + +mkdir -pv ../var/{shell,log,mpd,scmpc,vim} +mkdir -pv ../var/vim/{backup,undo,mru,swp,view,yankring} +mkdir -pv net/ssh/sessions + +: --------------------------------------------------------------- + +#xdg-mime default zathura.desktop application/pdf +#xdg-mime default gpicview.desktop image/gif +#xdg-mime default gpicview.desktop image/jpg +#xdg-mime default gpicview.desktop image/png + +: --------------------------------------------------------------- + From 32a672607691b19f3c6c319a7e22c9afe743f20a Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Thu, 19 Dec 2019 20:46:19 +0300 Subject: [PATCH 06/15] hstr: Adjust variables and add blacklist file --- .gitignore | 2 -- etc/rc.darwin19 | 2 +- etc/rc.linux-gnu | 2 +- etc/shell/bash/bashrc | 5 +++-- etc/shell/hstr/hstr_blacklist | 47 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 etc/shell/hstr/hstr_blacklist diff --git a/.gitignore b/.gitignore index 7389bed..df56b98 100644 --- a/.gitignore +++ b/.gitignore @@ -29,8 +29,6 @@ etc/net/ssh/* etc/shell/cw -etc/shell/hstr/hh_blacklist - etc/soft/antiword etc/soft/figlet etc/soft/jodconverter diff --git a/etc/rc.darwin19 b/etc/rc.darwin19 index 6568eff..f288b3e 100644 --- a/etc/rc.darwin19 +++ b/etc/rc.darwin19 @@ -14,7 +14,7 @@ mkdir -p ~/.config/dunst - shell/tcl/tclshrc ~ - shell/tcl/wishrc ~ - shell/screen/screenrc ~ -- shell/hstr/hh_blacklist ~ ++ shell/hstr/hstr_blacklist ~ # [ X.org ] diff --git a/etc/rc.linux-gnu b/etc/rc.linux-gnu index c4849e2..936d67d 100644 --- a/etc/rc.linux-gnu +++ b/etc/rc.linux-gnu @@ -14,7 +14,7 @@ mkdir -p ~/.config/dunst + shell/tcl/tclshrc ~ + shell/tcl/wishrc ~ - shell/screen/screenrc ~ -+ shell/hstr/hh_blacklist ~ ++ shell/hstr/hstr_blacklist ~ # [ X.org ] diff --git a/etc/shell/bash/bashrc b/etc/shell/bash/bashrc index 81548ae..9ee4a64 100755 --- a/etc/shell/bash/bashrc +++ b/etc/shell/bash/bashrc @@ -1,6 +1,6 @@ #!/bin/bash #################################################################### # -# Изменён: чт 14 ноя 2019 00:41:12 +# Изменён: чт 19 дек 2019 20:41:05 # ################################################################################ @@ -16,7 +16,8 @@ export INPUTRC="$BASHRC/inputrc" #Файл inputrc export GTK_IM_MODULE="xim" #Метод ввода Χ export QT_IM_MODULE="xim" #Метод ввода Χ -export HH_CONFIG="keywords,blacklist,rawhistory" #hstr +export HSTR_CONFIG="keywords-matching,blacklist,hicolor" #hstr +export HSTR_PROMPT="> " export STARDICT_DATA_DIR=$SHELLRC/etc/soft/sdcv/dictionaries/ export SDCV_HISTSIZE=10000 diff --git a/etc/shell/hstr/hstr_blacklist b/etc/shell/hstr/hstr_blacklist new file mode 100644 index 0000000..9b40ab1 --- /dev/null +++ b/etc/shell/hstr/hstr_blacklist @@ -0,0 +1,47 @@ +startx +.shellrc/ +dus +alsamixer +,ww +ping ya.ru +,w,w +htop +g url +g df . +g p +g u +vifm +hstr +dus * +dus . +vim +docker ps +make +mpd +.shellrc +g lf +g st +g lu +g ls +docker images +,m +.. +.- +g add . +~ +reload +:q +g u | sh +geeqie . +mutt +g df +easytag . +./Downloads/ +cd +hh +kz +mc +ls +g st . +su +shutdown -h now From d29b4443b8b77cb85f76b26eb25e00fff57bcfb1 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Fri, 20 Dec 2019 22:01:14 +0300 Subject: [PATCH 07/15] bash: Remove unused aliases --- etc/shell/bash/aliases | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/etc/shell/bash/aliases b/etc/shell/bash/aliases index cc4825e..9b55d0b 100755 --- a/etc/shell/bash/aliases +++ b/etc/shell/bash/aliases @@ -7,15 +7,13 @@ alias ~='cd ~' #noindex alias ..='cd ..' #noindex alias .-='cd -' #noindex -alias pd="pushd" #noindex -alias po="popd" #noindex #- Удаление, перемещение и копирование с подтверждением #+ Строка прогресса: #+ http://beatex.org/web/advancedcopy.html #+ https://github.com/mrdrogdrog/advcpmv -alias mv='mv -g -i -v' #noindex -alias cp='cp -g -i -v -r' #noindex +# alias mv='mv -g -i -v' #noindex +# alias cp='cp -g -i -v -r' #noindex alias mv='mv -i -v' #noindex alias cp='cp -i -v -r' #noindex @@ -44,7 +42,6 @@ alias pstree="pstree -U -h" #noindex alias mkdir="mkdir -p -v" #noindex alias j="jobs -l" #noindex alias dirs="dirs -v" #noindex -alias gq="geeqie . &" #noindex alias emerge="emerge --ask" #noindex alias rg='rg --no-heading --smart-case --color=auto --colors "match:bg:yellow" --colors "match:fg:blue"' #noindex alias eww='emerge --update --newuse --deep --with-bdeps=y --complete-graph=y --keep-going=y -av --verbose-conflicts -t @world' #noindex @@ -64,7 +61,6 @@ alias figlet="figlet -f $SHELLRC/etc/soft/figlet/fonts/standard.flf" #noindex alias zathura="nh zathura" #noindex alias z="nh zathura" #noindex alias kz="killall zathura" #noindex -alias sendemail="sendemail -l $LOGDIR/sendemail" #noindex alias g=git #noindex alias startx="xinit -- /usr/bin/X" #noindex alias lftp="LFTP_HOME=$SHELLRC/etc/net/lftp lftp" #noindex From 47906b12144b404becf6984e6df9fd56819e61fe Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Sun, 22 Dec 2019 19:16:03 +0300 Subject: [PATCH 08/15] Add linters: eslint --- etc/rc.darwin19 | 1 + etc/rc.linux-gnu | 1 + etc/soft/linters/eslintrc | 210 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 etc/soft/linters/eslintrc diff --git a/etc/rc.darwin19 b/etc/rc.darwin19 index f288b3e..f61e065 100644 --- a/etc/rc.darwin19 +++ b/etc/rc.darwin19 @@ -57,6 +57,7 @@ mkdir -p ~/.config/dunst - soft/git/gitk ~ + soft/iterm/com.googlecode.iterm2.plist ~/Library/Preferences/ - soft/stalonetray/stalonetrayrc ~ ++ soft/linters/eslintrc ~ : --------------------------------------------------------------- diff --git a/etc/rc.linux-gnu b/etc/rc.linux-gnu index 936d67d..555b291 100644 --- a/etc/rc.linux-gnu +++ b/etc/rc.linux-gnu @@ -57,6 +57,7 @@ mkdir -p ~/.config/dunst - soft/git/gitk ~ + soft/stalonetray/stalonetrayrc ~ + media/alsa/asoundrc ~ ++ soft/linters/eslintrc ~ : --------------------------------------------------------------- diff --git a/etc/soft/linters/eslintrc b/etc/soft/linters/eslintrc new file mode 100644 index 0000000..0613776 --- /dev/null +++ b/etc/soft/linters/eslintrc @@ -0,0 +1,210 @@ +{ + "parserOptions": { + "ecmaVersion": 2020, + "ecmaFeatures": { + "jsx": true + }, + "sourceType": "module" + }, + + "env": { + "es6": true, + "node": true + }, + + "globals": { + "document": "readonly", + "navigator": "readonly", + "window": "readonly" + }, + + "rules": { + "accessor-pairs": "error", + "array-bracket-spacing": ["error", "never"], + "arrow-spacing": ["error", { "before": true, "after": true }], + "block-spacing": ["error", "always"], + "brace-style": ["error", "1tbs", { "allowSingleLine": true }], + "camelcase": ["off", { "properties": "never" }], + "comma-dangle": ["error", { + "arrays": "never", + "objects": "never", + "imports": "never", + "exports": "never", + "functions": "never" + }], + "comma-spacing": ["error", { "before": false, "after": true }], + "comma-style": ["error", "last"], + "computed-property-spacing": ["error", "never"], + "constructor-super": "error", + "curly": ["error", "multi-line"], + "dot-location": ["error", "property"], + "dot-notation": ["error", { "allowKeywords": true }], + "eol-last": "error", + "eqeqeq": ["error", "always", { "null": "ignore" }], + "func-call-spacing": ["error", "never"], + "generator-star-spacing": ["error", { "before": true, "after": true }], + "handle-callback-err": ["error", "^(err|error)$" ], + "indent": ["off", 2, { + "SwitchCase": 1, + "VariableDeclarator": 1, + "outerIIFEBody": 1, + "MemberExpression": 1, + "FunctionDeclaration": { "parameters": 1, "body": 1 }, + "FunctionExpression": { "parameters": 1, "body": 1 }, + "CallExpression": { "arguments": 1 }, + "ArrayExpression": 1, + "ObjectExpression": 1, + "ImportDeclaration": 1, + "flatTernaryExpressions": false, + "ignoreComments": false, + "ignoredNodes": ["TemplateLiteral *"] + }], + "key-spacing": ["error", { "beforeColon": false, "afterColon": true }], + "keyword-spacing": ["error", { "before": true, "after": true }], + "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], + "new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }], + "new-parens": "error", + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-caller": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": ["error", { "checkLoops": false }], + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-boolean-cast": "error", + "no-extra-parens": ["error", "functions"], + "no-fallthrough": "error", + "no-floating-decimal": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implied-eval": "error", + "no-inner-declarations": ["error", "functions"], + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-labels": ["error", { "allowLoop": false, "allowSwitch": false }], + "no-lone-blocks": "error", + "no-misleading-character-class": "error", + "no-prototype-builtins": "error", + "no-useless-catch": "error", + "no-mixed-operators": ["error", { + "groups": [ + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + "allowSamePrecedence": true + }], + "no-mixed-spaces-and-tabs": "error", + "no-multi-spaces": "off", + "no-multi-str": "off", + "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }], + "no-negated-in-lhs": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-require": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-path-concat": "error", + "no-proto": "error", + "no-redeclare": ["error", { "builtinGlobals": false }], + "no-regex-spaces": "error", + "no-return-assign": ["error", "except-parens"], + "no-return-await": "error", + "no-self-assign": ["error", { "props": true }], + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-tabs": "off", + "no-template-curly-in-string": "error", + "no-this-before-super": "error", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-undef-init": "error", + "no-unexpected-multiline": "error", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": ["error", { "defaultAssignment": false }], + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }], + "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }], + "no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }], + "no-useless-call": "error", + "no-useless-computed-key": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-void": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-curly-newline": ["error", { "multiline": true, "consistent": true }], + "object-curly-spacing": ["error", "always"], + "object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }], + "one-var": ["error", { "initialized": "never" }], + "operator-linebreak": ["off", "after", { "overrides": { "?": "before", ":": "before", "|>": "before" } }], + "padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }], + "prefer-const": ["error", {"destructuring": "all"}], + "prefer-promise-reject-errors": "error", + "quote-props": ["error", "as-needed"], + "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }], + "rest-spread-spacing": ["error", "never"], + "semi": ["off", "never"], + "semi-spacing": ["error", { "before": false, "after": true }], + "space-before-blocks": ["error", "always"], + "space-before-function-paren": ["off", "always"], + "space-in-parens": ["error", "never"], + "space-infix-ops": "error", + "space-unary-ops": ["error", { "words": true, "nonwords": false }], + "spaced-comment": ["error", "always", { + "line": { "markers": ["*package", "!", "/", ",", "="] }, + "block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] } + }], + "symbol-description": "error", + "template-curly-spacing": ["error", "never"], + "template-tag-spacing": ["error", "never"], + "unicode-bom": ["error", "never"], + "use-isnan": "error", + "valid-typeof": ["error", { "requireStringLiterals": true }], + "wrap-iife": ["error", "any", { "functionPrototypeMethods": true }], + "yield-star-spacing": ["error", "both"], + "yoda": ["error", "never"], + + "import/export": "off", + "import/first": "off", + "import/no-absolute-path": ["off", { "esmodule": true, "commonjs": true, "amd": false }], + "import/no-duplicates": "off", + "import/no-named-default": "off", + "import/no-webpack-loader-syntax": "off", + + "node/no-deprecated-api": "off", + "node/process-exit-as-throw": "off", + + "promise/param-names": "off", + + "standard/no-callback-literal": "off" + } +} + From d95ca3eacd8752e7775d7e7940250467470dadbd Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Tue, 24 Dec 2019 12:55:18 +0300 Subject: [PATCH 09/15] git: Fix git up alias --- etc/soft/git/gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/soft/git/gitconfig b/etc/soft/git/gitconfig index 7b5b089..71a8781 100644 --- a/etc/soft/git/gitconfig +++ b/etc/soft/git/gitconfig @@ -79,7 +79,7 @@ u = "!echo git push origin $(git rev-parse --abbrev-ref HEAD)" # git push во все репозитории - up = "!git remote -v | awk '{ print $1 }' | uniq | xargs -IL echo git push L $(git cb | awk '{ print $2 }')" + up = "!git remote -v | awk '{ print $1 }' | uniq | xargs -IL echo git push L $(git branch | awk '/*/ { print $2 }')" # Корневая директория репозитория root = rev-parse --show-toplevel From f30c87a4ee3ad6da66f8bc783f0f10c20e14e8b2 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Fri, 27 Dec 2019 00:34:37 +0300 Subject: [PATCH 10/15] vifm: Configure various fileviewers --- etc/soft/vifm/filetypes | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/etc/soft/vifm/filetypes b/etc/soft/vifm/filetypes index cdcebde..7496a2c 100644 --- a/etc/soft/vifm/filetypes +++ b/etc/soft/vifm/filetypes @@ -4,10 +4,10 @@ filetype *.vk vkdigest.py -f %f -c | w3m -T text/html " Текстовые форматы fileviewer *.doc antiword %f -fileviewer *.docx docx2txt %f - +fileviewer *.docx docx2txt %f -, pandoc -t plain %f fileviewer *.odt odt2txt %f fileviewer *.rtf catdoc %f -fileviewer *.fb2,*.fb2.zip fb2 %f +fileviewer *.fb2,*.fb2.zip fb2 %f, pandoc -t plain %f " Бинарные файлы fileviewer *.bin,*.dat file %f @@ -24,12 +24,12 @@ filetype *.bmp,*.jpg,*.jpeg,*.png,*.gif sxiv %c %d/, x-open %c filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif sxiv %c %d/, x-open %c filextype *.svg sensible-browser %f & " fileviewer *.jpg,*.png lsimg %d/%f %q %pc -fileviewer *.jpg,*.png exiv2 %f +fileviewer *.jpg,*.jpeg,*.png,*.gif exiftool %f, exiv2 %f " audio filextype *.mp3,*.wav,*.flac,*.ogg,*.m4a vlc %f & -fileviewer *.mp3 mp3info %f +fileviewer *.mp3 exiftool %f,mp3info %f " video filextype *.avi,*.mp4,*.wmv,*.3gp,*.ogv,*.mkv,*.mpg,*.vob,*.flv,*.mov @@ -44,7 +44,7 @@ filextype *.doc,*.docx,*.xls,*.xlsx,*.rtf,*.ppt,*.pptx,*.pps,*.odt,*.ott,*.sxw,* " pdf filetype *.pdf zathura %f &, x-open %f -fileviewer *.pdf pdftotext -nopgbrk %f - +fileviewer *.pdf pdftotext -enc UTF-8 -nopgbrk %f - " djvu filextype *.djvu @@ -57,8 +57,13 @@ filetype *.djvu apvlv %f & " ebooks filextype *.fb2,*.mobi,*.epub,*.chm,*.fb2.zip pybr %f &, x-open %f +fileviewer *.epub pandoc -t plain %f + " markdown -" fileviewer *.md mdcat %c +fileviewer *.md glow -s light %c, mdcat %c + +" sqlite +fileviewer *.sqlite sqlite3 -list -header %c 'SELECT name FROM sqlite_master WHERE type="table";' | sort | nl " web-страницы filetype *.html,*.htm x-open %f From 2d9dcb819b9ceebb5c7759a783c51936340fa332 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Wed, 29 Jan 2020 13:49:17 +0300 Subject: [PATCH 11/15] git: ++cmadd --- etc/soft/git/gitconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/soft/git/gitconfig b/etc/soft/git/gitconfig index 71a8781..077fddb 100644 --- a/etc/soft/git/gitconfig +++ b/etc/soft/git/gitconfig @@ -61,6 +61,9 @@ # Коммит с сообщением cm = commit -m + # Добавление изменений в последний коммит + cmadd = commit --amend --no-edit + # Коммит от имени envrm cma = commit --author 'Maxim Likhachev ' -m From bcfcd0dcf08434ed3eff0e1c60d5b3e4345b8af6 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Wed, 29 Jan 2020 13:49:35 +0300 Subject: [PATCH 12/15] vifm: ansible-vault --- etc/soft/vifm/commands | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/soft/vifm/commands b/etc/soft/vifm/commands index 6cb1890..1b341e0 100644 --- a/etc/soft/vifm/commands +++ b/etc/soft/vifm/commands @@ -35,6 +35,8 @@ command diff vimdiff %f %F command run !! ./%f command vim !nvim %f +command vault !ansible-vault edit %f + command cal cal -y %m command xc xc %c From e71b367b7827f6a190909fc0a82205fbd1c161d7 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Fri, 31 Jan 2020 21:16:19 +0300 Subject: [PATCH 13/15] vim: ++vim-floaterm --- etc/soft/vim/vim/+plugins/vim-floaterm/LICENSE | 21 ++ etc/soft/vim/vim/+plugins/vim-floaterm/README.md | 127 ++++++++ .../+plugins/vim-floaterm/autoload/floaterm.vim | 323 +++++++++++++++++++++ .../vim-floaterm/autoload/floaterm/util.vim | 149 ++++++++++ .../vim/vim/+plugins/vim-floaterm/doc/floaterm.txt | 160 ++++++++++ .../vim/+plugins/vim-floaterm/plugin/floaterm.vim | 47 +++ etc/soft/vim/vimrc | 19 +- 7 files changed, 842 insertions(+), 4 deletions(-) create mode 100644 etc/soft/vim/vim/+plugins/vim-floaterm/LICENSE create mode 100644 etc/soft/vim/vim/+plugins/vim-floaterm/README.md create mode 100644 etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm.vim create mode 100644 etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm/util.vim create mode 100644 etc/soft/vim/vim/+plugins/vim-floaterm/doc/floaterm.txt create mode 100644 etc/soft/vim/vim/+plugins/vim-floaterm/plugin/floaterm.vim diff --git a/etc/soft/vim/vim/+plugins/vim-floaterm/LICENSE b/etc/soft/vim/vim/+plugins/vim-floaterm/LICENSE new file mode 100644 index 0000000..3e3ad47 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-floaterm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 voldikss + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/etc/soft/vim/vim/+plugins/vim-floaterm/README.md b/etc/soft/vim/vim/+plugins/vim-floaterm/README.md new file mode 100644 index 0000000..3578523 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-floaterm/README.md @@ -0,0 +1,127 @@ +# vim-floaterm + +[![Build Status](https://travis-ci.org/voldikss/vim-floaterm.svg?branch=master)](https://travis-ci.org/voldikss/vim-floaterm) + +Use neovim terminal in the floating window. + +![](https://user-images.githubusercontent.com/20282795/71553203-f59c6980-2a45-11ea-88f2-747e938f7f49.gif) + +## Installation + +- vim-plug + +```vim +Plug 'voldikss/vim-floaterm' +``` + +- dein.nvim + +```vim +call dein#add('voldikss/vim-floaterm') +``` + +## Keymaps + +This plugin doesn't supply any default mappings. + +```vim +""" Example configuration +let g:floaterm_keymap_new = '' +let g:floaterm_keymap_prev = '' +let g:floaterm_keymap_next = '' +let g:floaterm_keymap_toggle = '' +``` + +## Features + +- Toggle terminal window quickly +- Multiple terminal instances +- Customizable floating terminal style +- Switch/Preview floating terminal buffer using [vim-clap](https://github.com/liuchengxu/vim-clap)(try `:Clap floaterm`) + +## Configurations + +#### **`g:floaterm_type`** + +- Available: `'floating'`(neovim only), `'normal'`(vim8 and neovim) + +- Default: `'floating'` + +#### **`g:floaterm_width`** + +- Type: `int` (number of columns) or `float` (between 0 and 1). If `float`, the width is relative to `&columns`. +- Default: `0.6` + +#### **`g:floaterm_height`** + +- Type: `int` (number of lines) or `float` (between 0 and 1). If `float`, the height is relative to `&lines`. +- Default: `0.6` + +#### `g:floaterm_winblend` + +- Description: The opacity of the floating terminal + +- Default: `0` + +#### **`g:floaterm_position`** + +- Available: `'center'`, `'topleft'`, `'topright'`, `'bottomleft'`, `'bottomright'`, `'auto'(at the cursor place)` + +- Default: `'center'` + +#### **`g:floaterm_background`** + +- Type: string(e.g. `'#000000'`, `'black'`) + +- Default: background color of normal floating window + +#### **`g:floaterm_borderchars`** + +- Default: `['─', '│', '─', '│', '┌', '┐', '┘', '└']` + +#### **`g:floaterm_border_color`** + +- Type: string(e.g. `'#FFFFFF'`, `'blue'`) + +- Default: foreground color of normal floating window + +## Commands + +- `:FloatermNew` + +- `:FloatermToggle` + +- `:FloatermPrev` + +- `:FloatermNext` + +## Q & A + +- #### This plugin leaves an empty buffer on startify window + + Put this code in `vimrc` + + ```vim + autocmd User Startified setlocal buflisted + ``` + +- #### I want to use another shell in the terminal. (e.g. Use fish instead of bash) + + Set `shell` option in your `vimrc`: + + ```vim + set shell=/path/to/shell + ``` + +- #### I would like to customize the style of the floating terminal window + + Use `autocmd`. For example + + ```vim + function s:floatermSettings() + setlocal number + " more settings + endfunction + + autocmd FileType floaterm call s:floatermSettings() + ``` diff --git a/etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm.vim b/etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm.vim new file mode 100644 index 0000000..f545bab --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm.vim @@ -0,0 +1,323 @@ +" ============================================================================ +" FileName: autocmd/floaterm.vim +" Description: +" Author: voldikss +" GitHub: https://github.com/voldikss +" ============================================================================ + +" `hidden` option must be set, otherwise the floating terminal would be wiped +" out, see #17 +set hidden + +" Note: +" The data structure of the floaterm chain is a double circular linkedlist +" g:floaterm.count is the count of the terminal node +" g:floaterm.index is the pointer +" g:floaterm.head is the HEAD node which only have 'prev' and 'next' +" g:floaterm_node is the node prototype to create a terminal node +let g:floaterm = {} +let g:floaterm.count = 0 +let g:floaterm.head = {} +let g:floaterm.head.next = g:floaterm.head +let g:floaterm.head.prev = g:floaterm.head +let g:floaterm.index = g:floaterm.head + +let g:floaterm_node = { + \ 'bufnr': 0, + \ 'border_bufnr': 0, + \ 'next': v:null, + \ 'prev': v:null + \ } + +if g:floaterm_border_color == v:null + let g:floaterm_border_color = floaterm#util#get_normalfloat_fg() +endif + +if g:floaterm_background == v:null + let g:floaterm_background = floaterm#util#get_normalfloat_bg() +endif + +" Remove a node if it was closed(the buffer doesn't exist) +function! g:floaterm.kickout() dict abort + if self.count == 0 | return | endif + let self.index.prev.next = self.index.next + let self.index.next.prev = self.index.prev + let self.count -= 1 +endfunction + +function! g:floaterm.toggle() dict abort + let found_winnr = self.find_term_win() + if found_winnr > 0 + if &buftype ==# 'terminal' + execute found_winnr . ' wincmd q' + else + execute found_winnr . ' wincmd w | startinsert' + endif + else + while v:true + if self.count == 0 + call self.open(0) + return + endif + " If the current node is HEAD(which doesn't have 'bufnr' key), + " skip and point to the node after HEAD + if self.index == self.head + let self.index = self.head.next + endif + let found_bufnr = self.index.bufnr + if found_bufnr != 0 && bufexists(found_bufnr) + call self.open(found_bufnr) + return + else + call self.kickout() + let self.index = self.index.next + endif + endwhile + endif +endfunction + +function! g:floaterm.new() dict abort + call self.hide() + call self.open(0) +endfunction + +function! g:floaterm.next() dict abort + call self.hide() + while v:true + if self.count == 0 + call floaterm#util#show_msg('No more terminal buffers', 'warning') + return + endif + " If the current node is the end node(whose next node is HEAD), + " skip and point to the HEAD's next node + if self.index.next == self.head + let self.index = self.head.next + else + let self.index = self.index.next + endif + let next_bufnr = self.index.bufnr + if next_bufnr != 0 && bufexists(next_bufnr) + call self.open(next_bufnr) + return + else + call self.kickout() + endif + endwhile +endfunction + +function! g:floaterm.prev() dict abort + call self.hide() + while v:true + if self.count == 0 + call floaterm#util#show_msg('No more terminal buffers', 'warning') + return + endif + " If the current node is the node after HEAD(whose previous node is HEAD), + " skip and point to the HEAD's prev node(the end node) + if self.index.prev == self.head + let self.index = self.head.prev + else + let self.index = self.index.prev + endif + let prev_bufnr = self.index.bufnr + if prev_bufnr != 0 && bufexists(prev_bufnr) + call self.open(prev_bufnr) + return + else + call self.kickout() + endif + endwhile +endfunction + +" Hide the current terminal before opening another terminal window +" Therefore, you cannot have two terminals displayed at once +function! g:floaterm.hide() dict abort + while v:true + let found_winnr = self.find_term_win() + if found_winnr > 0 + execute found_winnr . ' wincmd q' + else + break + endif + endwhile +endfunction + +" Find if there is a terminal among all opened windows +" If found, hide it or jump into it +function! g:floaterm.find_term_win() abort + let found_winnr = 0 + for winnr in range(1, winnr('$')) + if getbufvar(winbufnr(winnr), '&filetype') ==# 'floaterm' + let found_winnr = winnr + endif + endfor + return found_winnr +endfunction + +function! g:floaterm.open(found_bufnr) dict abort + let height = g:floaterm_height == v:null ? 0.6 : g:floaterm_height + if type(height) == v:t_float | let height = height * &lines | endif + let height = float2nr(height) + + let width = g:floaterm_width == v:null ? 0.6 : g:floaterm_width + if type(width) == v:t_float | let width = width * &columns | endif + let width = float2nr(width) + + if g:floaterm_type ==# 'floating' + let [bufnr, border_bufnr] = s:open_floating_terminal(a:found_bufnr, height, width) + else + let bufnr = s:open_floating_normaml(a:found_bufnr, height, width) + let border_bufnr = 0 + endif + if bufnr != 0 + " Build a terminal node + let node = deepcopy(g:floaterm_node) + let node.bufnr = bufnr + let node.prev = self.index + let node.next = self.index.next + " If current node is the end node, let HEAD's prev point to the new node + if self.index.next == self.head + let self.head.prev = node + endif + let self.index.next = node + let self.index = self.index.next + let self.count += 1 + endif + if border_bufnr != 0 + let self.index.border_bufnr = border_bufnr + endif + call s:on_open() +endfunction + +function! s:on_open() abort + setlocal cursorline + setlocal filetype=floaterm + + " Find the true background(not 'hi link') for floating + if has('nvim') + execute 'setlocal winblend=' . g:floaterm_winblend + execute 'hi FloatTermNormal term=NONE guibg='. g:floaterm_background + setlocal winhighlight=NormalFloat:FloatTermNormal,FoldColumn:FloatTermNormal + + augroup close_floaterm_window + autocmd! + autocmd TermClose if &filetype ==# 'floaterm' | + \ bdelete! | + \ endif + autocmd TermClose,BufHidden if exists('g:floaterm.index.border_bufnr') + \ && bufexists(g:floaterm.index.border_bufnr) + \ && g:floaterm.index.border_bufnr != 0 | + \ execute 'bw ' . g:floaterm.index.border_bufnr | + \ endif + augroup END + endif + + startinsert +endfunction + +function! s:open_floating_terminal(found_bufnr, height, width) abort + let [row, col, vert, hor] = floaterm#util#floating_win_pos(a:width, a:height) + + let border_opts = { + \ 'relative': 'editor', + \ 'anchor': vert . hor, + \ 'row': row, + \ 'col': col, + \ 'width': a:width + 2, + \ 'height': a:height + 2, + \ 'style':'minimal' + \ } + let top = g:floaterm_borderchars[4] . + \ repeat(g:floaterm_borderchars[0], a:width) . + \ g:floaterm_borderchars[5] + let mid = g:floaterm_borderchars[3] . + \ repeat(' ', a:width) . + \ g:floaterm_borderchars[1] + let bot = g:floaterm_borderchars[7] . + \ repeat(g:floaterm_borderchars[2], a:width) . + \ g:floaterm_borderchars[6] + let lines = [top] + repeat([mid], a:height) + [bot] + let border_bufnr = nvim_create_buf(v:false, v:true) + call nvim_buf_set_option(border_bufnr, 'synmaxcol', 3000) " #27 + call nvim_buf_set_lines(border_bufnr, 0, -1, v:true, lines) + call nvim_open_win(border_bufnr, v:false, border_opts) + " Floating window border highlight + augroup floaterm_border_highlight + autocmd! + autocmd FileType floaterm_border ++once execute printf( + \ 'syn match Border /.*/ | hi Border guibg=%s guifg=%s', + \ g:floaterm_background, + \ g:floaterm_border_color + \ ) + augroup END + call nvim_buf_set_option(border_bufnr, 'filetype', 'floaterm_border') + + "" + " TODO: + " Use 'relative': 'cursor' for the border window + " Use 'relative':'win'(which behaviors not as expected...) for content window + let opts = { + \ 'relative': 'editor', + \ 'anchor': vert . hor, + \ 'row': row + (vert ==# 'N' ? 1 : -1), + \ 'col': col + (hor ==# 'W' ? 1 : -1), + \ 'width': a:width, + \ 'height': a:height, + \ 'style':'minimal' + \ } + + if a:found_bufnr > 0 + call nvim_open_win(a:found_bufnr, v:true, opts) + return [0, border_bufnr] + else + let bufnr = nvim_create_buf(v:false, v:true) + call nvim_open_win(bufnr, v:true, opts) + terminal + return [bufnr, border_bufnr] + endif +endfunction + +function! s:open_floating_normaml(found_bufnr, height, width) abort + if a:found_bufnr > 0 + if &lines > 30 + execute 'botright ' . a:height . 'split' + execute 'buffer ' . a:found_bufnr + else + botright split + execute 'buffer ' . a:found_bufnr + endif + return + else + if &lines > 30 + if has('nvim') + execute 'botright ' . a:height . 'split term://' . &shell + else + botright terminal + resize a:height + endif + else + if has('nvim') + execute 'botright split term://' . &shell + else + botright terminal + endif + endif + return bufnr('%') + endif +endfunction + +function! floaterm#start(action) abort + if !floaterm#util#is_floaterm_available() + return + endif + + if a:action ==# 'new' + call g:floaterm.new() + elseif a:action ==# 'next' + call g:floaterm.next() + elseif a:action ==# 'prev' + call g:floaterm.prev() + elseif a:action ==# 'toggle' + call g:floaterm.toggle() + endif +endfunction diff --git a/etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm/util.vim b/etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm/util.vim new file mode 100644 index 0000000..8e2e7b0 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-floaterm/autoload/floaterm/util.vim @@ -0,0 +1,149 @@ +" ============================================================================ +" FileName: autoload/floaterm/util.vim +" Description: +" Author: voldikss +" GitHub: https://github.com/voldikss +" ============================================================================ + +function! floaterm#util#floating_win_pos(width, height) abort + if g:floaterm_position ==# 'topright' + let row = 0 + let col = &columns + let vert = 'N' + let hor = 'E' + elseif g:floaterm_position ==# 'topleft' + let row = 0 + let col = 0 + let vert = 'N' + let hor = 'W' + elseif g:floaterm_position ==# 'bottomright' + let row = &lines + let col = &columns + let vert = 'S' + let hor = 'E' + elseif g:floaterm_position ==# 'bottomleft' + let row = &lines + let col = 0 + let vert = 'S' + let hor = 'W' + elseif g:floaterm_position ==# 'center' + let row = (&lines - a:height)/2 + let col = (&columns - a:width)/2 + let vert = 'N' + let hor = 'W' + + if row < 0 + let row = 0 + endif + if col < 0 + let col = 0 + endif + else " at the cursor place + let curr_pos = getpos('.') + let row = curr_pos[1] - line('w0') + let col = curr_pos[2] + + if row + a:height <= &lines + let vert = 'N' + else + let vert = 'S' + endif + + if col + a:width <= &columns + let hor = 'W' + else + let hor = 'E' + endif + endif + + return [row, col, vert, hor] +endfunction + +function! floaterm#util#is_floaterm_available() abort + if exists('*nvim_win_set_config') + if g:floaterm_type == v:null + let g:floaterm_type = 'floating' + endif + elseif has('terminal') + let g:floaterm_type = 'normal' + else + let message = 'Terminal feature is required, please upgrade your vim/nvim' + call floaterm#util#show_msg(message, 'error') + return v:false + endif + return v:true +endfunction + +function! s:echo(group, msg) abort + if a:msg ==# '' | return | endif + execute 'echohl' a:group + echo a:msg + echon ' ' + echohl NONE +endfunction + +function! s:echon(group, msg) abort + if a:msg ==# '' | return | endif + execute 'echohl' a:group + echon a:msg + echon ' ' + echohl NONE +endfunction + +function! floaterm#util#show_msg(message, ...) abort + if a:0 == 0 + let msg_type = 'info' + else + let msg_type = a:1 + endif + + if type(a:message) != 1 + let message = string(a:message) + else + let message = a:message + endif + + call s:echo('Constant', '[vim-floaterm]') + + if msg_type ==# 'info' + call s:echon('Normal', message) + elseif msg_type ==# 'warning' + call s:echon('WarningMsg', message) + elseif msg_type ==# 'error' + call s:echon('Error', message) + endif +endfunction + +function! floaterm#util#get_normalfloat_fg() abort + let hiGroup = 'NormalFloat' + while v:true + let hiInfo = execute('hi ' . hiGroup) + let fgcolor = matchstr(hiInfo, 'guifg=\zs\S*') + let hiGroup = matchstr(hiInfo, 'links to \zs\S*') + if fgcolor !=# '' || hiGroup ==# '' + break + endif + endwhile + " If the foreground color isn't found eventually, use white + if fgcolor ==# '' + let fgcolor = '#FFFFFF' + endif + return fgcolor +endfunction + +function! floaterm#util#get_normalfloat_bg() abort + let hiGroup = 'NormalFloat' + while v:true + let hiInfo = execute('hi ' . hiGroup) + let bgcolor = matchstr(hiInfo, 'guibg=\zs\S*') + let hiGroup = matchstr(hiInfo, 'links to \zs\S*') + if bgcolor !=# '' || hiGroup ==# '' + break + endif + endwhile + " If the background color isn't found eventually, use black + if bgcolor ==# '' + let bgcolor = '#000000' + endif + return bgcolor +endfunction diff --git a/etc/soft/vim/vim/+plugins/vim-floaterm/doc/floaterm.txt b/etc/soft/vim/vim/+plugins/vim-floaterm/doc/floaterm.txt new file mode 100644 index 0000000..bc8a22c --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-floaterm/doc/floaterm.txt @@ -0,0 +1,160 @@ +*floaterm.txt* Neovim's floating terminal plugin Last change: 2019-12-28 + +Author : voldikss +License: MIT license +============================================================================== +CONTENTS *floaterm-contents* + + Introduction |floaterm-introduction| + Install |floaterm-install| + Features |floaterm-features| + Variables |floaterm-variables| + Keymappings |floaterm-key-mappings| + Commands |floaterm-commands| + Q-A |floaterm-q&a| + Repository |floaterm-repository| + + +============================================================================== +INTRODUCTION *floaterm-introduction* + + Use neovim terminal in the floating window. + + +============================================================================== +INSTALL *floaterm-install* + + With vim-plug: + > + Plug 'voldikss/vim-floaterm' +< + +============================================================================== +FEATURES *floaterm-features* + +- Toggle terminal window quickly + +- Multiple terminal instances + +- Customizable floating terminal style + +- Switch/Preview floating terminal buffer using [vim-clap](https://github.com/liuchengxu/vim-clap)(try `:Clap floaterm`) + + +============================================================================== +VARIABLES *floaterm-variables* + +g:floaterm_type *g:floaterm_type* + + Available:`'floating'`(neovim only), `'normal'`(vim8 and neovim) + + Default: `'floating'` + +g:floaterm_width *g:floaterm_width* + + Type: `int` (number of columns) or `float` (between 0 and 1). + If `float`, the width is relative to `&columns`. + Default: `0.6` + +g:floaterm_height *g:floaterm_height* + + + Type: `int` (number of lines) or `float` (between 0 and 1). + If `float`, the height is relative to `&lines`. + Default: `0.6` + + +g:floaterm_winblend *g:floaterm_winblend* + + Description: The opacity of the floating terminal + + Default: `0` + +g:floaterm_position *g:floaterm_position* + + Available: `'center'`, `'topleft'`, `'topright'`, `'bottomleft'`, + `'bottomright'`, `'auto'` + + Default: `'center'` + +g:floaterm_background *g:floaterm_background* + + Type: string(e.g. `'#000000'`, `'black'`) + + Default: background color of normal floating window + +g:floaterm_borderchars *g:floaterm_borderchars* + + Default: `['─', '│', '─', '│', '┌', '┐', '┘', '└']` + +g:floaterm_border_color *g:floaterm_border_color* + + Type: string(e.g. `'#FFFFFF'`, `'white'`) + + Default: foreground color of normal floating window + +============================================================================== + +MAPPINGS *floaterm-key-mappings* + +This plugin doesn't supply any default mappings. + > + """ Example configuration + let g:floaterm_keymap_new = '' + let g:floaterm_keymap_prev = '' + let g:floaterm_keymap_next = '' + let g:floaterm_keymap_toggle = '' +< + + +============================================================================== +COMMANDS *floaterm-commands* + +:FloatermNew *:FloatermNew* + + +:FloatermNext *:FloatermNext* + + +:FloatermPrev *:FloatermPrev* + + +:FloatermToggle *:FloatermToggle* + + +============================================================================== +Q-A *floaterm-q&a* + +- This plugin leaves an empty buffer on startify window + + Put this code in `vimrc` + > + autocmd User Startified setlocal buflisted + < +- I want to use another shell in the terminal. (e.g. Use fish instead of bash) + + Set `shell` option in your `vimrc`: + > + set shell=/path/to/shell + +- I would like to customize the style of the floating terminal window + + Use `autocmd`. For example + > + function s:floatermSettings() + setlocal number + " more settings + endfunction + + autocmd FileType floaterm call s:floatermSettings() + +============================================================================== +REPOSITORY *floaterm-repository-page* + + |vim-floaterm| is developed on GitHub. + + https://github.com/voldikss/vim-floaterm + + +============================================================================== +vim:tw=78:nosta:noet:ts=8:sts=0:ft=help:noet:fen:fdm=marker: diff --git a/etc/soft/vim/vim/+plugins/vim-floaterm/plugin/floaterm.vim b/etc/soft/vim/vim/+plugins/vim-floaterm/plugin/floaterm.vim new file mode 100644 index 0000000..63bb619 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-floaterm/plugin/floaterm.vim @@ -0,0 +1,47 @@ +" ============================================================================ +" FileName: plugin/floaterm.vim +" Description: +" Author: voldikss +" GitHub: https://github.com/voldikss +" ============================================================================ + +scriptencoding utf-8 + +let g:floaterm_type = get(g:, 'floaterm_type', v:null) +let g:floaterm_width = get(g:, 'floaterm_width', v:null) +let g:floaterm_height = get(g:, 'floaterm_height', v:null) +let g:floaterm_winblend = get(g:, 'floaterm_winblend', 0) +let g:floaterm_position = get(g:, 'floaterm_position', 'auto') +let g:floaterm_background = get(g:, 'floaterm_background', v:null) +let g:floaterm_borderchars = get(g:, 'floaterm_borderchars', ['─', '│', '─', '│', '┌', '┐', '┘', '└']) +let g:floaterm_border_color = get(g:, 'floaterm_border_color', v:null) + +let g:floaterm_keymap_new = get(g:, 'floaterm_keymap_new', v:null) +let g:floaterm_keymap_prev = get(g:, 'floaterm_keymap_prev', v:null) +let g:floaterm_keymap_next = get(g:, 'floaterm_keymap_next', v:null) +let g:floaterm_keymap_toggle = get(g:, 'floaterm_keymap_toggle', v:null) + +command! -nargs=0 FloatermNew call floaterm#start('new') +command! -nargs=0 FloatermPrev call floaterm#start('prev') +command! -nargs=0 FloatermNext call floaterm#start('next') +command! -nargs=0 FloatermToggle call floaterm#start('toggle') + +function! s:install_keymap() + if g:floaterm_keymap_new != v:null + exe printf('nnoremap %s :FloatermNew', g:floaterm_keymap_new) + exe printf('tnoremap %s :FloatermNew', g:floaterm_keymap_new) + endif + if g:floaterm_keymap_prev != v:null + exe printf('nnoremap %s :FloatermPrev', g:floaterm_keymap_prev) + exe printf('tnoremap %s :FloatermPrev', g:floaterm_keymap_prev) + endif + if g:floaterm_keymap_next != v:null + exe printf('nnoremap %s :FloatermNext', g:floaterm_keymap_next) + exe printf('tnoremap %s :FloatermNext', g:floaterm_keymap_next) + endif + if g:floaterm_keymap_toggle != v:null + exe printf('nnoremap %s :FloatermToggle', g:floaterm_keymap_toggle) + exe printf('tnoremap %s :FloatermToggle', g:floaterm_keymap_toggle) + endif +endfunction +call s:install_keymap() diff --git a/etc/soft/vim/vimrc b/etc/soft/vim/vimrc index 30fbb7c..e450e24 100644 --- a/etc/soft/vim/vimrc +++ b/etc/soft/vim/vimrc @@ -46,10 +46,6 @@ au BufWinEnter *.wiki set nocursorline let g:loaded_zipPlugin = 1 let g:loaded_zip = 1 -" Режим терминала {{{ -nmap ,s :split term://bash -" }}} - " }}}--------------------------------------------------------------------------- " {{{-------------------------- Работа с файловой системой---------------------- @@ -896,6 +892,21 @@ let g:startify_fortune_use_unicode = 1 let g:startify_session_dir = "$HOME/.shellrc/var/vim/sessions" " Директория файлов сессий +autocmd User Startified setlocal buflisted + +" }}} + +" floaterm {{{ + +let g:floaterm_keymap_toggle = ',s' +let g:floaterm_width = 0.8 +let g:floaterm_height = 0.7 +let g:floaterm_position = 'center' +let g:floaterm_borderchars = ['─', '│', '─', '│', '┌', '┐', '┘', '└'] + +" }}} + + " }}} " }}}########################################################################### From ed928e7dafe4f6eb2877fe53f242eca2dcb15dae Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Fri, 31 Jan 2020 21:16:32 +0300 Subject: [PATCH 14/15] vim: ++jinja.vim --- etc/soft/vim/vim/syntax/jinja.vim | 138 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 etc/soft/vim/vim/syntax/jinja.vim diff --git a/etc/soft/vim/vim/syntax/jinja.vim b/etc/soft/vim/vim/syntax/jinja.vim new file mode 100644 index 0000000..e2a5bbf --- /dev/null +++ b/etc/soft/vim/vim/syntax/jinja.vim @@ -0,0 +1,138 @@ +" Vim syntax file +" Language: Jinja template +" Maintainer: Armin Ronacher +" Last Change: 2008 May 9 +" Version: 1.1 +" +" Known Bugs: +" because of odd limitations dicts and the modulo operator +" appear wrong in the template. +" +" Changes: +" +" 2008 May 9: Added support for Jinja 2 changes (new keyword rules) + +" .vimrc variable to disable html highlighting +if !exists('g:jinja_syntax_html') + let g:jinja_syntax_html=1 +endif + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if !exists("main_syntax") + if v:version < 600 + syntax clear + elseif exists("b:current_syntax") + finish + endif + let main_syntax = 'jinja' +endif + +" Pull in the HTML syntax. +if g:jinja_syntax_html + if v:version < 600 + so :p:h/html.vim + else + runtime! syntax/html.vim + unlet b:current_syntax + endif +endif + +syntax case match + +" Jinja template built-in tags and parameters (without filter, macro, is and raw, they +" have special threatment) +syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import + +syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter +syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction +syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName + +" Variable Names +syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/ +syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs + +" Filters +syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter +syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/ +syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/ +syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/ + +" Jinja template constants +syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@\)*\\"/ end=/"/ +syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@\)*\\'/ end=/'/ +syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/ + +" Operators +syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/ +syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/ +syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute +syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/ + +" Jinja template tag and variable blocks +syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained +syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained +syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained +syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment + +syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment + +" Jinja template 'raw' tag +syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment + +" Jinja comments +syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment +" help support folding for some setups +setlocal commentstring={#%s#} +setlocal comments=s:{#,e:#} + +" Block start keywords. A bit tricker. We only highlight at the start of a +" tag block and only if the name is not followed by a comma or equals sign +" which usually means that we have to deal with an assignment. +syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/ + +" and context modifiers +syn match jinjaStatement containedin=jinjaTagBlock contained /\/ + + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if v:version >= 508 || !exists("did_jinja_syn_inits") + if v:version < 508 + let did_jinja_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink jinjaPunctuation jinjaOperator + HiLink jinjaAttribute jinjaVariable + HiLink jinjaFunction jinjaFilter + + HiLink jinjaTagDelim jinjaTagBlock + HiLink jinjaVarDelim jinjaVarBlock + HiLink jinjaCommentDelim jinjaComment + HiLink jinjaRawDelim jinja + + HiLink jinjaSpecial Special + HiLink jinjaOperator Normal + HiLink jinjaRaw Normal + HiLink jinjaTagBlock PreProc + HiLink jinjaVarBlock PreProc + HiLink jinjaStatement Statement + HiLink jinjaFilter Function + HiLink jinjaBlockName Function + HiLink jinjaVariable Identifier + HiLink jinjaString Constant + HiLink jinjaNumber Constant + HiLink jinjaComment Comment + + delcommand HiLink +endif + +let b:current_syntax = "jinja" + +if main_syntax ==# 'jinja' + unlet main_syntax +endif From df2b2fa2f21744f5c8411a1701dae42f4f4499ca Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Wed, 5 Feb 2020 16:02:15 +0300 Subject: [PATCH 15/15] vim: plugins: ++cheat40 --- etc/soft/vim/vim/+plugins/vim-cheat40/Readme.md | 56 ++++++++++++++++++++++ .../vim/+plugins/vim-cheat40/autoload/cheat40.vim | 45 +++++++++++++++++ .../vim/+plugins/vim-cheat40/plugin/cheat40.vim | 17 +++++++ .../vim/+plugins/vim-cheat40/syntax/cheat40.vim | 45 +++++++++++++++++ etc/soft/vim/vim/cheat40.txt | 33 +++++++++++++ etc/soft/vim/vimrc | 9 ++-- 6 files changed, 202 insertions(+), 3 deletions(-) create mode 100644 etc/soft/vim/vim/+plugins/vim-cheat40/Readme.md create mode 100644 etc/soft/vim/vim/+plugins/vim-cheat40/autoload/cheat40.vim create mode 100644 etc/soft/vim/vim/+plugins/vim-cheat40/plugin/cheat40.vim create mode 100644 etc/soft/vim/vim/+plugins/vim-cheat40/syntax/cheat40.vim create mode 100644 etc/soft/vim/vim/cheat40.txt diff --git a/etc/soft/vim/vim/+plugins/vim-cheat40/Readme.md b/etc/soft/vim/vim/+plugins/vim-cheat40/Readme.md new file mode 100644 index 0000000..dce7b8b --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-cheat40/Readme.md @@ -0,0 +1,56 @@ +# Cheat40: a cheat sheet for Vim + +Cheat40 is a foldable extensible 40-column cheat sheet that you may open in Vim +by pressing `?` (the mapping is customizable, of course). Mappings and +commands are organized like the menus of a GUI app: there is a File section, an +Edit section, a View section, and so on. For each item the description comes +first, because one typically wants to find how to execute a task, not what the +meaning of a key sequence is (there is Vim's help for that). Syntax coloring and +the use of `conceal` keep the cheat sheet clutter-free and easy to read. + + +## Installation + +If your Vim supports packages (`echo has('packages')` prints `1`), I strongly +recommend that you use them. Just clone this repo inside `pack/*/start`, e.g., + + cd ~/.vim + git clone https://github.com/lifepillar/vim-cheat40.git pack/bundle/start/cheat40 + +Otherwise, use your preferred installation method. + + +## Extending the cheat sheet + +You may extend the cheat sheet by putting one or more files called `cheat40.txt` +anywhere in your `runtimepath` (e.g., in `~/.vim`). Cheat40 searches +`runtimepath` for such files and concatenates their content. This allows plugin +developers to provide a cheat sheet for their plugins by putting a `cheat40.txt` +file in the top folder of their plugins. + +If you do not want to use the default cheat sheet that comes with this plugin, +set the following variable in your `.vimrc`: + + let g:cheat40_use_default = 0 + +In this case, I recommend that you copy `cheat40.txt` into your `.vim` folder +and modify it to suit your needs. + +The syntax of a cheat sheet is very simple: + +- foldable sections use Vim's default markers (`{{{` and `}}}`) (see `:h + fold-marker`); +- sections of the form `About … {{{ … }}}` are interpreted as block comments; +- lines starting with a `#` are interpreted as line comments; +- each line, except for comments and section markers, should be 40 columns wide + (comments and section markers may be shorter than that); +- each item consists of a description, a key sequence, and a label; +- the description must fit in columns 1–25 (long descriptions may be split into + several lines); +- the key sequence and the label must fit in columns 26–40 (long key sequences + should be split into several lines); +- the label is a right-justified sequence of one or more characters (e.g., `N` + for Normal mode, `I` for Insert mode, and so on). + +See the cheat sheet inside the plugin for the details. + diff --git a/etc/soft/vim/vim/+plugins/vim-cheat40/autoload/cheat40.vim b/etc/soft/vim/vim/+plugins/vim-cheat40/autoload/cheat40.vim new file mode 100644 index 0000000..e44c37c --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-cheat40/autoload/cheat40.vim @@ -0,0 +1,45 @@ +" Author: Lifepillar +" Maintainer: Lifepillar +" License: Distributed under the same terms as Vim itself. See :help license. + +let s:cheat40_dir = fnamemodify(resolve(expand(':p')), ':h:h') + +" Courtesy of Pathogen +function! s:slash() abort + return !exists("+shellslash") || &shellslash ? '/' : '\' +endfunction + + +" Split a path into a list. Code from Pathogen. +function! s:split(path) abort + if type(a:path) == type([]) | return a:path | endif + if empty(a:path) | return [] | endif + let split = split(a:path,'\\\@ + nnoremap q @=winnr("#")c +endf diff --git a/etc/soft/vim/vim/+plugins/vim-cheat40/plugin/cheat40.vim b/etc/soft/vim/vim/+plugins/vim-cheat40/plugin/cheat40.vim new file mode 100644 index 0000000..e7cc592 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-cheat40/plugin/cheat40.vim @@ -0,0 +1,17 @@ +" Author: Lifepillar +" Maintainer: Lifepillar +" License: Distributed under the same terms as Vim itself. See :help license. + +if exists("g:loaded_cheatsheet") || &cp || v:version < 700 + finish +endif +let g:loaded_cheatsheet = 1 + +command -bar -nargs=0 -bang Cheat40 call cheat40#open("" ==# '!') + +"if mapcheck("?", "n") == "" + "nmap ? :Cheat40 +"endif + +nmap ? :Cheat40 + diff --git a/etc/soft/vim/vim/+plugins/vim-cheat40/syntax/cheat40.vim b/etc/soft/vim/vim/+plugins/vim-cheat40/syntax/cheat40.vim new file mode 100644 index 0000000..8f9de42 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-cheat40/syntax/cheat40.vim @@ -0,0 +1,45 @@ +" Author: Lifepillar +" Maintainer: Lifepillar +" License: Distributed under the same terms as Vim itself. See :help license. + +if exists("b:current_syntax") + finish +endif + +syntax case ignore +syntax sync fromstart + +syn match Cheat40Descr /\%1v.*\%<26v./ +syn match Cheat40Command /\%26v.*\%<41v./ contains=Cheat40Mode,Cheat40Angle,Cheat40DblAngle +syn match Cheat40Header /^.*{{{\d*$/ contains=Cheat40BeginSection +syn region Cheat40About start=/^About.*{{{\d*$/ end=/^}}}$/ keepend contains=Cheat40BeginSection,Cheat40EndSection,Cheat40Tag,Cheat40Angle,Cheat40DblAngle +syn match Cheat40FirstLine /\%1l.*/ +syn match Cheat40BeginSection /{{{\d*/ contained conceal +syn match Cheat40EndSection /^}}}$/ conceal +syn match Cheat40Tag /`[^` \t]\+`/hs=s+1,he=e-1 contained contains=Cheat40Backtick,Cheat40Runtime +syn match Cheat40Backtick /`/ contained conceal +syn match Cheat40Mode /[NICVTOM*]\+\%>40v/ +syn match Cheat40Angle /‹[^› \t]\+›/ contained +syn match Cheat40DblAngle /«[^» \t]\+»/ contained +syn match Cheat40Comment /^#.*$/ contains=Cheat40Hash +syn match Cheat40Hash /^#\s*/ contained conceal +syn match Cheat40Runtime /\$VIMRUNTIME\/doc\// contained conceal + +hi def link Cheat40Descr Normal +hi def link Cheat40Command Constant +hi def link Cheat40Header Title +hi def link Cheat40About Comment +hi def link Cheat40FirstLine Statement +hi def link Cheat40BeginSection Ignore +hi def link Cheat40EndSection Ignore +hi def link Cheat40Tag Tag +hi def link Cheat40Backtick Ignore +hi def link Cheat40Mode Type +hi def link Cheat40Angle Identifier +hi def link Cheat40DblAngle Label +hi def link Cheat40Comment Comment +hi def link Cheat40Hash Ignore +hi def link Cheat40Runtime Ignore + +let b:current_syntax = "cheat40" + diff --git a/etc/soft/vim/vim/cheat40.txt b/etc/soft/vim/vim/cheat40.txt new file mode 100644 index 0000000..c32907d --- /dev/null +++ b/etc/soft/vim/vim/cheat40.txt @@ -0,0 +1,33 @@ +Press q to dismiss, to lose focus + +Перемещение {{{1 + + В начало экрана H N + В центр экрана M N + В конец экрана L N + + Вперёд на один экран ^F N + Назад на один экран ^B N + Вперёд на полэкрана ^D N + Назад на полэкрана ^U N + + Строку наверх экрана z N + Строку в центр экрана z. N + Строку вниз экрана z- N + +ex {{{1 + + Замена в найденных стр. :g/../s/a/b/g C + Замена с подтверждением :s/a/b/gc C + Повтор последней замены :%&g C + +Регистры {{{1 + + Содержимое регистров :registers N + Копировать строку в `a` "ayy N + Добавить строку в `a` "Ayy N + +Разное {{{1 + + Открыть ссылку gx N + diff --git a/etc/soft/vim/vimrc b/etc/soft/vim/vimrc index e450e24..168e507 100644 --- a/etc/soft/vim/vimrc +++ b/etc/soft/vim/vimrc @@ -896,6 +896,12 @@ autocmd User Startified setlocal buflisted " }}} +" cheat40 {{{ + +let g:cheat40_use_default = 0 + +" }}} + " floaterm {{{ let g:floaterm_keymap_toggle = ',s' @@ -906,8 +912,5 @@ let g:floaterm_borderchars = ['─', '│', '─', '│', '┌', '┐', '┘', ' " }}} - -" }}} - " }}}###########################################################################