From 97d8246877c2dbafdd1441b86263051143ac9ca5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 20:56:44 +0000 Subject: [PATCH 1/8] Bump prismjs from 1.21.0 to 1.23.0 in /script-resources/markdown2htmldoc Bumps [prismjs](https://github.com/PrismJS/prism) from 1.21.0 to 1.23.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.21.0...v1.23.0) Signed-off-by: dependabot[bot] --- script-resources/markdown2htmldoc/package.json | 2 +- script-resources/markdown2htmldoc/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/script-resources/markdown2htmldoc/package.json b/script-resources/markdown2htmldoc/package.json index cc1dae8..9bdddea 100644 --- a/script-resources/markdown2htmldoc/package.json +++ b/script-resources/markdown2htmldoc/package.json @@ -7,7 +7,7 @@ "markdown-it": "*", "markdown-it-emoji": "*", "markdown-it-task-checkbox": "*", - "prismjs": "^1.21.0" + "prismjs": "^1.23.0" }, "devDependencies": { "eslint": "*", diff --git a/script-resources/markdown2htmldoc/yarn.lock b/script-resources/markdown2htmldoc/yarn.lock index ecb8902..7da943a 100644 --- a/script-resources/markdown2htmldoc/yarn.lock +++ b/script-resources/markdown2htmldoc/yarn.lock @@ -708,10 +708,10 @@ prettier@*: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6" integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw== -prismjs@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.21.0.tgz#36c086ec36b45319ec4218ee164c110f9fc015a3" - integrity sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw== +prismjs@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.23.0.tgz#d3b3967f7d72440690497652a9d40ff046067f33" + integrity sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA== optionalDependencies: clipboard "^2.0.0" From b467ed4d63f496a1d59f70215e2f2b961dce7994 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Fri, 5 Mar 2021 14:59:33 +0200 Subject: [PATCH 2/8] [nvim] switch from coc-python to coc-pyright --- nvim/coc-languages/python.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvim/coc-languages/python.vim b/nvim/coc-languages/python.vim index 25d9663..ff6cd12 100644 --- a/nvim/coc-languages/python.vim +++ b/nvim/coc-languages/python.vim @@ -1,8 +1,8 @@ -let g:coc_global_extensions += ['coc-python'] +let g:coc_global_extensions += ['coc-pyright'] let g:coc_filetypes += ['python'] -let g:coc_user_config['pyls.plugins.pycodestyle.ignore'] = ['E501'] +" let g:coc_user_config['pyls.plugins.pycodestyle.ignore'] = ['E501'] +" let g:coc_user_config['python.autocomplete.showAdvancedMembers'] = v:false let g:coc_user_config['python'] = { -\ 'autocomplete': { 'showAdvancedMembers': v:false }, \ 'formatting': { 'provider': 'black' }, \ 'linting': { \ 'pylintEnabled': v:false, From aecef017f9202178c37e8cad24d0bad5ca8713f5 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sun, 7 Mar 2021 13:06:14 +0200 Subject: [PATCH 3/8] [zsh] inline the fasd plugin from OMZ and remove the useless one called 'extract' --- zsh/plugins.zsh | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/zsh/plugins.zsh b/zsh/plugins.zsh index edba661..f207b1c 100644 --- a/zsh/plugins.zsh +++ b/zsh/plugins.zsh @@ -49,7 +49,7 @@ _plugin completions 'zsh-users/zsh-completions' "$_checkout_latest_version" # Oh My Zsh {{{ omz_features=(key-bindings termsupport) - omz_plugins=(git extract fasd) + omz_plugins=(git) _plugin ohmyzsh 'ohmyzsh/ohmyzsh' \ load='lib/'${^omz_features}'.zsh' \ @@ -64,22 +64,35 @@ _plugin completions 'zsh-users/zsh-completions' "$_checkout_latest_version" # fasd {{{ -unalias j -j() { - local _fasd_ret - _fasd_ret="$( - # -l: list all paths in the database (without scores) - # -d: list only directories - # -R: in the reverse order - fasd -l -d -R | - fzf --height=40% --layout=reverse --tiebreak=index --query="$*" - )" - if [[ -d "$_fasd_ret" ]]; then - cd -- "$_fasd_ret" - elif [[ -n "$_fasd_ret" ]]; then - print -- "$_fasd_ret" + if command_exists fasd; then + # Initialization taken from + fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" + if [[ "${commands[fasd]}" -nt "$fasd_cache" || ! -s "$fasd_cache" ]]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >| "$fasd_cache" + fi + source "$fasd_cache" + unset fasd_cache + + alias v='f -e "$EDITOR"' + alias o='a -e xdg-open' + + # alias j='zz' + j() { + local _fasd_ret + _fasd_ret="$( + # -l: list all paths in the database (without scores) + # -d: list only directories + # -R: in the reverse order + fasd -l -d -R | + fzf --height=40% --layout=reverse --tiebreak=index --query="$*" + )" + if [[ -d "$_fasd_ret" ]]; then + cd -- "$_fasd_ret" + elif [[ -n "$_fasd_ret" ]]; then + print -- "$_fasd_ret" + fi + } fi -} # }}} From b60438f49b85f2d4325b5e4963eedc0c0700c372 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sun, 7 Mar 2021 14:59:48 +0200 Subject: [PATCH 4/8] [zsh] add library paths of all installed Rust toolchains --- zsh/path.zsh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/zsh/path.zsh b/zsh/path.zsh index 02da266..47fdf6d 100644 --- a/zsh/path.zsh +++ b/zsh/path.zsh @@ -70,7 +70,8 @@ export GOPATH=~/go path_prepend path "$GOPATH/bin" # Rust -if [[ -f ~/.rustup/settings.toml ]]; then +rustup_home="${RUSTUP_HOME:-$HOME/.rustup}" +if [[ -f "$rustup_home"/settings.toml ]]; then # Make a low-effort attempt at quickly extracting the selected Rust toolchain # from rustup's settings. The TOML file is obviously assumed to be well-formed # and syntactically correct because virtually always it's manipulated with the @@ -78,7 +79,7 @@ if [[ -f ~/.rustup/settings.toml ]]; then # because Rust toolchain names don't need escaping in strings. # See also . rust_toolchain="" - < ~/.rustup/settings.toml while IFS= read -r line; do + < "$rustup_home"/settings.toml while IFS= read -r line; do if [[ "$line" =~ '^default_toolchain = "(.+)"$' ]]; then rust_toolchain="${match[1]}" break @@ -88,16 +89,20 @@ if [[ -f ~/.rustup/settings.toml ]]; then done; unset line if [[ -n "$rust_toolchain" ]]; then - rust_sysroot=~/.rustup/toolchains/"$rust_toolchain" + rust_sysroot="$rustup_home"/toolchains/"$rust_toolchain" # path_append path "$rust_sysroot"/bin path_prepend fpath "$rust_sysroot"/zsh/site-functions path_prepend manpath "$rust_sysroot"/share/man - path_prepend ld_library_path "$rust_sysroot"/lib - unset rust_sysroot fi - unset rust_toolchain + for rust_sysroot in "$rustup_home"/toolchains/*(/); do + # The filenames of all libraries in toolchain dirs are suffixed with their + # build hashes or the compiler identifier, so in practice conflicts are + # insanely unlikely. + path_prepend ld_library_path "$rust_sysroot"/lib + done fi +unset rustup_home rust_toolchain rust_sysroot path_prepend path ~/.cargo/bin From 0a3c9b74240aad5e41494c47b24a7f5df045c454 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sun, 7 Mar 2021 15:24:42 +0200 Subject: [PATCH 5/8] [nvim] add an indentation block motion --- nvim/autoload/dotfiles/indent_motion.vim | 63 ++++++++++++++++++++++++ nvim/autoload/dotfiles/utils.vim | 6 +++ nvim/plugin/dotfiles/indent_motion.vim | 9 ++++ 3 files changed, 78 insertions(+) create mode 100644 nvim/autoload/dotfiles/indent_motion.vim create mode 100644 nvim/autoload/dotfiles/utils.vim create mode 100644 nvim/plugin/dotfiles/indent_motion.vim diff --git a/nvim/autoload/dotfiles/indent_motion.vim b/nvim/autoload/dotfiles/indent_motion.vim new file mode 100644 index 0000000..31b51f4 --- /dev/null +++ b/nvim/autoload/dotfiles/indent_motion.vim @@ -0,0 +1,63 @@ +" Based on +" A motion for moving over enclosing indentation blocks. Primarily intended +" for reverse-engineering CrossCode. + +function dotfiles#indent_motion#run(direction) + let l:cursor_linenr = line(".") + let l:max_linenr = line("$") + + let l:retry = 0 + while l:retry <# 2 + let l:retry += 1 + + let l:base_linenr = l:cursor_linenr + let l:base_indent = 0 + while 1 <=# l:base_linenr && l:base_linenr <=# l:max_linenr + let l:base_indent = dotfiles#indent_motion#indent_level_of(l:base_linenr) + if l:base_indent >=# 0 + break + endif + let l:base_linenr += a:direction + endwhile + + let l:target_linenr = l:base_linenr + + let l:curr_linenr = l:base_linenr + a:direction + let l:prev_indent = l:base_indent + while 1 <=# l:curr_linenr && l:curr_linenr <=# l:max_linenr + let l:indent = dotfiles#indent_motion#indent_level_of(l:curr_linenr) + + if l:indent >=# 0 + if l:indent <# l:base_indent + break + else + let l:target_linenr = l:curr_linenr + endif + elseif l:base_indent ==# 0 && l:prev_indent ==# 0 + break + endif + + let l:prev_indent = l:indent + let l:curr_linenr += a:direction + endwhile + + if l:target_linenr ==# l:cursor_linenr + let l:cursor_linenr += a:direction + if 1 <=# l:cursor_linenr && l:cursor_linenr <=# l:max_linenr + continue + endif + endif + + break + endwhile + + execute "normal! " . l:target_linenr . "G^" +endfunction + +" +function dotfiles#indent_motion#indent_level_of(linenr) "{{{2 + if getline(a:linenr) ==# "" + return -1 + endif + return indent(a:linenr) +endfunction diff --git a/nvim/autoload/dotfiles/utils.vim b/nvim/autoload/dotfiles/utils.vim new file mode 100644 index 0000000..d3cd2b2 --- /dev/null +++ b/nvim/autoload/dotfiles/utils.vim @@ -0,0 +1,6 @@ +function dotfiles#utils#array_remove_element(array, element) + let l:index = index(a:array, a:element) + if l:index >= 0 + call remove(a:array, l:index) + endif +endfunction diff --git a/nvim/plugin/dotfiles/indent_motion.vim b/nvim/plugin/dotfiles/indent_motion.vim new file mode 100644 index 0000000..32c4525 --- /dev/null +++ b/nvim/plugin/dotfiles/indent_motion.vim @@ -0,0 +1,9 @@ +for [s:plug_mapping, s:direction, s:user_mapping] in [["prev", -1, "("], ["next", 1, ")"]] + let s:plug_mapping = "dotfiles_indent_motion_".s:plug_mapping + for s:mode in ["n", "v", "o"] + execute s:mode."noremap" "" s:plug_mapping "call dotfiles#indent_motion#run(".s:direction.")" + if !empty(s:user_mapping) + execute s:mode."map" s:user_mapping s:plug_mapping + endif + endfor +endfor From dfb049f52ff546af2d46edb821c30883b439e3d8 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Fri, 12 Mar 2021 13:28:08 +0200 Subject: [PATCH 6/8] [nvim] add a quick keymap switcher --- nvim/autoload/dotfiles/indent_motion.vim | 2 +- nvim/plugin/editing.vim | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/nvim/autoload/dotfiles/indent_motion.vim b/nvim/autoload/dotfiles/indent_motion.vim index 31b51f4..780d351 100644 --- a/nvim/autoload/dotfiles/indent_motion.vim +++ b/nvim/autoload/dotfiles/indent_motion.vim @@ -55,7 +55,7 @@ function dotfiles#indent_motion#run(direction) endfunction " -function dotfiles#indent_motion#indent_level_of(linenr) "{{{2 +function dotfiles#indent_motion#indent_level_of(linenr) if getline(a:linenr) ==# "" return -1 endif diff --git a/nvim/plugin/editing.vim b/nvim/plugin/editing.vim index ec77a41..3fb2af5 100644 --- a/nvim/plugin/editing.vim +++ b/nvim/plugin/editing.vim @@ -106,10 +106,6 @@ set commentstring=//%s nnoremap nnoremap - nnoremap kk set keymap& - nnoremap kr set keymap=russian-jcuken-custom - nnoremap ku set keymap=ukrainian-jcuken-custom - nnoremap Q " normal mode @@ -138,6 +134,19 @@ set commentstring=//%s " }}} +" Keymap switcher {{{ + + nnoremap kk set keymap& + nnoremap kr set keymap=russian-jcuken-custom + nnoremap ku set keymap=ukrainian-jcuken-custom + + nnoremap DotfilesSwapKeymaps + let g:dotfiles_prev_keymap = &keymap + command! -nargs=0 DotfilesSwapKeymaps let [g:dotfiles_prev_keymap, &keymap] = [&keymap, g:dotfiles_prev_keymap] + +" }}} + + " Search {{{ " ignore case if the pattern doesn't contain uppercase characters (use '\C' From 7177de926abdfc5599c6beacae6b982f2f4d4fb5 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Fri, 12 Mar 2021 13:39:16 +0200 Subject: [PATCH 7/8] [nvim] fix ranger on Android --- nvim/plugin/files.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nvim/plugin/files.vim b/nvim/plugin/files.vim index b9266d5..8b3d347 100644 --- a/nvim/plugin/files.vim +++ b/nvim/plugin/files.vim @@ -36,6 +36,10 @@ nnoremap empty(&buftype) ? ":writewall\" : "\" " Ranger {{{ let g:ranger_replace_netrw = 1 let g:ranger_map_keys = 0 + " The default path (/tmp/chosenfile) is inaccessible at least on + " Android/Termux, so the tempname() function was chosen because it respects + " $TMPDIR. + let g:ranger_choice_file = tempname() nnoremap o Ranger " ranger.vim relies on the Bclose.vim plugin, but I use Bbye.vim, so this " command is here just for compatitabilty From 35b1e9446e608656a578819544f59a000c1115ea Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Wed, 17 Mar 2021 19:56:07 +0200 Subject: [PATCH 8/8] [nvim] add a binding for my favorite git feature --- nvim/plugin/git.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/nvim/plugin/git.vim b/nvim/plugin/git.vim index c986e7b..cb154da 100644 --- a/nvim/plugin/git.vim +++ b/nvim/plugin/git.vim @@ -8,6 +8,7 @@ nnoremap gw :GBrowse nnoremap gW :.GBrowse nnoremap gc :Git commit % + nnoremap gC :Git commit --amend nnoremap gl :Gclog nnoremap gp :Git push " }}}