├── .gitignore ├── .gitmodules ├── README.md ├── alacritty └── .config │ └── alacritty │ └── alacritty.yml ├── bat └── .config │ └── bat │ └── config ├── bootstrap.ps1 ├── bootstrap.zsh ├── cargo ├── .config │ └── systemd │ │ └── user │ │ ├── cargo-sweep.service │ │ └── cargo-sweep.timer └── .local │ └── share │ └── cargo │ └── config ├── ccache └── .ccache │ └── ccache.conf ├── conky └── .conkyrc ├── emacs-private └── .emacs.d │ └── private │ ├── org-roam │ └── packages.el │ ├── smart-input-source │ └── packages.el │ └── tabnine │ ├── config.el │ ├── funcs.el │ └── packages.el ├── emacs └── .spacemacs ├── fcitx ├── .config │ └── fcitx │ │ └── lua │ │ └── data.lua └── .local │ └── share │ └── fcitx5 │ ├── addon │ └── engwords.conf │ ├── lua │ ├── engwords │ │ └── engwords.lua │ └── imeapi │ │ ├── extensions │ │ ├── autospace.lua │ │ ├── calc.lua │ │ ├── engchr.lua │ │ ├── konge.lua │ │ ├── switch.lua │ │ └── timestamp.lua │ │ └── imeapi.lua │ ├── punctuation │ └── punc.mb.zh_CN │ └── themes │ ├── fcitx-simple-dark │ ├── highlight.png │ ├── panel.png │ └── theme.conf │ └── fcitx5-simple-dark-chino │ ├── highlight.png │ ├── overlay.png │ ├── panel.png │ └── theme.conf ├── fontconfig └── .config │ └── fontconfig │ └── fonts.conf ├── git ├── .gitconfig └── .gitmessage ├── ipython └── .config │ └── ipython │ └── profile_default │ ├── ipython_config.py │ └── ipython_kernel_config.py ├── makepkg └── .config │ └── pacman │ └── makepkg.conf ├── navi └── .local │ └── share │ └── navi │ └── cheats │ └── aloxaf │ ├── ffmpeg.cheat │ ├── imagemagick.cheat │ ├── linux.cheat │ └── pacman.cheat ├── npm └── .config │ └── npm │ └── config ├── pacman ├── etc │ └── pacman.conf └── usr │ └── share │ └── libalpm │ └── hooks │ └── clean-cache.hook ├── pikaur └── .config │ └── pikaur.conf ├── powershell └── .config │ └── powershell │ └── profile.ps1 ├── proxychains └── .config │ └── proxychains │ ├── 8080.conf │ ├── 8087.conf │ └── 8877.conf ├── ssh └── .ssh │ └── config ├── systemd ├── README.md └── etc │ └── systemd │ └── system │ └── xkeysnail.service ├── tmux └── .config │ └── tmux │ └── tmux.conf ├── x11 ├── .XCompose ├── .Xresources ├── .xprofile └── .xsession ├── xkeysnail └── .config │ ├── systemd │ └── user │ │ └── xkeysnail.service │ └── xkeysnail │ └── config.py └── zsh ├── .config └── zsh │ ├── .gitignore │ ├── .zshrc │ ├── completions │ ├── _aliyun │ ├── _aria2c │ ├── _bat │ ├── _bgrep │ ├── _cargo-add │ ├── _cargo-rm │ ├── _cargo-upgrade │ ├── _cppman │ ├── _file │ ├── _fzf │ ├── _git-brws │ ├── _grc │ ├── _lotus │ ├── _pactree │ ├── _pdm │ ├── _pkgconf │ ├── _rlwrap │ ├── _silicon │ ├── _sk │ └── _tokei │ ├── functions │ ├── bracketed-paste-win-path │ ├── colors.py │ ├── colors.zsh │ ├── ebindkey │ ├── explain_permission │ ├── hhsh │ ├── man │ ├── oomscore │ ├── palette │ ├── pb │ ├── printc │ ├── pslist │ ├── rgdata │ ├── rgdoc │ ├── rgsrc │ ├── rgzh │ └── zman │ ├── p10k.zsh │ ├── plugins │ ├── alias-tips │ │ ├── _altp_check │ │ ├── _altp_expand │ │ ├── _altp_init │ │ ├── _altp_show_tips │ │ └── alias-tips.plugin.zsh │ ├── atuin │ │ └── atuin.plugin.zsh │ └── zb │ │ ├── _zb │ │ ├── zb │ │ └── zb.plugin.zsh │ ├── snippets │ ├── alias.zsh │ ├── completion.zsh │ ├── history.zsh │ ├── key-bindings.zsh │ └── misc.zsh │ ├── zinit │ └── .gitignore │ └── zshrc.zsh ├── .gitignore └── .zshenv /.gitignore: -------------------------------------------------------------------------------- 1 | .directory 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "emacs/.emacs.d"] 2 | path = emacs/.emacs.d 3 | url = https://github.com/syl20bnr/spacemacs.git 4 | branch = develop 5 | [submodule "tmux/.local/share/tmux/plugins/tpm"] 6 | path = tmux/.local/share/tmux/plugins/tpm 7 | url = https://github.com/tmux-plugins/tpm 8 | [submodule "zsh/.local/share/zsh/zinit/bin"] 9 | path = zsh/.config/zsh/zinit/bin 10 | url = https://github.com/zdharma/zinit.git 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | 3 | My dotfiles controlled by GNU stow following [this way](https://farseerfc.me/using-gnu-stow-to-manage-your-dotfiles.html) 4 | 5 | ## Requirements 6 | 7 | ```bash 8 | sudo pacman -S diff-so-fancy exa ripgrep git-extras 9 | ``` 10 | 11 | ```bash 12 | cargo install git-brws 13 | ``` 14 | -------------------------------------------------------------------------------- /bat/.config/bat/config: -------------------------------------------------------------------------------- 1 | --theme='OneHalfDark' 2 | 3 | --style='numbers,header,grid' -------------------------------------------------------------------------------- /bootstrap.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/pwsh 2 | 3 | $root_dirs = @(Get-ChildItem / -Directory | ForEach-Object { $_.Name }) 4 | 5 | function deploy_to_root($config_name) { 6 | return @(Get-ChildItem $config_name -Force).Where({ $root_dirs.Contains($_.Name) }).Count 7 | } 8 | 9 | Get-ChildItem -Directory | ForEach-Object { 10 | if (deploy_to_root $_) { 11 | echo "deploy to / : $($_.Name)" 12 | sudo stow $_.Name --ignore=.directory --target=/ 13 | } else { 14 | echo "deploy to ~ : $($_.Name)" 15 | stow $_.Name --ignore=.directory --target=$HOME 16 | } 17 | } -------------------------------------------------------------------------------- /bootstrap.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/zsh 2 | 3 | setopt extended_glob no_nomatch 4 | 5 | function deploy_to_root() { 6 | local -a file=($1/*(#q:t)) 7 | [[ -d "/$file[1]" ]] 8 | } 9 | 10 | for i (^systemd(/)); do 11 | if [[ ${i:t} == emacs-private ]]; then 12 | for j in $i/.emacs.d/private/*; do 13 | ln -s ${j:A} ~/.emacs.d/private/${j:t} 14 | done 15 | continue 16 | fi 17 | echo -n "deploying $i" 18 | if { deploy_to_root $i }; then 19 | echo " to /" 20 | sudo stow "$i" --ignore=.directory --target=/ 21 | else 22 | echo " to $HOME" 23 | stow "$i" --ignore=.directory --target=$HOME 24 | fi 25 | done 26 | -------------------------------------------------------------------------------- /cargo/.config/systemd/user/cargo-sweep.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Cleanup of Cargo Cache 3 | DefaultDependencies=no 4 | Conflicts=shutdown.target 5 | After=local-fs.target time-set.target 6 | Before=shutdown.target 7 | 8 | [Service] 9 | Type=oneshot 10 | ExecStart=cargo sweep --maxsize 10240 /home/aloxaf/Coding/Rust/tmp2 -r 11 | IOSchedulingClass=idle 12 | -------------------------------------------------------------------------------- /cargo/.config/systemd/user/cargo-sweep.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Daily Cleanup of Cargo Cache 3 | 4 | [Timer] 5 | OnBootSec=15min 6 | OnUnitActiveSec=1d 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /cargo/.local/share/cargo/config: -------------------------------------------------------------------------------- 1 | #[source.crates-io] 2 | #registry = "https://github.com/rust-lang/crates.io-index" 3 | #replace-with = "ustc" 4 | 5 | #[source.ustc] 6 | #registry = "git://mirrors.ustc.edu.cn/crates.io-index" 7 | 8 | [target.x86_64-pc-windows-gnu] 9 | linker = "/usr/bin/x86_64-w64-mingw32-gcc" 10 | ar = "/usr/x86_64-w64-mingw32/bin/ar" 11 | 12 | [target.x86_64-unknown-linux-gnu] 13 | linker = "/usr/bin/clang" 14 | rustflags = [ 15 | "-C", "link-arg=-fuse-ld=lld", 16 | "-C", "link-arg=-Xlinker", 17 | "-C", "link-arg=--no-mmap-output-file", 18 | "-C", "target-cpu=native" 19 | ] 20 | 21 | [build] 22 | #rustc-wrapper = "sccache" 23 | target-dir = "/home/aloxaf/.cache/cargo-build" 24 | 25 | #[http] 26 | #proxy = "socks5h://localhost:8877" 27 | -------------------------------------------------------------------------------- /ccache/.ccache/ccache.conf: -------------------------------------------------------------------------------- 1 | max_size = 5.0G 2 | -------------------------------------------------------------------------------- /conky/.conkyrc: -------------------------------------------------------------------------------- 1 | conky.config = { 2 | alignment = 'top_right', 3 | background = false, 4 | border_width = 1, 5 | cpu_avg_samples = 2, 6 | default_color = 'white', 7 | default_outline_color = 'white', 8 | default_shade_color = 'white', 9 | double_buffer = true, 10 | draw_borders = false, 11 | draw_graph_borders = true, 12 | draw_outline = false, 13 | draw_shades = false, 14 | use_xft = true, 15 | font = 'Droid Sans Mono:size=12', 16 | gap_x = 10, 17 | gap_y = 40, 18 | minimum_height = 5, 19 | minimum_width = 5, 20 | net_avg_samples = 2, 21 | no_buffers = true, 22 | out_to_console = false, 23 | out_to_ncurses = false, 24 | out_to_stderr = false, 25 | out_to_x = true, 26 | extra_newline = false, 27 | own_window = true, 28 | own_window_transparent = false, 29 | own_window_argb_visual = true, 30 | own_window_argb_value = 100, 31 | own_window_class = 'Conky', 32 | own_window_type = 'normal', 33 | stippled_borders = 0, 34 | update_interval = 1.0, 35 | uppercase = false, 36 | use_spacer = 'none', 37 | show_graph_scale = false, 38 | show_graph_range = false 39 | } 40 | 41 | conky.text = [[ 42 | $nodename 43 | $sysname $kernel on $machine 44 | $hr 45 | ${color grey}Uptime:$color $uptime 46 | ${color grey}Frequency (in MHz):$color $freq 47 | ${color grey}Frequency (in GHz):$color $freq_g 48 | ${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4} 49 | ${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4} 50 | ${color grey}CPU Usage:$color 51 | ${cpu cpu1}% ${cpubar cpu1 4} 52 | ${cpu cpu2}% ${cpubar cpu2 4} 53 | ${cpu cpu3}% ${cpubar cpu3 4} 54 | ${cpu cpu4}% ${cpubar cpu4 4} 55 | ${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes 56 | $hr 57 | ${color grey}File systems: 58 | / $color${fs_used /}/${fs_size /} ${fs_bar 6 /} 59 | $hr 60 | Up ${alignr}${upspeedf}k/s (${totalup}) 61 | Down ${alignr}${downspeedf enp1s0}k/s (${totaldown}) 62 | $hr 63 | ${color grey}Name PID CPU% MEM% 64 | ${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} 65 | ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} 66 | ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} 67 | ${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} 68 | ]] 69 | -------------------------------------------------------------------------------- /emacs-private/.emacs.d/private/org-roam/packages.el: -------------------------------------------------------------------------------- 1 | (defconst org-roam-packages 2 | '((org-roam))) 3 | 4 | (defun org-roam/init-org-roam () 5 | (use-package org-roam 6 | :after org 7 | :hook 8 | ((org-mode . org-roam-mode) 9 | ;; (after-init . org-roam--build-cache-async) ;; optional! 10 | ) 11 | :custom 12 | (org-roam-directory "~/Documents/org-roam") 13 | :init 14 | (progn 15 | (spacemacs/declare-prefix "ar" "org-roam") 16 | (spacemacs/set-leader-keys 17 | "arl" 'org-roam 18 | "art" 'org-roam-today 19 | "arf" 'org-roam-find-file 20 | "arg" 'org-roam-show-graph) 21 | (spacemacs/declare-prefix-for-mode 'org-mode "mr" "org-roam") 22 | (spacemacs/set-leader-keys-for-major-mode 'org-mode 23 | "rl" 'org-roam 24 | "rt" 'org-roam-today 25 | "rf" 'org-roam-find-file 26 | "ri" 'org-roam-insert 27 | "rg" 'org-roam-show-graph) 28 | ))) 29 | -------------------------------------------------------------------------------- /emacs-private/.emacs.d/private/smart-input-source/packages.el: -------------------------------------------------------------------------------- 1 | (defconst smart-input-source-packages 2 | '(sis)) 3 | 4 | (defun fcitx5-dbus-call-method (method) 5 | (dbus-call-method :session 6 | "org.fcitx.Fcitx5" 7 | "/controller" 8 | "org.fcitx.Fcitx.Controller1" 9 | method)) 10 | 11 | (defun smart-input-source/init-sis () 12 | (use-package sis 13 | :init 14 | (progn 15 | (setq sis-english-source 1) 16 | (setq-default sis-other-source 2)) 17 | :config 18 | (progn 19 | (require 'dbus) 20 | (setq sis-do-get 21 | (lambda () 22 | (fcitx5-dbus-call-method "State"))) 23 | (setq sis-do-set 24 | (lambda (source) 25 | (pcase source 26 | (1 (fcitx5-dbus-call-method "Deactivate")) 27 | (2 (fcitx5-dbus-call-method "Activate"))))) 28 | (setq sis-inline-tighten-head-rule 0) 29 | (sis-global-respect-mode t) 30 | (sis-global-follow-context-mode t) 31 | (sis-global-inline-mode t)) 32 | )) 33 | -------------------------------------------------------------------------------- /emacs-private/.emacs.d/private/tabnine/config.el: -------------------------------------------------------------------------------- 1 | ;;; config.el --- provide config about tabnine 2 | ;; 3 | ;; Copyright (c) 2015-2019 Mephis Pheies 4 | ;; 5 | ;; Author: Mephis Pheies 6 | ;; URL: https://github.com/MephistoMMM/memacs 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (defface tabnine-company-box-backend-tabnine-face 13 | '((t (:inherit font-lock-constant-face))) 14 | "company-box-backends-color for tabnine" 15 | :group 'spacemacs) 16 | 17 | (defface tabnine-company-box-backend-tabnine-selected-face 18 | '((t (:inherit company-box-selection))) 19 | "company-box-backends-color for tabnine select" 20 | :group 'spacemacs) 21 | 22 | 23 | ;;; config.el ends here 24 | -------------------------------------------------------------------------------- /emacs-private/.emacs.d/private/tabnine/funcs.el: -------------------------------------------------------------------------------- 1 | ;;; funcs.el --- provide functions about tabnine 2 | ;; 3 | ;; Copyright (c) 2015-2019 Mephis Pheies 4 | ;; 5 | ;; Author: Mephis Pheies 6 | ;; URL: https://github.com/MephistoMMM/memacs 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (defun tabnine//merge-company-tabnine-to-company-lsp () 13 | (when (memq 'company-lsp company-backends) 14 | (setq-local company-backends (remove 'company-lsp company-backends)) 15 | (add-to-list 'company-backends '(company-lsp :with company-tabnine :separate))) 16 | ) 17 | 18 | (defun tabnine//company-box-icons--tabnine (candidate) 19 | (when (eq (get-text-property 0 'company-backend candidate) 20 | 'company-tabnine) 21 | 'Reference)) 22 | 23 | (defun tabnine//sort-by-tabnine (candidates) 24 | "The first two candidates will be from company-lsp, the following two 25 | candidates will be from company-tabnine, others keeping their own origin order." 26 | (if (or (functionp company-backend) 27 | (not (and (listp company-backend) (memq 'company-tabnine company-backend)))) 28 | candidates 29 | (let ((candidates-table (make-hash-table :test #'equal)) 30 | candidates-1 31 | candidates-2) 32 | (dolist (candidate candidates) 33 | (if (eq (get-text-property 0 'company-backend candidate) 34 | 'company-tabnine) 35 | (unless (gethash candidate candidates-table) 36 | (push candidate candidates-2)) 37 | (push candidate candidates-1) 38 | (puthash candidate t candidates-table))) 39 | (setq candidates-1 (nreverse candidates-1)) 40 | (setq candidates-2 (nreverse candidates-2)) 41 | (nconc (seq-take candidates-1 2) 42 | (seq-take candidates-2 2) 43 | (seq-drop candidates-1 2) 44 | (seq-drop candidates-2 2))))) 45 | 46 | ;;; funcs.el ends here 47 | -------------------------------------------------------------------------------- /emacs-private/.emacs.d/private/tabnine/packages.el: -------------------------------------------------------------------------------- 1 | ;;; packages.el --- provide package about tabnine 2 | ;; 3 | ;; Copyright (c) 2015-2019 Mephis Pheies 4 | ;; 5 | ;; Author: Mephis Pheies 6 | ;; URL: https://github.com/MephistoMMM/memacs 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (defconst tabnine-packages 13 | '( 14 | lsp-mode 15 | company-box 16 | company 17 | (company-tabnine :requires company) 18 | )) 19 | 20 | (defun tabnine/post-init-lsp-mode () 21 | (with-eval-after-load 'lsp-mode 22 | (advice-add 'lsp :after #'tabnine//merge-company-tabnine-to-company-lsp)) 23 | ) 24 | 25 | (defun tabnine/post-init-company-box () 26 | (spacemacs|use-package-add-hook company-box 27 | :post-config 28 | (progn 29 | (push #'tabnine//company-box-icons--tabnine 30 | company-box-icons-functions) 31 | (map-put company-box-backends-colors 32 | 'company-tabnine '(:all 33 | tabnine-company-box-backend-tabnine-face 34 | :selected 35 | tabnine-company-box-backend-tabnine-selected-face)) 36 | ) 37 | ) 38 | ) 39 | 40 | (defun tabnine/post-init-company () 41 | (unless (configuration-layer/layer-used-p 'lsp) 42 | (with-eval-after-load 'company 43 | (push #'company-tabnine company-backends))) 44 | ) 45 | 46 | (defun tabnine/init-company-tabnine () 47 | (use-package company-tabnine 48 | :defer t 49 | :init 50 | (setq company-tabnine-binaries-folder "~/.tabnine") 51 | (setq company-tabnine-install-static-binary t) 52 | :config 53 | (progn 54 | ;; (setq company-tabnine-max-num-results 3) 55 | 56 | (add-to-list 'company-transformers 'tabnine//sort-by-tabnine t) 57 | ;; The free version of TabNine is good enough, 58 | ;; and below code is recommended that TabNine not always 59 | ;; prompt me to purchase a paid version in a large project. 60 | (defadvice company-echo-show (around disable-tabnine-upgrade-message activate) 61 | (let ((company-message-func (ad-get-arg 0))) 62 | (when (and company-message-func 63 | (stringp (funcall company-message-func))) 64 | (unless (string-match "The free version of TabNine only indexes up to" (funcall company-message-func)) 65 | ad-do-it)))) 66 | )) 67 | ) 68 | 69 | ;;; packages.el ends here 70 | -------------------------------------------------------------------------------- /fcitx/.config/fcitx/lua/data.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/lilydjwg/fcitx-lua-scripts/blob/master/date.lua 2 | function LookupDate(input) 3 | local fmt 4 | if input == '' then 5 | fmt = "%Y年%m月%d日" 6 | elseif input == 't' then 7 | fmt = "%Y-%m-%d %H:%M:%S" 8 | elseif input == 'd' then 9 | fmt = "%Y-%m-%d" 10 | end 11 | return os.date(fmt) 12 | end 13 | 14 | ime.register_command("dt", "LookupDate", "日期时间输入") 15 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/addon/engwords.conf: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=English Words 3 | Comment=remember english words 4 | Category=Module 5 | Type=Lua 6 | OnDemand=False 7 | Configurable=False 8 | Library=engwords.lua 9 | 10 | [Addon/Dependencies] 11 | 0=luaaddonloader 12 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/engwords/engwords.lua: -------------------------------------------------------------------------------- 1 | function exists(file) 2 | local _, rst = pcall(function() return io.open(file, "r") end) 3 | return rst ~= nil 4 | end 5 | 6 | local dir = "/home/aloxaf/.local/share/fcitx5/spell/en/" 7 | 8 | -- 文件不存在则新建一个 9 | if not exists(dir.."user.txt") then 10 | io.open(dir.."user.txt", "w+") 11 | end 12 | if not exists(dir.."history.txt") then 13 | io.open(dir.."history.txt", "w+") 14 | end 15 | 16 | -- 读取历史数据 17 | local file = assert(io.open(dir.."history.txt", "r")) 18 | local lines = {} 19 | if file ~= nil then 20 | for line in file:lines() do 21 | local match = string.gmatch(line, "[^ ]+") 22 | local times, str = match(), match() 23 | lines[str] = tonumber(times) 24 | end 25 | end 26 | 27 | -- 记录 last commit 的新词 28 | function commit_logger(text) 29 | if text:match("%W") ~= nil then 30 | return 31 | end 32 | if lines[text] == nil then 33 | lines[text] = 1 34 | elseif lines[text] < 65535 then 35 | lines[text] = lines[text] + 1 36 | end 37 | end 38 | 39 | -- 记录出现次数高的单词 40 | function rebuild_cache() 41 | local users = assert(io.open(dir.."user.txt", "w+")) 42 | local history = assert(io.open(dir.."history.txt", "w+")) 43 | for k,v in pairs(lines) do 44 | if v >= 3 then 45 | users:write(string.format("%d %s\n", v, k)) 46 | end 47 | history:write(string.format("%d %s\n", v, k)) 48 | end 49 | local size = users:seek("end") 50 | if size ~= 0 then 51 | local p = io.popen(string.format("%s --comp-dict %s %s", "/usr/lib/fcitx5/libexec/comp-spell-dict", dir.."user.txt", dir.."user.fscd")) 52 | p:read('*all') 53 | p:close() 54 | end 55 | end 56 | 57 | -- 重启 fcitx 58 | local enable_shuangpin = false 59 | function restart_fcitx(name) 60 | if name == "shuangpin" then 61 | enable_shuangpin = true 62 | elseif enable_shuangpin then 63 | enable_shuangpin = false 64 | io.popen("fcitx5 -r") 65 | end 66 | end 67 | 68 | local fcitx = require("fcitx") 69 | fcitx.watchEvent(fcitx.EventType.CommitString, "commit_logger") 70 | fcitx.watchEvent(fcitx.EventType.FocusOut, "rebuild_cache") 71 | -- fcitx.watchEvent("InputMethodDeactivatedEvent", "restart_fcitx") 72 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/extensions/autospace.lua: -------------------------------------------------------------------------------- 1 | local fcitx = require("fcitx") 2 | -- fcitx.addConverter("space") 3 | 4 | function is_english(str) 5 | return str:match("%W") == nil 6 | end 7 | 8 | local last_str = "" 9 | local last_is_eng = false 10 | local punctuation = "[。,?!]" 11 | 12 | function space(str) 13 | local cur_is_eng = is_english(str) 14 | 15 | if last_is_eng == cur_is_eng then 16 | return str 17 | end 18 | 19 | if last_is_eng and not cur_is_eng then 20 | -- 需要注意中文标点和英文之间一般不需要空格 21 | if not last_str:match(punctuation) then 22 | str = " "..str 23 | end 24 | elseif not last_is_eng and cur_is_eng then 25 | if not str:match(punctuation) then 26 | str = " "..str 27 | end 28 | end 29 | 30 | last_is_eng = cur_is_eng 31 | last_str = str 32 | return str 33 | end 34 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/extensions/calc.lua: -------------------------------------------------------------------------------- 1 | -- 参考 https://developer.51cto.com/art/201109/293595.htm 2 | 3 | function calc(input) 4 | local func = loadstring(string.format("return %s", input)) 5 | if func == nil then 6 | return "-- 表达式不正确 --" 7 | end 8 | local ret = func() 9 | if ret == math.huge or ret ~= ret then 10 | return "-- 计算错误 --" 11 | end 12 | return ret 13 | end 14 | 15 | ime.register_command("cl", "calc", "数学计算", "alpha", "进行简单的数学计算机") 16 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/extensions/engchr.lua: -------------------------------------------------------------------------------- 1 | local fcitx = require("fcitx") 2 | 3 | fcitx.watchEvent(fcitx.EventType.KeyEvent, "eng_chr_key_event") 4 | fcitx.addConverter("eng_chr") 5 | 6 | local enable = false 7 | 8 | function eng_chr_key_event(sym, state, release) 9 | -- print(string.format("%d %d %s", sym, state, release)) 10 | if sym == 65513 then 11 | enable = not release 12 | end 13 | end 14 | 15 | local tb = { 16 | ["、"] = "\\", 17 | ["·"] = "`", 18 | ["~"] = "~", 19 | ["……"] = "^", 20 | } 21 | 22 | function eng_chr(str) 23 | print(string.format("call eng_chr: %s", enable)) 24 | -- 空格模式 25 | if enable then 26 | if tb[str] then 27 | str = tb[str] 28 | end 29 | end 30 | return str 31 | end 32 | 33 | -- 34 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/extensions/konge.lua: -------------------------------------------------------------------------------- 1 | local fcitx = require("fcitx") 2 | 3 | fcitx.watchEvent(fcitx.EventType.KeyEvent, "konge_key_event") 4 | fcitx.addConverter("konge") 5 | 6 | local enable = false 7 | 8 | function konge_key_event(sym, state, release) 9 | if state == fcitx.KeyState.Ctrl_Shift and sym == 32 and not release then 10 | -- Ctrl + Shift + Space 11 | enable = not enable 12 | if enable then 13 | io.popen("notify-send '空格模式开启'") 14 | else 15 | io.popen("notify-send '空格模式关闭'") 16 | end 17 | print(string.format("change state of konge: %s", enable)) 18 | return true 19 | end 20 | return false 21 | end 22 | 23 | function konge(str) 24 | print(string.format("call konge: %s", enable)) 25 | -- 空格模式 26 | if enable then 27 | local tmp = string.gsub(str, utf8.charpattern, "%1 ") 28 | if tmp ~= nil then 29 | str = tmp 30 | end 31 | end 32 | return str 33 | end 34 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/extensions/switch.lua: -------------------------------------------------------------------------------- 1 | local fcitx = require("fcitx") 2 | 3 | fcitx.watchEvent(fcitx.EventType.KeyEvent, "switch_key_event") 4 | 5 | local fcitx_enable = false 6 | 7 | function switch_key_event(sym, state, release) 8 | if state == fcitx.KeyState.Ctrl_Alt and sym == 32 and not release then 9 | -- Ctrl + Alt + Space 10 | -- for cdda 11 | fcitx_enable = not fcitx_enable 12 | if fcitx_enable then 13 | io.popen("fcitx5-remote -o") 14 | io.popen("notify-send '输入法激活'") 15 | else 16 | io.popen("fcitx5-remote -c") 17 | io.popen("notify-send '输入法禁用'") 18 | end 19 | print(string.format("change state of ime: %s", fcitx_enable)) 20 | return true 21 | end 22 | return false 23 | end 24 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/extensions/timestamp.lua: -------------------------------------------------------------------------------- 1 | function timestamp() 2 | return os.time(os.date("!*t")) 3 | end 4 | 5 | ime.register_trigger("timestamp", "UNIX 时间戳", { }, { "时间戳" }) 6 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/lua/imeapi/imeapi.lua: -------------------------------------------------------------------------------- 1 | /usr/share/fcitx5/lua/imeapi/imeapi.lua -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/punctuation/punc.mb.zh_CN: -------------------------------------------------------------------------------- 1 | . 。 2 | , , 3 | ? ? 4 | " “ ” 5 | : : 6 | ; ; 7 | ' ‘ ’ 8 | < 《 9 | > 》 10 | \ 、 11 | ! ! 12 | $ ¥ 13 | ^ …… 14 | * × 15 | _ —— 16 | ( ( 17 | ) ) 18 | [ 【 19 | ] 】 20 | ` · 21 | ~ ~ 22 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx-simple-dark/highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aloxaf/dotfiles/af3e9ac7a7fcc8cc1a446154644515b0530fe4a1/fcitx/.local/share/fcitx5/themes/fcitx-simple-dark/highlight.png -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx-simple-dark/panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aloxaf/dotfiles/af3e9ac7a7fcc8cc1a446154644515b0530fe4a1/fcitx/.local/share/fcitx5/themes/fcitx-simple-dark/panel.png -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx-simple-dark/theme.conf: -------------------------------------------------------------------------------- 1 | [Metadata] 2 | Name=fcitx5-simple-dark 3 | Version=0.1.0 4 | Author=Aloxaf 5 | Description=真的很简单的黑色主题 6 | ScaleWithDPI=True 7 | 8 | [InputPanel] 9 | Font=Sans 12 10 | NormalColor=#bbbbbb 11 | HighlightColor=#ffffff 12 | Spacing=3 13 | 14 | [InputPanel/TextMargin] 15 | Left=7 16 | Right=7 17 | Top=1 18 | Bottom=7 19 | 20 | [InputPanel/ContentMargin] 21 | Left=10 22 | Right=15 23 | Top=10 24 | Bottom=10 25 | 26 | [InputPanel/Background] 27 | Image=panel.png 28 | 29 | [InputPanel/Background/Margin] 30 | Left=10 31 | Right=15 32 | Top=10 33 | Bottom=10 34 | 35 | [InputPanel/Highlight] 36 | Image=highlight.png 37 | 38 | [InputPanel/Highlight/Margin] 39 | Left=5 40 | Right=5 41 | Top=5 42 | Bottom=5 43 | 44 | -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aloxaf/dotfiles/af3e9ac7a7fcc8cc1a446154644515b0530fe4a1/fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/highlight.png -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aloxaf/dotfiles/af3e9ac7a7fcc8cc1a446154644515b0530fe4a1/fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/overlay.png -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aloxaf/dotfiles/af3e9ac7a7fcc8cc1a446154644515b0530fe4a1/fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/panel.png -------------------------------------------------------------------------------- /fcitx/.local/share/fcitx5/themes/fcitx5-simple-dark-chino/theme.conf: -------------------------------------------------------------------------------- 1 | [Metadata] 2 | Name=fcitx5-simple-dark-chino 3 | Version=0.1.0 4 | Author=Aloxaf 5 | Description=真的很简单的黑色主题,with 智乃 6 | ScaleWithDPI=True 7 | 8 | [InputPanel] 9 | Font=Sans 12 10 | NormalColor=#cccccc 11 | HighlightColor=#ffffff 12 | HighlightCandidateColor=#ffffff 13 | Spacing=3 14 | EnableBlur=True 15 | 16 | [InputPanel/BlurMargin] 17 | Left=1 18 | Right=7 19 | Top=0 20 | Bottom=8 21 | 22 | [InputPanel/TextMargin] 23 | Left=7 24 | Right=7 25 | Top=1 26 | Bottom=7 27 | 28 | [InputPanel/ContentMargin] 29 | Left=10 30 | Right=15 31 | Top=10 32 | Bottom=10 33 | 34 | [InputPanel/Background] 35 | Image=panel.png 36 | Overlay=overlay.png 37 | Gravity=Top Right 38 | HideOverlayIfOversize=True 39 | 40 | [InputPanel/Background/Margin] 41 | Left=10 42 | Right=15 43 | Top=10 44 | Bottom=10 45 | 46 | [InputPanel/Highlight] 47 | Image=highlight.png 48 | 49 | [InputPanel/Highlight/Margin] 50 | Left=5 51 | Right=5 52 | Top=5 53 | Bottom=5 54 | -------------------------------------------------------------------------------- /fontconfig/.config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | lcddefault 7 | 8 | 9 | 10 | 11 | 12 | sans-serif 13 | 14 | 15 | Noto Sans 16 | Noto Sans CJK SC 17 | Blobmoji 18 | 19 | 20 | 21 | 22 | 23 | serif 24 | 25 | 26 | Noto Serif 27 | Noto Serif CJK SC 28 | Blobmoji 29 | 30 | 31 | 32 | 33 | 34 | monospace 35 | 36 | 37 | Fira Code 38 | Noto Sans Mono 39 | Noto Sans CJK SC 40 | Blobmoji 41 | 42 | 43 | 44 | 45 | ui-monospace 46 | 47 | 48 | Fira Code 49 | Noto Sans Mono 50 | Noto Sans CJK SC 51 | Blobmoji 52 | 53 | 54 | 55 | ~/.fonts 56 | 57 | 58 | true 59 | 60 | 61 | 62 | 63 | hintslight 64 | 65 | 66 | 67 | 68 | true 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /git/.gitconfig: -------------------------------------------------------------------------------- 1 | [http] 2 | sslverify = true 3 | [https] 4 | [user] 5 | email = aloxafx@gmail.com 6 | name = Aloxaf 7 | signingkey = A07920B86500DE6C 8 | [filter "lfs"] 9 | required = true 10 | clean = git-lfs clean -- %f 11 | smudge = git-lfs smudge -- %f 12 | process = git-lfs filter-process 13 | [commit] 14 | gpgsign = true 15 | template = ~/.gitmessage 16 | [help] 17 | autocorrect = 1 18 | [pull] 19 | ff = only 20 | 21 | [core] 22 | pager = delta 23 | [interactive] 24 | diffFilter = delta --color-only 25 | [delta] 26 | features = decorations line-numbers 27 | syntax-theme = Dracula 28 | [delta "decorations"] 29 | commit-decoration-style = bold yellow box 30 | file-style = bold 12 ul 31 | file-decoration-style = none 32 | [delta "line-numbers"] 33 | line-numbers-left-format = "{nm:>3}┊" 34 | line-numbers-right-format = "{np:>3}│ " 35 | line-numbers-zero-style = "#888888" 36 | [push] 37 | followTags = true 38 | -------------------------------------------------------------------------------- /git/.gitmessage: -------------------------------------------------------------------------------- 1 | # head: (): 2 | # - type: feat, fix, docs, style, refactor, test, chore 3 | # - scope: can be empty (eg. if the change is a global or difficult to assign to a single component) 4 | # - subject: start with verb (such as 'change'), 50-character line 5 | # 6 | # body: 72-character wrapped. This should answer: 7 | # * Why was this change necessary? 8 | # * How does it address the problem? 9 | # * Are there any side effects? 10 | # 11 | # footer: 12 | # - Include a link to the ticket, if any. 13 | # - BREAKING CHANGE 14 | # 15 | -------------------------------------------------------------------------------- /ipython/.config/ipython/profile_default/ipython_config.py: -------------------------------------------------------------------------------- 1 | # Configuration file for ipython. 2 | 3 | #------------------------------------------------------------------------------ 4 | # InteractiveShellApp(Configurable) configuration 5 | #------------------------------------------------------------------------------ 6 | 7 | ## A Mixin for applications that start InteractiveShell instances. 8 | # 9 | # Provides configurables for loading extensions and executing files as part of 10 | # configuring a Shell environment. 11 | # 12 | # The following methods should be called by the :meth:`initialize` method of the 13 | # subclass: 14 | # 15 | # - :meth:`init_path` 16 | # - :meth:`init_shell` (to be implemented by the subclass) 17 | # - :meth:`init_gui_pylab` 18 | # - :meth:`init_extensions` 19 | # - :meth:`init_code` 20 | 21 | ## Execute the given command string. 22 | #c.InteractiveShellApp.code_to_run = '' 23 | 24 | ## Run the file referenced by the PYTHONSTARTUP environment variable at IPython 25 | # startup. 26 | #c.InteractiveShellApp.exec_PYTHONSTARTUP = True 27 | 28 | ## List of files to run at IPython startup. 29 | #c.InteractiveShellApp.exec_files = [] 30 | 31 | ## lines of code to run at IPython startup. 32 | #c.InteractiveShellApp.exec_lines = [] 33 | 34 | ## A list of dotted module names of IPython extensions to load. 35 | c.InteractiveShellApp.extensions = [ 36 | "autoreload", 37 | "naipyext.sp", 38 | "naipyext.autotime", 39 | ] 40 | 41 | ## dotted module name of an IPython extension to load. 42 | #c.InteractiveShellApp.extra_extension = '' 43 | 44 | ## A file to be run 45 | #c.InteractiveShellApp.file_to_run = '' 46 | 47 | ## Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2', 'gtk3', 48 | # 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4'). 49 | #c.InteractiveShellApp.gui = None 50 | 51 | ## Should variables loaded at startup (by startup files, exec_lines, etc.) be 52 | # hidden from tools like %who? 53 | #c.InteractiveShellApp.hide_initial_ns = True 54 | 55 | ## Configure matplotlib for interactive use with the default matplotlib backend. 56 | #c.InteractiveShellApp.matplotlib = None 57 | 58 | ## Run the module as a script. 59 | #c.InteractiveShellApp.module_to_run = '' 60 | 61 | ## Pre-load matplotlib and numpy for interactive use, selecting a particular 62 | # matplotlib backend and loop integration. 63 | #c.InteractiveShellApp.pylab = None 64 | 65 | ## If true, IPython will populate the user namespace with numpy, pylab, etc. and 66 | # an ``import *`` is done from numpy and pylab, when using pylab mode. 67 | # 68 | # When False, pylab mode should not import any names into the user namespace. 69 | #c.InteractiveShellApp.pylab_import_all = True 70 | 71 | ## Reraise exceptions encountered loading IPython extensions? 72 | #c.InteractiveShellApp.reraise_ipython_extension_failures = False 73 | 74 | #------------------------------------------------------------------------------ 75 | # Application(SingletonConfigurable) configuration 76 | #------------------------------------------------------------------------------ 77 | 78 | ## This is an application. 79 | 80 | ## The date format used by logging formatters for %(asctime)s 81 | #c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' 82 | 83 | ## The Logging format template 84 | #c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s' 85 | 86 | ## Set the log level by value or name. 87 | #c.Application.log_level = 30 88 | 89 | #------------------------------------------------------------------------------ 90 | # BaseIPythonApplication(Application) configuration 91 | #------------------------------------------------------------------------------ 92 | 93 | ## IPython: an enhanced interactive Python shell. 94 | 95 | ## Whether to create profile dir if it doesn't exist 96 | #c.BaseIPythonApplication.auto_create = False 97 | 98 | ## Whether to install the default config files into the profile dir. If a new 99 | # profile is being created, and IPython contains config files for that profile, 100 | # then they will be staged into the new directory. Otherwise, default config 101 | # files will be automatically generated. 102 | #c.BaseIPythonApplication.copy_config_files = False 103 | 104 | ## Path to an extra config file to load. 105 | # 106 | # If specified, load this config file in addition to any other IPython config. 107 | #c.BaseIPythonApplication.extra_config_file = '' 108 | 109 | ## The name of the IPython directory. This directory is used for logging 110 | # configuration (through profiles), history storage, etc. The default is usually 111 | # $HOME/.ipython. This option can also be specified through the environment 112 | # variable IPYTHONDIR. 113 | #c.BaseIPythonApplication.ipython_dir = '' 114 | 115 | ## Whether to overwrite existing config files when copying 116 | #c.BaseIPythonApplication.overwrite = False 117 | 118 | ## The IPython profile to use. 119 | #c.BaseIPythonApplication.profile = 'default' 120 | 121 | ## Create a massive crash report when IPython encounters what may be an internal 122 | # error. The default is to append a short message to the usual traceback 123 | #c.BaseIPythonApplication.verbose_crash = False 124 | 125 | #------------------------------------------------------------------------------ 126 | # TerminalIPythonApp(BaseIPythonApplication,InteractiveShellApp) configuration 127 | #------------------------------------------------------------------------------ 128 | 129 | ## Whether to display a banner upon starting IPython. 130 | #c.TerminalIPythonApp.display_banner = True 131 | 132 | ## If a command or file is given via the command-line, e.g. 'ipython foo.py', 133 | # start an interactive shell after executing the file or command. 134 | #c.TerminalIPythonApp.force_interact = False 135 | 136 | ## Class to use to instantiate the TerminalInteractiveShell object. Useful for 137 | # custom Frontends 138 | #c.TerminalIPythonApp.interactive_shell_class = 'IPython.terminal.interactiveshell.TerminalInteractiveShell' 139 | 140 | ## Start IPython quickly by skipping the loading of config files. 141 | #c.TerminalIPythonApp.quick = False 142 | 143 | #------------------------------------------------------------------------------ 144 | # InteractiveShell(SingletonConfigurable) configuration 145 | #------------------------------------------------------------------------------ 146 | 147 | ## An enhanced, interactive shell for Python. 148 | 149 | ## 'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which 150 | # nodes should be run interactively (displaying output from expressions). 151 | #c.InteractiveShell.ast_node_interactivity = 'last_expr' 152 | 153 | ## A list of ast.NodeTransformer subclass instances, which will be applied to 154 | # user input before code is run. 155 | #c.InteractiveShell.ast_transformers = [] 156 | 157 | ## Make IPython automatically call any callable object even if you didn't type 158 | # explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically. 159 | # The value can be '0' to disable the feature, '1' for 'smart' autocall, where 160 | # it is not applied if there are no more arguments on the line, and '2' for 161 | # 'full' autocall, where all callable objects are automatically called (even if 162 | # no arguments are present). 163 | c.InteractiveShell.autocall = 1 164 | 165 | ## Autoindent IPython code entered interactively. 166 | #c.InteractiveShell.autoindent = True 167 | 168 | ## Enable magic commands to be called without the leading %. 169 | #c.InteractiveShell.automagic = True 170 | 171 | ## The part of the banner to be printed before the profile 172 | #c.InteractiveShell.banner1 = "Python 3.7.0 (default, Jul 15 2018, 10:44:58) \nType 'copyright', 'credits' or 'license' for more information\nIPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.\n" 173 | 174 | ## The part of the banner to be printed after the profile 175 | #c.InteractiveShell.banner2 = '' 176 | 177 | ## Set the size of the output cache. The default is 1000, you can change it 178 | # permanently in your config file. Setting it to 0 completely disables the 179 | # caching system, and the minimum value accepted is 3 (if you provide a value 180 | # less than 3, it is reset to 0 and a warning is issued). This limit is defined 181 | # because otherwise you'll spend more time re-flushing a too small cache than 182 | # working 183 | #c.InteractiveShell.cache_size = 1000 184 | 185 | ## Use colors for displaying information about objects. Because this information 186 | # is passed through a pager (like 'less'), and some pagers get confused with 187 | # color codes, this capability can be turned off. 188 | #c.InteractiveShell.color_info = True 189 | 190 | ## Set the color scheme (NoColor, Neutral, Linux, or LightBG). 191 | #c.InteractiveShell.colors = 'Neutral' 192 | 193 | ## 194 | #c.InteractiveShell.debug = False 195 | 196 | ## Don't call post-execute functions that have failed in the past. 197 | #c.InteractiveShell.disable_failing_post_execute = False 198 | 199 | ## If True, anything that would be passed to the pager will be displayed as 200 | # regular output instead. 201 | #c.InteractiveShell.display_page = False 202 | 203 | ## (Provisional API) enables html representation in mime bundles sent to pagers. 204 | #c.InteractiveShell.enable_html_pager = False 205 | 206 | ## Total length of command history 207 | #c.InteractiveShell.history_length = 10000 208 | 209 | ## The number of saved history entries to be loaded into the history buffer at 210 | # startup. 211 | #c.InteractiveShell.history_load_length = 1000 212 | 213 | ## 214 | #c.InteractiveShell.ipython_dir = '' 215 | 216 | ## Start logging to the given file in append mode. Use `logfile` to specify a log 217 | # file to **overwrite** logs to. 218 | #c.InteractiveShell.logappend = '' 219 | 220 | ## The name of the logfile to use. 221 | #c.InteractiveShell.logfile = '' 222 | 223 | ## Start logging to the default log file in overwrite mode. Use `logappend` to 224 | # specify a log file to **append** logs to. 225 | #c.InteractiveShell.logstart = False 226 | 227 | ## 228 | #c.InteractiveShell.object_info_string_level = 0 229 | 230 | ## Automatically call the pdb debugger after every exception. 231 | # c.InteractiveShell.pdb = True 232 | 233 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 234 | # TerminalInteractiveShell.prompts object directly. 235 | #c.InteractiveShell.prompt_in1 = 'In [\\#]: ' 236 | 237 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 238 | # TerminalInteractiveShell.prompts object directly. 239 | #c.InteractiveShell.prompt_in2 = ' .\\D.: ' 240 | 241 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 242 | # TerminalInteractiveShell.prompts object directly. 243 | #c.InteractiveShell.prompt_out = 'Out[\\#]: ' 244 | 245 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 246 | # TerminalInteractiveShell.prompts object directly. 247 | #c.InteractiveShell.prompts_pad_left = True 248 | 249 | ## 250 | #c.InteractiveShell.quiet = False 251 | 252 | ## 253 | #c.InteractiveShell.separate_in = '\n' 254 | 255 | ## 256 | #c.InteractiveShell.separate_out = '' 257 | 258 | ## 259 | #c.InteractiveShell.separate_out2 = '' 260 | 261 | ## Show rewritten input, e.g. for autocall. 262 | #c.InteractiveShell.show_rewritten_input = True 263 | 264 | ## Enables rich html representation of docstrings. (This requires the docrepr 265 | # module). 266 | #c.InteractiveShell.sphinxify_docstring = False 267 | 268 | ## 269 | #c.InteractiveShell.wildcards_case_sensitive = True 270 | 271 | ## Switch modes for the IPython exception handlers. 272 | #c.InteractiveShell.xmode = 'Context' 273 | 274 | #------------------------------------------------------------------------------ 275 | # TerminalInteractiveShell(InteractiveShell) configuration 276 | #------------------------------------------------------------------------------ 277 | 278 | ## Set to confirm when you try to exit IPython with an EOF (Control-D in Unix, 279 | # Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a 280 | # direct exit without any confirmation. 281 | #c.TerminalInteractiveShell.confirm_exit = True 282 | 283 | ## Options for displaying tab completions, 'column', 'multicolumn', and 284 | # 'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit` 285 | # documentation for more information. 286 | #c.TerminalInteractiveShell.display_completions = 'multicolumn' 287 | 288 | ## Shortcut style to use at the prompt. 'vi' or 'emacs'. 289 | #c.TerminalInteractiveShell.editing_mode = 'emacs' 290 | 291 | ## Set the editor used by IPython (default to $EDITOR/vi/notepad). 292 | # c.TerminalInteractiveShell.editor = "emacsclient -n -c -a ''" 293 | 294 | ## Allows to enable/disable the prompt toolkit history search 295 | #c.TerminalInteractiveShell.enable_history_search = True 296 | 297 | ## Enable vi (v) or Emacs (C-X C-E) shortcuts to open an external editor. This is 298 | # in addition to the F2 binding, which is always enabled. 299 | c.TerminalInteractiveShell.extra_open_editor_shortcuts = True 300 | 301 | ## Provide an alternative handler to be called when the user presses Return. This 302 | # is an advanced option intended for debugging, which may be changed or removed 303 | # in later releases. 304 | #c.TerminalInteractiveShell.handle_return = None 305 | 306 | ## Highlight matching brackets. 307 | #c.TerminalInteractiveShell.highlight_matching_brackets = True 308 | 309 | ## The name or class of a Pygments style to use for syntax highlighting. To see 310 | # available styles, run `pygmentize -L styles`. 311 | #c.TerminalInteractiveShell.highlighting_style = traitlets.Undefined 312 | 313 | ## Override highlighting format for specific tokens 314 | #c.TerminalInteractiveShell.highlighting_style_overrides = {} 315 | 316 | ## Enable mouse support in the prompt (Note: prevents selecting text with the 317 | # mouse) 318 | #c.TerminalInteractiveShell.mouse_support = False 319 | 320 | ## Class used to generate Prompt token for prompt_toolkit 321 | #c.TerminalInteractiveShell.prompts_class = 'IPython.terminal.prompts.Prompts' 322 | 323 | ## Use `raw_input` for the REPL, without completion and prompt colors. 324 | # 325 | # Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR. 326 | # Known usage are: IPython own testing machinery, and emacs inferior-shell 327 | # integration through elpy. 328 | # 329 | # This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT` environment 330 | # variable is set, or the current terminal is not a tty. 331 | #c.TerminalInteractiveShell.simple_prompt = False 332 | 333 | ## Number of line at the bottom of the screen to reserve for the completion menu 334 | #c.TerminalInteractiveShell.space_for_menu = 6 335 | 336 | ## Automatically set the terminal title 337 | #c.TerminalInteractiveShell.term_title = True 338 | 339 | ## Customize the terminal title format. This is a python format string. 340 | # Available substitutions are: {cwd}. 341 | #c.TerminalInteractiveShell.term_title_format = 'IPython: {cwd}' 342 | 343 | ## Use 24bit colors instead of 256 colors in prompt highlighting. If your 344 | # terminal supports true color, the following command should print 'TRUECOLOR' 345 | # in orange: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n" 346 | #c.TerminalInteractiveShell.true_color = False 347 | 348 | #------------------------------------------------------------------------------ 349 | # HistoryAccessor(HistoryAccessorBase) configuration 350 | #------------------------------------------------------------------------------ 351 | 352 | ## Access the history database without adding to it. 353 | # 354 | # This is intended for use by standalone history tools. IPython shells use 355 | # HistoryManager, below, which is a subclass of this. 356 | 357 | ## Options for configuring the SQLite connection 358 | # 359 | # These options are passed as keyword args to sqlite3.connect when establishing 360 | # database connections. 361 | #c.HistoryAccessor.connection_options = {} 362 | 363 | ## enable the SQLite history 364 | # 365 | # set enabled=False to disable the SQLite history, in which case there will be 366 | # no stored history, no SQLite connection, and no background saving thread. 367 | # This may be necessary in some threaded environments where IPython is embedded. 368 | #c.HistoryAccessor.enabled = True 369 | 370 | ## Path to file to use for SQLite history database. 371 | # 372 | # By default, IPython will put the history database in the IPython profile 373 | # directory. If you would rather share one history among profiles, you can set 374 | # this value in each, so that they are consistent. 375 | # 376 | # Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts. 377 | # If you see IPython hanging, try setting this to something on a local disk, 378 | # e.g:: 379 | # 380 | # ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite 381 | # 382 | # you can also use the specific value `:memory:` (including the colon at both 383 | # end but not the back ticks), to avoid creating an history file. 384 | #c.HistoryAccessor.hist_file = '' 385 | 386 | #------------------------------------------------------------------------------ 387 | # HistoryManager(HistoryAccessor) configuration 388 | #------------------------------------------------------------------------------ 389 | 390 | ## A class to organize all history-related functionality in one place. 391 | 392 | ## Write to database every x commands (higher values save disk access & power). 393 | # Values of 1 or less effectively disable caching. 394 | #c.HistoryManager.db_cache_size = 0 395 | 396 | ## Should the history database include output? (default: no) 397 | #c.HistoryManager.db_log_output = False 398 | 399 | #------------------------------------------------------------------------------ 400 | # ProfileDir(LoggingConfigurable) configuration 401 | #------------------------------------------------------------------------------ 402 | 403 | ## An object to manage the profile directory and its resources. 404 | # 405 | # The profile directory is used by all IPython applications, to manage 406 | # configuration, logging and security. 407 | # 408 | # This object knows how to find, create and manage these directories. This 409 | # should be used by any code that wants to handle profiles. 410 | 411 | ## Set the profile location directly. This overrides the logic used by the 412 | # `profile` option. 413 | #c.ProfileDir.location = '' 414 | 415 | #------------------------------------------------------------------------------ 416 | # BaseFormatter(Configurable) configuration 417 | #------------------------------------------------------------------------------ 418 | 419 | ## A base formatter class that is configurable. 420 | # 421 | # This formatter should usually be used as the base class of all formatters. It 422 | # is a traited :class:`Configurable` class and includes an extensible API for 423 | # users to determine how their objects are formatted. The following logic is 424 | # used to find a function to format an given object. 425 | # 426 | # 1. The object is introspected to see if it has a method with the name 427 | # :attr:`print_method`. If is does, that object is passed to that method 428 | # for formatting. 429 | # 2. If no print method is found, three internal dictionaries are consulted 430 | # to find print method: :attr:`singleton_printers`, :attr:`type_printers` 431 | # and :attr:`deferred_printers`. 432 | # 433 | # Users should use these dictionaries to register functions that will be used to 434 | # compute the format data for their objects (if those objects don't have the 435 | # special print methods). The easiest way of using these dictionaries is through 436 | # the :meth:`for_type` and :meth:`for_type_by_name` methods. 437 | # 438 | # If no function/callable is found to compute the format data, ``None`` is 439 | # returned and this format type is not used. 440 | 441 | ## 442 | #c.BaseFormatter.deferred_printers = {} 443 | 444 | ## 445 | #c.BaseFormatter.enabled = True 446 | 447 | ## 448 | #c.BaseFormatter.singleton_printers = {} 449 | 450 | ## 451 | #c.BaseFormatter.type_printers = {} 452 | 453 | #------------------------------------------------------------------------------ 454 | # PlainTextFormatter(BaseFormatter) configuration 455 | #------------------------------------------------------------------------------ 456 | 457 | ## The default pretty-printer. 458 | # 459 | # This uses :mod:`IPython.lib.pretty` to compute the format data of the object. 460 | # If the object cannot be pretty printed, :func:`repr` is used. See the 461 | # documentation of :mod:`IPython.lib.pretty` for details on how to write pretty 462 | # printers. Here is a simple example:: 463 | # 464 | # def dtype_pprinter(obj, p, cycle): 465 | # if cycle: 466 | # return p.text('dtype(...)') 467 | # if hasattr(obj, 'fields'): 468 | # if obj.fields is None: 469 | # p.text(repr(obj)) 470 | # else: 471 | # p.begin_group(7, 'dtype([') 472 | # for i, field in enumerate(obj.descr): 473 | # if i > 0: 474 | # p.text(',') 475 | # p.breakable() 476 | # p.pretty(field) 477 | # p.end_group(7, '])') 478 | 479 | ## 480 | #c.PlainTextFormatter.float_precision = '' 481 | 482 | ## Truncate large collections (lists, dicts, tuples, sets) to this size. 483 | # 484 | # Set to 0 to disable truncation. 485 | #c.PlainTextFormatter.max_seq_length = 1000 486 | 487 | ## 488 | #c.PlainTextFormatter.max_width = 79 489 | 490 | ## 491 | #c.PlainTextFormatter.newline = '\n' 492 | 493 | ## 494 | #c.PlainTextFormatter.pprint = True 495 | 496 | ## 497 | #c.PlainTextFormatter.verbose = False 498 | 499 | #------------------------------------------------------------------------------ 500 | # Completer(Configurable) configuration 501 | #------------------------------------------------------------------------------ 502 | 503 | ## Enable unicode completions, e.g. \alpha . Includes completion of latex 504 | # commands, unicode names, and expanding unicode characters back to latex 505 | # commands. 506 | #c.Completer.backslash_combining_completions = True 507 | 508 | ## Enable debug for the Completer. Mostly print extra information for 509 | # experimental jedi integration. 510 | #c.Completer.debug = False 511 | 512 | ## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care 513 | # of with Jedi. 514 | # 515 | # This will enable completion on elements of lists, results of function calls, 516 | # etc., but can be unsafe because the code is actually evaluated on TAB. 517 | #c.Completer.greedy = False 518 | 519 | ## Experimental: restrict time (in milliseconds) during which Jedi can compute 520 | # types. Set to 0 to stop computing types. Non-zero value lower than 100ms may 521 | # hurt performance by preventing jedi to build its cache. 522 | #c.Completer.jedi_compute_type_timeout = 400 523 | 524 | ## Experimental: Use Jedi to generate autocompletions. Off by default. 525 | #c.Completer.use_jedi = False 526 | 527 | #------------------------------------------------------------------------------ 528 | # IPCompleter(Completer) configuration 529 | #------------------------------------------------------------------------------ 530 | 531 | ## Extension of the completer class with IPython-specific features 532 | 533 | ## DEPRECATED as of version 5.0. 534 | # 535 | # Instruct the completer to use __all__ for the completion 536 | # 537 | # Specifically, when completing on ``object.``. 538 | # 539 | # When True: only those names in obj.__all__ will be included. 540 | # 541 | # When False [default]: the __all__ attribute is ignored 542 | #c.IPCompleter.limit_to__all__ = False 543 | 544 | ## Whether to merge completion results into a single list 545 | # 546 | # If False, only the completion results from the first non-empty completer will 547 | # be returned. 548 | #c.IPCompleter.merge_completions = True 549 | 550 | ## Instruct the completer to omit private method names 551 | # 552 | # Specifically, when completing on ``object.``. 553 | # 554 | # When 2 [default]: all names that start with '_' will be excluded. 555 | # 556 | # When 1: all 'magic' names (``__foo__``) will be excluded. 557 | # 558 | # When 0: nothing will be excluded. 559 | #c.IPCompleter.omit__names = 2 560 | 561 | #------------------------------------------------------------------------------ 562 | # ScriptMagics(Magics) configuration 563 | #------------------------------------------------------------------------------ 564 | 565 | ## Magics for talking to scripts 566 | # 567 | # This defines a base `%%script` cell magic for running a cell with a program in 568 | # a subprocess, and registers a few top-level magics that call %%script with 569 | # common interpreters. 570 | 571 | ## Extra script cell magics to define 572 | # 573 | # This generates simple wrappers of `%%script foo` as `%%foo`. 574 | # 575 | # If you want to add script magics that aren't on your path, specify them in 576 | # script_paths 577 | #c.ScriptMagics.script_magics = [] 578 | 579 | ## Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby' 580 | # 581 | # Only necessary for items in script_magics where the default path will not find 582 | # the right interpreter. 583 | #c.ScriptMagics.script_paths = {} 584 | 585 | #------------------------------------------------------------------------------ 586 | # LoggingMagics(Magics) configuration 587 | #------------------------------------------------------------------------------ 588 | 589 | ## Magics related to all logging machinery. 590 | 591 | ## Suppress output of log state when logging is enabled 592 | #c.LoggingMagics.quiet = False 593 | 594 | #------------------------------------------------------------------------------ 595 | # StoreMagics(Magics) configuration 596 | #------------------------------------------------------------------------------ 597 | 598 | ## Lightweight persistence for python variables. 599 | # 600 | # Provides the %store magic. 601 | 602 | ## If True, any %store-d variables will be automatically restored when IPython 603 | # starts. 604 | #c.StoreMagics.autorestore = False 605 | -------------------------------------------------------------------------------- /ipython/.config/ipython/profile_default/ipython_kernel_config.py: -------------------------------------------------------------------------------- 1 | # Configuration file for ipython-kernel. 2 | 3 | #------------------------------------------------------------------------------ 4 | # ConnectionFileMixin(LoggingConfigurable) configuration 5 | #------------------------------------------------------------------------------ 6 | 7 | ## Mixin for configurable classes that work with connection files 8 | 9 | ## JSON file in which to store connection info [default: kernel-.json] 10 | # 11 | # This file will contain the IP, ports, and authentication key needed to connect 12 | # clients to this kernel. By default, this file will be created in the security 13 | # dir of the current profile, but can be specified by absolute path. 14 | #c.ConnectionFileMixin.connection_file = '' 15 | 16 | ## set the control (ROUTER) port [default: random] 17 | #c.ConnectionFileMixin.control_port = 0 18 | 19 | ## set the heartbeat port [default: random] 20 | #c.ConnectionFileMixin.hb_port = 0 21 | 22 | ## set the iopub (PUB) port [default: random] 23 | #c.ConnectionFileMixin.iopub_port = 0 24 | 25 | ## Set the kernel's IP address [default localhost]. If the IP address is 26 | # something other than localhost, then Consoles on other machines will be able 27 | # to connect to the Kernel, so be careful! 28 | #c.ConnectionFileMixin.ip = '' 29 | 30 | ## set the shell (ROUTER) port [default: random] 31 | #c.ConnectionFileMixin.shell_port = 0 32 | 33 | ## set the stdin (ROUTER) port [default: random] 34 | #c.ConnectionFileMixin.stdin_port = 0 35 | 36 | ## 37 | #c.ConnectionFileMixin.transport = 'tcp' 38 | 39 | #------------------------------------------------------------------------------ 40 | # InteractiveShellApp(Configurable) configuration 41 | #------------------------------------------------------------------------------ 42 | 43 | ## A Mixin for applications that start InteractiveShell instances. 44 | # 45 | # Provides configurables for loading extensions and executing files as part of 46 | # configuring a Shell environment. 47 | # 48 | # The following methods should be called by the :meth:`initialize` method of the 49 | # subclass: 50 | # 51 | # - :meth:`init_path` 52 | # - :meth:`init_shell` (to be implemented by the subclass) 53 | # - :meth:`init_gui_pylab` 54 | # - :meth:`init_extensions` 55 | # - :meth:`init_code` 56 | 57 | ## Execute the given command string. 58 | #c.InteractiveShellApp.code_to_run = '' 59 | 60 | ## Run the file referenced by the PYTHONSTARTUP environment variable at IPython 61 | # startup. 62 | #c.InteractiveShellApp.exec_PYTHONSTARTUP = True 63 | 64 | ## List of files to run at IPython startup. 65 | #c.InteractiveShellApp.exec_files = [] 66 | 67 | ## lines of code to run at IPython startup. 68 | #c.InteractiveShellApp.exec_lines = [] 69 | 70 | ## A list of dotted module names of IPython extensions to load. 71 | #c.InteractiveShellApp.extensions = [] 72 | 73 | ## dotted module name of an IPython extension to load. 74 | #c.InteractiveShellApp.extra_extension = '' 75 | 76 | ## A file to be run 77 | #c.InteractiveShellApp.file_to_run = '' 78 | 79 | ## Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2', 'gtk3', 80 | # 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4'). 81 | #c.InteractiveShellApp.gui = None 82 | 83 | ## Should variables loaded at startup (by startup files, exec_lines, etc.) be 84 | # hidden from tools like %who? 85 | #c.InteractiveShellApp.hide_initial_ns = True 86 | 87 | ## Configure matplotlib for interactive use with the default matplotlib backend. 88 | #c.InteractiveShellApp.matplotlib = None 89 | 90 | ## Run the module as a script. 91 | #c.InteractiveShellApp.module_to_run = '' 92 | 93 | ## Pre-load matplotlib and numpy for interactive use, selecting a particular 94 | # matplotlib backend and loop integration. 95 | #c.InteractiveShellApp.pylab = None 96 | 97 | ## If true, IPython will populate the user namespace with numpy, pylab, etc. and 98 | # an ``import *`` is done from numpy and pylab, when using pylab mode. 99 | # 100 | # When False, pylab mode should not import any names into the user namespace. 101 | #c.InteractiveShellApp.pylab_import_all = True 102 | 103 | ## Reraise exceptions encountered loading IPython extensions? 104 | #c.InteractiveShellApp.reraise_ipython_extension_failures = False 105 | 106 | #------------------------------------------------------------------------------ 107 | # Application(SingletonConfigurable) configuration 108 | #------------------------------------------------------------------------------ 109 | 110 | ## This is an application. 111 | 112 | ## The date format used by logging formatters for %(asctime)s 113 | #c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' 114 | 115 | ## The Logging format template 116 | #c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s' 117 | 118 | ## Set the log level by value or name. 119 | #c.Application.log_level = 30 120 | 121 | #------------------------------------------------------------------------------ 122 | # BaseIPythonApplication(Application) configuration 123 | #------------------------------------------------------------------------------ 124 | 125 | ## IPython: an enhanced interactive Python shell. 126 | 127 | ## Whether to create profile dir if it doesn't exist 128 | #c.BaseIPythonApplication.auto_create = False 129 | 130 | ## Whether to install the default config files into the profile dir. If a new 131 | # profile is being created, and IPython contains config files for that profile, 132 | # then they will be staged into the new directory. Otherwise, default config 133 | # files will be automatically generated. 134 | #c.BaseIPythonApplication.copy_config_files = False 135 | 136 | ## Path to an extra config file to load. 137 | # 138 | # If specified, load this config file in addition to any other IPython config. 139 | #c.BaseIPythonApplication.extra_config_file = '' 140 | 141 | ## The name of the IPython directory. This directory is used for logging 142 | # configuration (through profiles), history storage, etc. The default is usually 143 | # $HOME/.ipython. This option can also be specified through the environment 144 | # variable IPYTHONDIR. 145 | #c.BaseIPythonApplication.ipython_dir = '' 146 | 147 | ## Whether to overwrite existing config files when copying 148 | #c.BaseIPythonApplication.overwrite = False 149 | 150 | ## The IPython profile to use. 151 | #c.BaseIPythonApplication.profile = 'default' 152 | 153 | ## Create a massive crash report when IPython encounters what may be an internal 154 | # error. The default is to append a short message to the usual traceback 155 | #c.BaseIPythonApplication.verbose_crash = False 156 | 157 | #------------------------------------------------------------------------------ 158 | # IPKernelApp(BaseIPythonApplication,InteractiveShellApp,ConnectionFileMixin) configuration 159 | #------------------------------------------------------------------------------ 160 | 161 | ## IPython: an enhanced interactive Python shell. 162 | 163 | ## The importstring for the DisplayHook factory 164 | #c.IPKernelApp.displayhook_class = 'ipykernel.displayhook.ZMQDisplayHook' 165 | 166 | ## ONLY USED ON WINDOWS Interrupt this process when the parent is signaled. 167 | #c.IPKernelApp.interrupt = 0 168 | 169 | ## The Kernel subclass to be used. 170 | # 171 | # This should allow easy re-use of the IPKernelApp entry point to configure and 172 | # launch kernels other than IPython's own. 173 | #c.IPKernelApp.kernel_class = 'ipykernel.ipkernel.IPythonKernel' 174 | 175 | ## redirect stderr to the null device 176 | #c.IPKernelApp.no_stderr = False 177 | 178 | ## redirect stdout to the null device 179 | #c.IPKernelApp.no_stdout = False 180 | 181 | ## The importstring for the OutStream factory 182 | #c.IPKernelApp.outstream_class = 'ipykernel.iostream.OutStream' 183 | 184 | ## kill this process if its parent dies. On Windows, the argument specifies the 185 | # HANDLE of the parent process, otherwise it is simply boolean. 186 | #c.IPKernelApp.parent_handle = 0 187 | 188 | #------------------------------------------------------------------------------ 189 | # Kernel(SingletonConfigurable) configuration 190 | #------------------------------------------------------------------------------ 191 | 192 | ## Whether to use appnope for compatiblity with OS X App Nap. 193 | # 194 | # Only affects OS X >= 10.9. 195 | #c.Kernel._darwin_app_nap = True 196 | 197 | ## 198 | #c.Kernel._execute_sleep = 0.0005 199 | 200 | ## 201 | #c.Kernel._poll_interval = 0.05 202 | 203 | #------------------------------------------------------------------------------ 204 | # IPythonKernel(Kernel) configuration 205 | #------------------------------------------------------------------------------ 206 | 207 | ## 208 | #c.IPythonKernel.help_links = [{'text': 'Python', 'url': 'http://docs.python.org/3.7'}, {'text': 'IPython', 'url': 'http://ipython.org/documentation.html'}, {'text': 'NumPy', 'url': 'http://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy', 'url': 'http://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib', 'url': 'http://matplotlib.org/contents.html'}, {'text': 'SymPy', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas', 'url': 'http://pandas.pydata.org/pandas-docs/stable/'}] 209 | 210 | #------------------------------------------------------------------------------ 211 | # InteractiveShell(SingletonConfigurable) configuration 212 | #------------------------------------------------------------------------------ 213 | 214 | ## An enhanced, interactive shell for Python. 215 | 216 | ## 'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which 217 | # nodes should be run interactively (displaying output from expressions). 218 | #c.InteractiveShell.ast_node_interactivity = 'last_expr' 219 | 220 | ## A list of ast.NodeTransformer subclass instances, which will be applied to 221 | # user input before code is run. 222 | #c.InteractiveShell.ast_transformers = [] 223 | 224 | ## Make IPython automatically call any callable object even if you didn't type 225 | # explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically. 226 | # The value can be '0' to disable the feature, '1' for 'smart' autocall, where 227 | # it is not applied if there are no more arguments on the line, and '2' for 228 | # 'full' autocall, where all callable objects are automatically called (even if 229 | # no arguments are present). 230 | #c.InteractiveShell.autocall = 0 231 | 232 | ## Autoindent IPython code entered interactively. 233 | #c.InteractiveShell.autoindent = True 234 | 235 | ## Enable magic commands to be called without the leading %. 236 | #c.InteractiveShell.automagic = True 237 | 238 | ## The part of the banner to be printed before the profile 239 | #c.InteractiveShell.banner1 = "Python 3.7.0 (default, Jul 15 2018, 10:44:58) \nType 'copyright', 'credits' or 'license' for more information\nIPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.\n" 240 | 241 | ## The part of the banner to be printed after the profile 242 | #c.InteractiveShell.banner2 = '' 243 | 244 | ## Set the size of the output cache. The default is 1000, you can change it 245 | # permanently in your config file. Setting it to 0 completely disables the 246 | # caching system, and the minimum value accepted is 3 (if you provide a value 247 | # less than 3, it is reset to 0 and a warning is issued). This limit is defined 248 | # because otherwise you'll spend more time re-flushing a too small cache than 249 | # working 250 | #c.InteractiveShell.cache_size = 1000 251 | 252 | ## Use colors for displaying information about objects. Because this information 253 | # is passed through a pager (like 'less'), and some pagers get confused with 254 | # color codes, this capability can be turned off. 255 | #c.InteractiveShell.color_info = True 256 | 257 | ## Set the color scheme (NoColor, Neutral, Linux, or LightBG). 258 | #c.InteractiveShell.colors = 'Neutral' 259 | 260 | ## 261 | #c.InteractiveShell.debug = False 262 | 263 | ## Don't call post-execute functions that have failed in the past. 264 | #c.InteractiveShell.disable_failing_post_execute = False 265 | 266 | ## If True, anything that would be passed to the pager will be displayed as 267 | # regular output instead. 268 | #c.InteractiveShell.display_page = False 269 | 270 | ## (Provisional API) enables html representation in mime bundles sent to pagers. 271 | #c.InteractiveShell.enable_html_pager = False 272 | 273 | ## Total length of command history 274 | #c.InteractiveShell.history_length = 10000 275 | 276 | ## The number of saved history entries to be loaded into the history buffer at 277 | # startup. 278 | #c.InteractiveShell.history_load_length = 1000 279 | 280 | ## 281 | #c.InteractiveShell.ipython_dir = '' 282 | 283 | ## Start logging to the given file in append mode. Use `logfile` to specify a log 284 | # file to **overwrite** logs to. 285 | #c.InteractiveShell.logappend = '' 286 | 287 | ## The name of the logfile to use. 288 | #c.InteractiveShell.logfile = '' 289 | 290 | ## Start logging to the default log file in overwrite mode. Use `logappend` to 291 | # specify a log file to **append** logs to. 292 | #c.InteractiveShell.logstart = False 293 | 294 | ## 295 | #c.InteractiveShell.object_info_string_level = 0 296 | 297 | ## Automatically call the pdb debugger after every exception. 298 | #c.InteractiveShell.pdb = False 299 | 300 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 301 | # TerminalInteractiveShell.prompts object directly. 302 | #c.InteractiveShell.prompt_in1 = 'In [\\#]: ' 303 | 304 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 305 | # TerminalInteractiveShell.prompts object directly. 306 | #c.InteractiveShell.prompt_in2 = ' .\\D.: ' 307 | 308 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 309 | # TerminalInteractiveShell.prompts object directly. 310 | #c.InteractiveShell.prompt_out = 'Out[\\#]: ' 311 | 312 | ## Deprecated since IPython 4.0 and ignored since 5.0, set 313 | # TerminalInteractiveShell.prompts object directly. 314 | #c.InteractiveShell.prompts_pad_left = True 315 | 316 | ## 317 | #c.InteractiveShell.quiet = False 318 | 319 | ## 320 | #c.InteractiveShell.separate_in = '\n' 321 | 322 | ## 323 | #c.InteractiveShell.separate_out = '' 324 | 325 | ## 326 | #c.InteractiveShell.separate_out2 = '' 327 | 328 | ## Show rewritten input, e.g. for autocall. 329 | #c.InteractiveShell.show_rewritten_input = True 330 | 331 | ## Enables rich html representation of docstrings. (This requires the docrepr 332 | # module). 333 | #c.InteractiveShell.sphinxify_docstring = False 334 | 335 | ## 336 | #c.InteractiveShell.wildcards_case_sensitive = True 337 | 338 | ## Switch modes for the IPython exception handlers. 339 | #c.InteractiveShell.xmode = 'Context' 340 | 341 | #------------------------------------------------------------------------------ 342 | # ZMQInteractiveShell(InteractiveShell) configuration 343 | #------------------------------------------------------------------------------ 344 | 345 | ## A subclass of InteractiveShell for ZMQ. 346 | 347 | #------------------------------------------------------------------------------ 348 | # ProfileDir(LoggingConfigurable) configuration 349 | #------------------------------------------------------------------------------ 350 | 351 | ## An object to manage the profile directory and its resources. 352 | # 353 | # The profile directory is used by all IPython applications, to manage 354 | # configuration, logging and security. 355 | # 356 | # This object knows how to find, create and manage these directories. This 357 | # should be used by any code that wants to handle profiles. 358 | 359 | ## Set the profile location directly. This overrides the logic used by the 360 | # `profile` option. 361 | #c.ProfileDir.location = '' 362 | 363 | #------------------------------------------------------------------------------ 364 | # Session(Configurable) configuration 365 | #------------------------------------------------------------------------------ 366 | 367 | ## Object for handling serialization and sending of messages. 368 | # 369 | # The Session object handles building messages and sending them with ZMQ sockets 370 | # or ZMQStream objects. Objects can communicate with each other over the 371 | # network via Session objects, and only need to work with the dict-based IPython 372 | # message spec. The Session will handle serialization/deserialization, security, 373 | # and metadata. 374 | # 375 | # Sessions support configurable serialization via packer/unpacker traits, and 376 | # signing with HMAC digests via the key/keyfile traits. 377 | # 378 | # Parameters ---------- 379 | # 380 | # debug : bool 381 | # whether to trigger extra debugging statements 382 | # packer/unpacker : str : 'json', 'pickle' or import_string 383 | # importstrings for methods to serialize message parts. If just 384 | # 'json' or 'pickle', predefined JSON and pickle packers will be used. 385 | # Otherwise, the entire importstring must be used. 386 | # 387 | # The functions must accept at least valid JSON input, and output *bytes*. 388 | # 389 | # For example, to use msgpack: 390 | # packer = 'msgpack.packb', unpacker='msgpack.unpackb' 391 | # pack/unpack : callables 392 | # You can also set the pack/unpack callables for serialization directly. 393 | # session : bytes 394 | # the ID of this Session object. The default is to generate a new UUID. 395 | # username : unicode 396 | # username added to message headers. The default is to ask the OS. 397 | # key : bytes 398 | # The key used to initialize an HMAC signature. If unset, messages 399 | # will not be signed or checked. 400 | # keyfile : filepath 401 | # The file containing a key. If this is set, `key` will be initialized 402 | # to the contents of the file. 403 | 404 | ## Threshold (in bytes) beyond which an object's buffer should be extracted to 405 | # avoid pickling. 406 | #c.Session.buffer_threshold = 1024 407 | 408 | ## Whether to check PID to protect against calls after fork. 409 | # 410 | # This check can be disabled if fork-safety is handled elsewhere. 411 | #c.Session.check_pid = True 412 | 413 | ## Threshold (in bytes) beyond which a buffer should be sent without copying. 414 | #c.Session.copy_threshold = 65536 415 | 416 | ## Debug output in the Session 417 | #c.Session.debug = False 418 | 419 | ## The maximum number of digests to remember. 420 | # 421 | # The digest history will be culled when it exceeds this value. 422 | #c.Session.digest_history_size = 65536 423 | 424 | ## The maximum number of items for a container to be introspected for custom 425 | # serialization. Containers larger than this are pickled outright. 426 | #c.Session.item_threshold = 64 427 | 428 | ## execution key, for signing messages. 429 | #c.Session.key = b'' 430 | 431 | ## path to file containing execution key. 432 | #c.Session.keyfile = '' 433 | 434 | ## Metadata dictionary, which serves as the default top-level metadata dict for 435 | # each message. 436 | #c.Session.metadata = {} 437 | 438 | ## The name of the packer for serializing messages. Should be one of 'json', 439 | # 'pickle', or an import name for a custom callable serializer. 440 | #c.Session.packer = 'json' 441 | 442 | ## The UUID identifying this session. 443 | #c.Session.session = '' 444 | 445 | ## The digest scheme used to construct the message signatures. Must have the form 446 | # 'hmac-HASH'. 447 | #c.Session.signature_scheme = 'hmac-sha256' 448 | 449 | ## The name of the unpacker for unserializing messages. Only used with custom 450 | # functions for `packer`. 451 | #c.Session.unpacker = 'json' 452 | 453 | ## Username for the Session. Default is your system username. 454 | #c.Session.username = 'aloxaf' 455 | -------------------------------------------------------------------------------- /makepkg/.config/pacman/makepkg.conf: -------------------------------------------------------------------------------- 1 | CFLAGS="-march=native -O2 -pipe -fno-plt" 2 | CXXFLAGS="-march=native -O2 -pipe -fno-plt" 3 | LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" # -fuse-ld=lld" this cause bug when compleing glibc 4 | 5 | MAKEFLAGS="-j$(nproc)" 6 | 7 | BUILDENV=(!distcc color ccache !check sign) 8 | BUILDDIR=/tmp/makepkg 9 | 10 | PACKAGER="aloxaf " 11 | GPGKEY="016DB0252B1B1F11" 12 | 13 | COMPRESSZST=(zstd -z -c -q -T0 -10 -) 14 | 15 | PKGEXT='.pkg.tar.zst' 16 | -------------------------------------------------------------------------------- /navi/.local/share/navi/cheats/aloxaf/ffmpeg.cheat: -------------------------------------------------------------------------------- 1 | % ffmpeg 2 | 3 | # convert to h265/hevc 4 | ffmpeg -i (input) -c:v libx265 -c:a copy (output) 5 | 6 | # get video info 7 | ffprobe -v quiet -print_format json -show_format -show_streams (input) 8 | 9 | # extract a frame from video 10 | ffmpeg -ss (time) -i (input) -f image2 -frames:v 1 (output) 11 | -------------------------------------------------------------------------------- /navi/.local/share/navi/cheats/aloxaf/imagemagick.cheat: -------------------------------------------------------------------------------- 1 | % imagemagick 2 | 3 | # crop image/裁剪图片 4 | convert (input) -cop WIDTHxHEIGHT+X+Y (output) 5 | 6 | # combine image(vertical)/合并图片(垂直) 7 | convert -append (input) (output) 8 | 9 | # combine image(horizontal)/合并图片(水平) 10 | convert +append (input) (output) 11 | 12 | # diff image/对比图片 13 | convert (first.png) \ 14 | \( -clone 0 (second.png) -compose difference -composite \ 15 | -threshold 5% -fill red -opaque white -transparent black \) \ 16 | -compose over -composite (diff.png) 17 | 18 | # diff image/对比图片 19 | compare -fuzz 5%% (first.png) (second.png) -compose src (diff.png) 20 | 21 | # reize image/调整图片大小 22 | convert (image.png) -resize (size) (output.png) 23 | -------------------------------------------------------------------------------- /navi/.local/share/navi/cheats/aloxaf/linux.cheat: -------------------------------------------------------------------------------- 1 | % commands 2 | 3 | # stow 4 | stow --ignore=.directory --target=$HOME 5 | $ dir: ls -d -- */ 6 | 7 | # enable ptrace 8 | echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 9 | 10 | # flatten json 11 | gron test.json 12 | 13 | # reverse shell 14 | curl https://shell.now.sh/yukari.farseerfc.me:13337 | bash 15 | 16 | # https://github.com/kimci86/bkcrack/issues/9#issuecomment-608416330 17 | # list metadata about the file in archive 18 | 7z l -slt 19 | 20 | # git search 21 | git log -S 22 | 23 | # git query tag 24 | git tag --contains= 25 | 26 | # gif compress 27 | gifsicle -i -O3 --colors 256 -o 28 | -------------------------------------------------------------------------------- /navi/.local/share/navi/cheats/aloxaf/pacman.cheat: -------------------------------------------------------------------------------- 1 | % pacman 2 | 3 | # List dependencies 4 | expac -S '%o' 5 | -------------------------------------------------------------------------------- /npm/.config/npm/config: -------------------------------------------------------------------------------- 1 | prefix=/home/aloxaf/.local 2 | registry=https://registry.npm.taobao.org 3 | cache=/home/aloxaf/.cache/npm 4 | -------------------------------------------------------------------------------- /pacman/etc/pacman.conf: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/pacman.conf 3 | # 4 | # See the pacman.conf(5) manpage for option and repository directives 5 | 6 | # 7 | # GENERAL OPTIONS 8 | # 9 | [options] 10 | # The following paths are commented out with their default values listed. 11 | # If you wish to use different paths, uncomment and update the paths. 12 | #RootDir = / 13 | #DBPath = /var/lib/pacman/ 14 | #CacheDir = /var/cache/pacman/pkg/ 15 | #LogFile = /var/log/pacman.log 16 | #GPGDir = /etc/pacman.d/gnupg/ 17 | #HookDir = /etc/pacman.d/hooks/ 18 | HoldPkg = pacman glibc 19 | #XferCommand = /usr/bin/curl -C - -f -o %o %u 20 | #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u 21 | #CleanMethod = KeepInstalled 22 | #UseDelta = 0.7 23 | Architecture = auto 24 | 25 | # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup 26 | IgnorePkg = 27 | #IgnoreGroup = 28 | 29 | #NoUpgrade = 30 | #NoExtract = 31 | 32 | # Misc options 33 | #UseSyslog 34 | Color 35 | #TotalDownload 36 | CheckSpace 37 | VerbosePkgLists 38 | 39 | # By default, pacman accepts packages signed by keys that its local keyring 40 | # trusts (see pacman-key and its man page), as well as unsigned packages. 41 | SigLevel = Required DatabaseOptional 42 | LocalFileSigLevel = Optional 43 | #RemoteFileSigLevel = Required 44 | 45 | # NOTE: You must run `pacman-key --init` before first using pacman; the local 46 | # keyring can then be populated with the keys of all official Arch Linux 47 | # packagers with `pacman-key --populate archlinux`. 48 | 49 | # 50 | # REPOSITORIES 51 | # - can be defined here or included from another file 52 | # - pacman will search repositories in the order defined here 53 | # - local/custom mirrors can be added here or in separate files 54 | # - repositories listed first will take precedence when packages 55 | # have identical names, regardless of version number 56 | # - URLs will have $repo replaced by the name of the current repo 57 | # - URLs will have $arch replaced by the name of the architecture 58 | # 59 | # Repository entries are of the format: 60 | # [repo-name] 61 | # Server = ServerName 62 | # Include = IncludePath 63 | # 64 | # The header [repo-name] is crucial - it must be present and 65 | # uncommented to enable the repo. 66 | # 67 | 68 | # The testing repositories are disabled by default. To enable, uncomment the 69 | # repo name header and Include lines. You can add preferred servers immediately 70 | # after the header, and they will be used before the default mirrors. 71 | 72 | #[testing] 73 | #Include = /etc/pacman.d/mirrorlist 74 | 75 | [core] 76 | Include = /etc/pacman.d/mirrorlist 77 | 78 | [extra] 79 | Include = /etc/pacman.d/mirrorlist 80 | 81 | #[community-testing] 82 | #Include = /etc/pacman.d/mirrorlist 83 | 84 | [community] 85 | Include = /etc/pacman.d/mirrorlist 86 | 87 | # If you want to run 32 bit applications on your x86_64 system, 88 | # enable the multilib repositories as required here. 89 | 90 | #[multilib-testing] 91 | #Include = /etc/pacman.d/mirrorlist 92 | 93 | [multilib] 94 | Include = /etc/pacman.d/mirrorlist 95 | 96 | # An example of a custom package repository. See the pacman manpage for 97 | # tips on creating your own repositories. 98 | #[custom] 99 | #SigLevel = Optional TrustAll 100 | #Server = file:///home/custompkgs 101 | 102 | [aloxaf] 103 | Server = http://repo.aloxaf.com/$arch 104 | 105 | [archlinuxcn] 106 | Include = /etc/pacman.d/archlinuxcn 107 | 108 | [arch4edu] 109 | Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch 110 | 111 | [blackarch] 112 | Server = https://mirrors.cloud.tencent.com/blackarch/$repo/os/$arch 113 | Server = https://mirrors.ustc.edu.cn/blackarch/$repo/os/$arch 114 | 115 | -------------------------------------------------------------------------------- /pacman/usr/share/libalpm/hooks/clean-cache.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Operation = Remove 3 | Operation = Install 4 | Operation = Upgrade 5 | Type = Package 6 | Target = * 7 | 8 | [Action] 9 | Description = Cleaning up old packages... 10 | When = PostTransaction 11 | Exec = /usr/bin/paccache -rvk2 12 | -------------------------------------------------------------------------------- /pikaur/.config/pikaur.conf: -------------------------------------------------------------------------------- 1 | [sync] 2 | alwaysshowpkgorigin = no 3 | develpkgsexpiration = -1 4 | upgradesorting = versiondiff 5 | showdownloadsize = no 6 | ignoreoutofdateaurupgrades = no 7 | 8 | [build] 9 | keepbuilddir = no 10 | keepdevbuilddir = yes 11 | skipfailedbuild = no 12 | alwaysusedynamicusers = no 13 | keepbuilddeps = no 14 | 15 | [colors] 16 | version = 10 17 | versiondiffold = 11 18 | versiondiffnew = 9 19 | 20 | [ui] 21 | requireenterconfirm = yes 22 | printcommands = no 23 | reversesearchsorting = no 24 | 25 | [misc] 26 | pacmanpath = pacman 27 | debug = no 28 | sudoloopinterval = 1 29 | privilegeescalationtool = sudo 30 | 31 | [network] 32 | socks5proxy = 127.0.0.1:8877 33 | aururl = https://aur.tuna.tsinghua.edu.cn 34 | newsurl = https://www.archlinux.org/feeds/news/ 35 | 36 | [review] 37 | noedit = no 38 | donteditbydefault = no 39 | nodiff = no 40 | gitdiffargs = --ignore-space-change,--ignore-all-space 41 | diffpager = auto 42 | hidedifffiles = .SRCINFO 43 | 44 | -------------------------------------------------------------------------------- /powershell/.config/powershell/profile.ps1: -------------------------------------------------------------------------------- 1 | function ll() { 2 | exa -l 3 | } 4 | 5 | function la { 6 | exa -a 7 | } 8 | 9 | Set-Alias -Name ls -Value exa 10 | 11 | function Prompt { 12 | $CurrentDir = $PWD.ToString() ` 13 | -replace "^$ENV:HOME","~" ` 14 | -replace "/([^/.])[^/]*(?=/)",'/$1' ` 15 | -replace "/\.([^/])[^/]*(?=/)",'/.$1'; 16 | Write-Host -NoNewline -ForegroundColor Green "$CurrentDir"; 17 | "> "; 18 | } 19 | -------------------------------------------------------------------------------- /proxychains/.config/proxychains/8080.conf: -------------------------------------------------------------------------------- 1 | # proxychains.conf VER 4.x 2 | # 3 | # HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS. 4 | 5 | 6 | # The option below identifies how the ProxyList is treated. 7 | # only one option should be uncommented at time, 8 | # otherwise the last appearing option will be accepted 9 | # 10 | dynamic_chain 11 | # 12 | # Dynamic - Each connection will be done via chained proxies 13 | # all proxies chained in the order as they appear in the list 14 | # at least one proxy must be online to play in chain 15 | # (dead proxies are skipped) 16 | # otherwise EINTR is returned to the app 17 | # 18 | strict_chain 19 | # 20 | # Strict - Each connection will be done via chained proxies 21 | # all proxies chained in the order as they appear in the list 22 | # all proxies must be online to play in chain 23 | # otherwise EINTR is returned to the app 24 | # 25 | #round_robin_chain 26 | # 27 | # Round Robin - Each connection will be done via chained proxies 28 | # of chain_len length 29 | # all proxies chained in the order as they appear in the list 30 | # at least one proxy must be online to play in chain 31 | # (dead proxies are skipped). 32 | # the start of the current proxy chain is the proxy after the last 33 | # proxy in the previously invoked proxy chain. 34 | # if the end of the proxy chain is reached while looking for proxies 35 | # start at the beginning again. 36 | # otherwise EINTR is returned to the app 37 | # These semantics are not guaranteed in a multithreaded environment. 38 | # 39 | #random_chain 40 | # 41 | # Random - Each connection will be done via random proxy 42 | # (or proxy chain, see chain_len) from the list. 43 | # this option is good to test your IDS :) 44 | 45 | # Make sense only if random_chain or round_robin_chain 46 | #chain_len = 2 47 | 48 | # Quiet mode (no output from library) 49 | #quiet_mode 50 | 51 | # Proxy DNS requests - no leak for DNS data 52 | proxy_dns 53 | 54 | # set the class A subnet number to use for the internal remote DNS mapping 55 | # we use the reserved 224.x.x.x range by default, 56 | # if the proxified app does a DNS request, we will return an IP from that range. 57 | # on further accesses to this ip we will send the saved DNS name to the proxy. 58 | # in case some control-freak app checks the returned ip, and denies to 59 | # connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x. 60 | # of course you should make sure that the proxified app does not need 61 | # *real* access to this subnet. 62 | # i.e. dont use the same subnet then in the localnet section 63 | #remote_dns_subnet 127 64 | #remote_dns_subnet 10 65 | remote_dns_subnet 224 66 | 67 | # Some timeouts in milliseconds 68 | tcp_read_time_out 15000 69 | tcp_connect_time_out 8000 70 | 71 | ### Examples for localnet exclusion 72 | ## localnet ranges will *not* use a proxy to connect. 73 | ## Exclude connections to 192.168.1.0/24 with port 80 74 | localnet 192.168.1.0:80/255.255.255.0 75 | 76 | ## Exclude connections to 192.168.100.0/24 77 | localnet 192.168.100.0/255.255.255.0 78 | 79 | ## Exclude connections to ANYwhere with port 80 80 | # localnet 0.0.0.0:80/0.0.0.0 81 | 82 | ## RFC5735 Loopback address range 83 | ## if you enable this, you have to make sure remote_dns_subnet is not 127 84 | ## you'll need to enable it if you want to use an application that 85 | ## connects to localhost. 86 | localnet 127.0.0.0/255.0.0.0 87 | 88 | ## RFC1918 Private Address Ranges 89 | localnet 10.0.0.0/255.0.0.0 90 | localnet 172.16.0.0/255.240.0.0 91 | localnet 192.168.0.0/255.255.0.0 92 | 93 | # ProxyList format 94 | # type ip port [user pass] 95 | # (values separated by 'tab' or 'blank') 96 | # 97 | # only numeric ipv4 addresses are valid 98 | # 99 | # 100 | # Examples: 101 | # 102 | # socks5 192.168.67.78 1080 lamer secret 103 | # http 192.168.89.3 8080 justu hidden 104 | # socks4 192.168.1.49 1080 105 | # http 192.168.39.93 8080 106 | # 107 | # 108 | # proxy types: http, socks4, socks5 109 | # ( auth types supported: "basic"-http "user/pass"-socks ) 110 | # 111 | [ProxyList] 112 | # add proxy here ... 113 | # meanwile 114 | # defaults set to "tor" 115 | socks5 127.0.0.1 8080 116 | -------------------------------------------------------------------------------- /proxychains/.config/proxychains/8087.conf: -------------------------------------------------------------------------------- 1 | # proxychains.conf VER 4.x 2 | # 3 | # HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS. 4 | 5 | 6 | # The option below identifies how the ProxyList is treated. 7 | # only one option should be uncommented at time, 8 | # otherwise the last appearing option will be accepted 9 | # 10 | dynamic_chain 11 | # 12 | # Dynamic - Each connection will be done via chained proxies 13 | # all proxies chained in the order as they appear in the list 14 | # at least one proxy must be online to play in chain 15 | # (dead proxies are skipped) 16 | # otherwise EINTR is returned to the app 17 | # 18 | strict_chain 19 | # 20 | # Strict - Each connection will be done via chained proxies 21 | # all proxies chained in the order as they appear in the list 22 | # all proxies must be online to play in chain 23 | # otherwise EINTR is returned to the app 24 | # 25 | #round_robin_chain 26 | # 27 | # Round Robin - Each connection will be done via chained proxies 28 | # of chain_len length 29 | # all proxies chained in the order as they appear in the list 30 | # at least one proxy must be online to play in chain 31 | # (dead proxies are skipped). 32 | # the start of the current proxy chain is the proxy after the last 33 | # proxy in the previously invoked proxy chain. 34 | # if the end of the proxy chain is reached while looking for proxies 35 | # start at the beginning again. 36 | # otherwise EINTR is returned to the app 37 | # These semantics are not guaranteed in a multithreaded environment. 38 | # 39 | #random_chain 40 | # 41 | # Random - Each connection will be done via random proxy 42 | # (or proxy chain, see chain_len) from the list. 43 | # this option is good to test your IDS :) 44 | 45 | # Make sense only if random_chain or round_robin_chain 46 | #chain_len = 2 47 | 48 | # Quiet mode (no output from library) 49 | #quiet_mode 50 | 51 | # Proxy DNS requests - no leak for DNS data 52 | proxy_dns 53 | 54 | # set the class A subnet number to use for the internal remote DNS mapping 55 | # we use the reserved 224.x.x.x range by default, 56 | # if the proxified app does a DNS request, we will return an IP from that range. 57 | # on further accesses to this ip we will send the saved DNS name to the proxy. 58 | # in case some control-freak app checks the returned ip, and denies to 59 | # connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x. 60 | # of course you should make sure that the proxified app does not need 61 | # *real* access to this subnet. 62 | # i.e. dont use the same subnet then in the localnet section 63 | #remote_dns_subnet 127 64 | #remote_dns_subnet 10 65 | remote_dns_subnet 224 66 | 67 | # Some timeouts in milliseconds 68 | tcp_read_time_out 15000 69 | tcp_connect_time_out 8000 70 | 71 | ### Examples for localnet exclusion 72 | ## localnet ranges will *not* use a proxy to connect. 73 | ## Exclude connections to 192.168.1.0/24 with port 80 74 | # localnet 192.168.1.0:80/255.255.255.0 75 | 76 | ## Exclude connections to 192.168.100.0/24 77 | # localnet 192.168.100.0/255.255.255.0 78 | 79 | ## Exclude connections to ANYwhere with port 80 80 | # localnet 0.0.0.0:80/0.0.0.0 81 | 82 | ## RFC5735 Loopback address range 83 | ## if you enable this, you have to make sure remote_dns_subnet is not 127 84 | ## you'll need to enable it if you want to use an application that 85 | ## connects to localhost. 86 | # localnet 127.0.0.0/255.0.0.0 87 | 88 | ## RFC1918 Private Address Ranges 89 | # localnet 10.0.0.0/255.0.0.0 90 | # localnet 172.16.0.0/255.240.0.0 91 | # localnet 192.168.0.0/255.255.0.0 92 | 93 | # ProxyList format 94 | # type ip port [user pass] 95 | # (values separated by 'tab' or 'blank') 96 | # 97 | # only numeric ipv4 addresses are valid 98 | # 99 | # 100 | # Examples: 101 | # 102 | # socks5 192.168.67.78 1080 lamer secret 103 | # http 192.168.89.3 8080 justu hidden 104 | # socks4 192.168.1.49 1080 105 | # http 192.168.39.93 8080 106 | # 107 | # 108 | # proxy types: http, socks4, socks5 109 | # ( auth types supported: "basic"-http "user/pass"-socks ) 110 | # 111 | [ProxyList] 112 | # add proxy here ... 113 | # meanwile 114 | # defaults set to "tor" 115 | http 127.0.0.1 8087 116 | 117 | 118 | -------------------------------------------------------------------------------- /proxychains/.config/proxychains/8877.conf: -------------------------------------------------------------------------------- 1 | # proxychains.conf VER 4.x 2 | # 3 | # HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS. 4 | 5 | 6 | # The option below identifies how the ProxyList is treated. 7 | # only one option should be uncommented at time, 8 | # otherwise the last appearing option will be accepted 9 | # 10 | #dynamic_chain 11 | # 12 | # Dynamic - Each connection will be done via chained proxies 13 | # all proxies chained in the order as they appear in the list 14 | # at least one proxy must be online to play in chain 15 | # (dead proxies are skipped) 16 | # otherwise EINTR is returned to the app 17 | # 18 | strict_chain 19 | # 20 | # Strict - Each connection will be done via chained proxies 21 | # all proxies chained in the order as they appear in the list 22 | # all proxies must be online to play in chain 23 | # otherwise EINTR is returned to the app 24 | # 25 | #round_robin_chain 26 | # 27 | # Round Robin - Each connection will be done via chained proxies 28 | # of chain_len length 29 | # all proxies chained in the order as they appear in the list 30 | # at least one proxy must be online to play in chain 31 | # (dead proxies are skipped). 32 | # the start of the current proxy chain is the proxy after the last 33 | # proxy in the previously invoked proxy chain. 34 | # if the end of the proxy chain is reached while looking for proxies 35 | # start at the beginning again. 36 | # otherwise EINTR is returned to the app 37 | # These semantics are not guaranteed in a multithreaded environment. 38 | # 39 | #random_chain 40 | # 41 | # Random - Each connection will be done via random proxy 42 | # (or proxy chain, see chain_len) from the list. 43 | # this option is good to test your IDS :) 44 | 45 | # Make sense only if random_chain or round_robin_chain 46 | #chain_len = 2 47 | 48 | # Quiet mode (no output from library) 49 | #quiet_mode 50 | 51 | # Proxy DNS requests - no leak for DNS data 52 | proxy_dns 53 | 54 | # set the class A subnet number to use for the internal remote DNS mapping 55 | # we use the reserved 224.x.x.x range by default, 56 | # if the proxified app does a DNS request, we will return an IP from that range. 57 | # on further accesses to this ip we will send the saved DNS name to the proxy. 58 | # in case some control-freak app checks the returned ip, and denies to 59 | # connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x. 60 | # of course you should make sure that the proxified app does not need 61 | # *real* access to this subnet. 62 | # i.e. dont use the same subnet then in the localnet section 63 | #remote_dns_subnet 127 64 | #remote_dns_subnet 10 65 | remote_dns_subnet 224 66 | 67 | # Some timeouts in milliseconds 68 | tcp_read_time_out 15000 69 | tcp_connect_time_out 8000 70 | 71 | ### Examples for localnet exclusion 72 | ## localnet ranges will *not* use a proxy to connect. 73 | ## Exclude connections to 192.168.1.0/24 with port 80 74 | localnet 192.168.1.0:80/255.255.255.0 75 | 76 | ## Exclude connections to 192.168.100.0/24 77 | localnet 192.168.100.0/255.255.255.0 78 | 79 | ## Exclude connections to ANYwhere with port 80 80 | # localnet 0.0.0.0:80/0.0.0.0 81 | 82 | ## RFC5735 Loopback address range 83 | ## if you enable this, you have to make sure remote_dns_subnet is not 127 84 | ## you'll need to enable it if you want to use an application that 85 | ## connects to localhost. 86 | localnet 127.0.0.0/255.0.0.0 87 | 88 | ## RFC1918 Private Address Ranges 89 | localnet 10.0.0.0/255.0.0.0 90 | localnet 172.16.0.0/255.240.0.0 91 | localnet 192.168.0.0/255.255.0.0 92 | 93 | # ProxyList format 94 | # type ip port [user pass] 95 | # (values separated by 'tab' or 'blank') 96 | # 97 | # only numeric ipv4 addresses are valid 98 | # 99 | # 100 | # Examples: 101 | # 102 | # socks5 192.168.67.78 1080 lamer secret 103 | # http 192.168.89.3 8080 justu hidden 104 | # socks4 192.168.1.49 1080 105 | # http 192.168.39.93 8080 106 | # 107 | # 108 | # proxy types: http, socks4, socks5 109 | # ( auth types supported: "basic"-http "user/pass"-socks ) 110 | # 111 | [ProxyList] 112 | # add proxy here ... 113 | # meanwile 114 | # defaults set to "tor" 115 | socks5 127.0.0.1 8877 116 | 117 | -------------------------------------------------------------------------------- /ssh/.ssh/config: -------------------------------------------------------------------------------- 1 | Host aur.archlinux.org 2 | IdentityFile ~/.ssh/id_rsa 3 | User aloxaf 4 | ServerAliveInterval 20 5 | ServerAliveCountMax 10 6 | -------------------------------------------------------------------------------- /systemd/README.md: -------------------------------------------------------------------------------- 1 | 服务需要手动放置, 硬链接无法生效 2 | -------------------------------------------------------------------------------- /systemd/etc/systemd/system/xkeysnail.service: -------------------------------------------------------------------------------- 1 | # https://qiita.com/samurai20000@github/items/2e1d779e806a7e8543d6 2 | # https://github.com/mooz/xkeysnail/issues/12 3 | 4 | [Unit] 5 | Description=xkeysnail 6 | 7 | [Service] 8 | Environment=DISPLAY=:0 9 | ExecStart=xkeysnail -q /home/aloxaf/.config/xkeysnail/config.py 10 | Restart=always 11 | RestartSec=10 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /tmux/.config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | #!/hint/bash 2 | # use 256 color terminal 3 | # 官方建议 screen-256color 4 | # 但似乎 xterm-256color 才支持斜体:https://superuser.com/questions/1514762/italics-work-everywhere-except-in-less1 5 | # 超链接不支持:https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda 6 | set -g default-terminal "tmux-256color" 7 | 8 | # 启用 RGB 和斜体支持 9 | # https://gist.github.com/XVilka/8346728 10 | # https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour 11 | # https://github.com/tmux/tmux/issues/1202 12 | # set -as terminal-overrides ',xterm*:RGB,xterm*:sitm=\E[3m' 13 | # 启用上划线和 RGB 支持 14 | set -as terminal-features ",xterm*:RGB,xterm*:overline" 15 | 16 | # reload config 17 | bind r source-file ~/.config/tmux/tmux.conf \; display 'tmux.conf sourced' 18 | 19 | # boost history 20 | set -g history-limit 5000 21 | 22 | # set terminal title 23 | set -g set-titles on 24 | 25 | # enable mouse support 26 | set -g mouse on 27 | 28 | # enable OSC 52 29 | set -g set-clipboard on 30 | 31 | # https://sunaku.github.io/tmux-yank-osc52.html 32 | # pass "Ptmux;" escape sequences through to the terminal 33 | set-window-option -g allow-passthrough on 34 | set -g @custom_copy_command 'yank' 35 | 36 | # https://www.reddit.com/r/tmux/comments/cpvd02/can_i_pass_only_mousescroll_to_shell/ 37 | # Basically, on a wheelup event: 38 | # if mouse is enabled, send the mouse event, 39 | # else if we're in an alternate screen program, send the up key, 40 | # else if pane is in copy mode, send the mouse event, 41 | # else put the current pane into copy mode and send the mouse event. 42 | # Nested ifs are not fun. 43 | bind -n WheelUpPane if-shell -Ft= "#{mouse_any_flag}" "send-keys -M" "if-shell -Ft= '#{alternate_on}' 'send-keys -t= up' 'if-shell -Ft= \"#{pane_in_mode}\" \"send-keys -M\" \"run fcitx5-remote\\\\ -c; select-pane -t=; copy-mode -e; send-keys -M\"'" 44 | # On a wheeldown event, if we're in an alternate screen program, send the down 45 | # key, else, just send the mouse event 46 | bind -n WheelDownPane if-shell -Ft= "#{alternate_on}" "send-keys -t= down" "select-pane -t= \; send-keys -M" 47 | 48 | # set border style 49 | set -g pane-border-lines double 50 | 51 | # https://stackoverflow.com/questions/25532773/change-background-color-of-active-or-inactive-pane-in-tmux 52 | #set inactive/active window styles 53 | set -g window-style 'fg=colour247,bg=colour237' 54 | set -g window-active-style 'fg=colour255,bg=black' 55 | 56 | # use alt-arrow to switch panes 57 | # bind -n M-b select-pane -L 58 | # bind -n M-f select-pane -R 59 | # bind -n M-p select-pane -U 60 | # bind -n M-n select-pane -D 61 | 62 | # use shift-arrow to switch windows 63 | bind -n S-Left previous-window 64 | bind -n S-Right next-window 65 | 66 | # -- emacs style keymap -- 67 | # use C-z as prefix, and C-z C-z for raw C-z 68 | set -g prefix '⹝' # a character that I think I will never use 69 | unbind-key C-z 70 | bind-key C-z send-key "C-z" # send-prefix will send ⹝ 71 | 72 | # switch IME if needed 73 | bind-key -n 'C-z' switchc -Tprefix \; run "fcitx5-remote -c" 74 | # bind-key -n MouseDrag1Pane run "fcitx5-remote -c" \; copy-mode 75 | bind-key -T copy-mode -n MouseDrag1Pane run "fcitx5-remote -c" \; select-pane \; send-keys -X begin-selection 76 | 77 | # split window 78 | unbind '"' 79 | unbind '%' 80 | bind-key '0' kill-pane 81 | bind-key '2' split-window -c "#{pane_current_path}" 82 | bind-key '3' split-window -h -c "#{pane_current_path}" 83 | 84 | # kill session 85 | bind-key 'k' kill-session 86 | 87 | # super clear 88 | bind-key C-l 'send-keys -R; clear-history' 89 | 90 | # for zce.zsh 91 | # bind-key 'j' send-keys C-x j 92 | 93 | # --- tpm --- 94 | # List of plugins 95 | 96 | set -g @plugin 'sainnhe/tmux-fzf' 97 | set -g @plugin 'jimeh/tmux-themepack' 98 | set -g @plugin 'tmux-plugins/tpm' 99 | set -g @plugin 'tmux-plugins/tmux-sensible' 100 | set -g @plugin 'tmux-plugins/tmux-open' 101 | set -g @plugin 'tmux-plugins/tmux-copycat' 102 | set -g @plugin 'tmux-plugins/tmux-logging' 103 | set -g @plugin 'tmux-plugins/tmux-yank' 104 | 105 | # set theme 106 | set -g @themepack 'powerline/block/cyan' 107 | set -g @themepack-status-left-area-left-prefix '#{?client_prefix,#[reverse]^Z#[noreverse] ,}' 108 | 109 | # set logging path 110 | set -g @logging-path "~/.local/share/tmux/logging/" 111 | 112 | # don't jump to bottom when copy finished 113 | set -g @yank_action 'copy-pipe' 114 | 115 | # search files with line number 116 | set -g "@copycat_search_C-f" "(^|^\.|[[:space:]]|[[:space:]]\.|[[:space:]]\.\.|^\.\.)[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]*(:[0-9]+(:[0-9]+)?)?" 117 | bind-key 'C-a' copy-mode \; send -X search-backward "(^|^\.|[[:space:]]|[[:space:]]\.|[[:space:]]\.\.|^\.\.)[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]*(:[0-9]+(:[0-9]+)?)?" 118 | 119 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 120 | set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.local/share/tmux/plugins" 121 | run -b '~/.local/share/tmux/plugins/tpm/tpm' 122 | -------------------------------------------------------------------------------- /x11/.XCompose: -------------------------------------------------------------------------------- 1 | # ~/.Compose 2 | # This file defines custom Compose sequences for Unicode characters 3 | 4 | # Import default rules from the system Compose file: 5 | include "/usr/share/X11/locale/en_US.UTF-8/Compose" 6 | 7 | # To put some stuff onto compose key strokes: 8 | : "✔" U2714 # \ / Fat tick/check mark 9 | 10 | -------------------------------------------------------------------------------- /x11/.Xresources: -------------------------------------------------------------------------------- 1 | Emacs.geometry: 85x40 2 | 3 | -------------------------------------------------------------------------------- /x11/.xprofile: -------------------------------------------------------------------------------- 1 | export LANG=zh_CN.UTF-8 2 | export LC_ALL=zh_CN.UTF-8 3 | 4 | export XDG_CONFIG_HOME=$HOME/.config 5 | export XDG_CACHE_HOME=$HOME/.cache 6 | export XDG_DATA_HOME=$HOME/.local/share 7 | 8 | export WAKATIME_HOME=$XDG_CONFIG_HOME/wakatime 9 | export SQLITE_HISTORY=$XDG_DATA_HOME/sqlite_history 10 | export MPLAYER_HOME=$XDG_CONFIG_HOME/mplayer 11 | export TERMINFO=$XDG_DATA_HOME/terminfo 12 | export TERMINFO_DIRS=$XDG_DATA_HOME/terminfo:/usr/share/terminfo 13 | export ANDROID_SDK_HOME=$XDG_CONFIG_HOME/android 14 | export ANDROID_SDK_ROOT=$XDG_DATA_HOME/android 15 | export ANDROID_AVD_HOME=$XDG_DATA_HOME/android 16 | export ANDROID_EMULATOR_HOME=$XDG_DATA_HOME/android 17 | export ADB_VENDOR_KEY=$XDG_CONFIG_HOME/android 18 | export CARGO_HOME=$XDG_DATA_HOME/cargo 19 | export CCACHE_CONFIGPATH=$XDG_CONFIG_HOME/ccache.config 20 | export CCACHE_DIR=$XDG_CACHE_HOME/ccache 21 | export DOCKER_CONFIG=$XDG_CONFIG_HOME/docker 22 | 23 | # 让 firefox 启用硬件加速 24 | # export MOZ_X11_EGL=1 25 | 26 | export XIM=fcitx 27 | export XIM_PROGRAM=fcitx 28 | export GTK_IM_MODULE=fcitx 29 | export QT_IM_MODULE=fcitx 30 | export XMODIFIERS=@im=fcitx 31 | # SDL 必须用 fcitx5,否则会套用对 fcitx4 的特殊处理导致 fcitx5 启动失败 32 | export SDL_IM_MODULE=fcitx5 33 | export PATH=$HOME/.local/bin:$CARGO_HOME/bin:$HOME/.gem/ruby/3.0.0/bin:$HOME/go/bin:$PATH 34 | export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' 35 | 36 | # https://goproxy.io/zh/ 37 | export GOPROXY=https://goproxy.io,direct 38 | # 不走 proxy 的私有仓库或组,多个用逗号相隔 39 | # export GOPRIVATE=git.mycompany.com,github.com/my/private 40 | -------------------------------------------------------------------------------- /x11/.xsession: -------------------------------------------------------------------------------- 1 | xhost +SI:localuser:root 2 | -------------------------------------------------------------------------------- /xkeysnail/.config/systemd/user/xkeysnail.service: -------------------------------------------------------------------------------- 1 | # https://qiita.com/samurai20000@github/items/2e1d779e806a7e8543d6 2 | # https://github.com/mooz/xkeysnail/issues/12 3 | # copy to /etc/systemd/system/xkeysnail.service 4 | 5 | [Unit] 6 | Description=xkeysnail 7 | 8 | [Service] 9 | Environment=DISPLAY=:0 10 | ExecStart=xkeysnail -q /home/aloxaf/.config/xkeysnail/config.py 11 | Restart=always 12 | RestartSec=10 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /xkeysnail/.config/xkeysnail/config.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | from xkeysnail.transform import * 4 | 5 | # [Global modemap] Change modifier keys as in xmodmap 6 | define_modmap({Key.CAPSLOCK: Key.LEFT_CTRL}) 7 | 8 | # Alt + N to choose completion 9 | define_keymap( 10 | lambda wm_class: wm_class 11 | in ("jetbrains-clion", "jetbrains-pycharm", "jetbrains-goland"), 12 | { 13 | K("LM-Key_2"): [K("down"), K("down"), K("tab")], 14 | K("LM-Key_3"): [K("down"), K("down"), K("tab")], 15 | K("LM-Key_4"): [K("down"), K("down"), K("down"), K("tab")], 16 | }, 17 | "JetBrains", 18 | ) 19 | 20 | WHITE_LIST = ( 21 | "Emacs", 22 | "Alacritty", 23 | "konsole", 24 | "jetbrains-clion", 25 | "jetbrains-pycharm", 26 | "jetbrains-goland", 27 | ) 28 | 29 | define_keymap( 30 | lambda wm_class: wm_class not in WHITE_LIST, 31 | { 32 | # Cursor 33 | K("LC-b"): with_mark(K("left")), 34 | K("LC-f"): with_mark(K("right")), 35 | K("LC-p"): with_mark(K("up")), 36 | K("LC-n"): with_mark(K("down")), 37 | # Forward/Backward word 38 | K("LM-b"): with_mark(K("LC-left")), 39 | K("LM-f"): with_mark(K("LC-right")), 40 | # Beginning/End of line 41 | K("LC-a"): with_mark(K("home")), 42 | K("LC-e"): with_mark(K("end")), 43 | # Page up/down 44 | K("LM-v"): with_mark(K("page_up")), 45 | K("LC-v"): with_mark(K("page_down")), 46 | # Beginning/End of file 47 | K("LShift-LM-comma"): with_mark(K("LC-home")), 48 | K("LShift-LM-dot"): with_mark(K("LC-end")), 49 | # Delete line 50 | K("LC-LShift-backspace"): [ 51 | K("home"), 52 | K("LShift-end"), 53 | K("LC-x"), 54 | K("backspace"), 55 | ], 56 | # Newline 57 | K("C-m"): K("enter"), 58 | K("C-j"): K("enter"), 59 | # Copy 60 | K("LC-w"): [K("LC-x"), set_mark(False)], 61 | K("LM-w"): [K("LC-c"), set_mark(False)], 62 | K("LC-y"): [K("LC-v"), set_mark(False)], 63 | # Delete 64 | K("LC-d"): [K("delete"), set_mark(False)], 65 | K("LM-d"): [K("LC-delete"), set_mark(False)], 66 | # Kill line 67 | K("LC-k"): [K("LShift-end"), K("LC-x"), set_mark(False)], 68 | # Undo 69 | K("LC-slash"): [K("LC-z"), set_mark(False)], 70 | K("LC-LShift-slash"): [K("LC-z"), set_mark(False)], 71 | # Redo 72 | K("LC-LShift-minus"): [K("LC-z")], 73 | K("LM-LShift-minus"): [K("LC-LShift-z")], 74 | # Mark 75 | K("LC-space"): set_mark(True), 76 | K("LC-M-space"): with_or_set_mark(K("LC-right")), 77 | # Search 78 | K("LC-s"): K("LC-f"), 79 | # Cancel 80 | K("LC-g"): [K("esc"), set_mark(False)], 81 | # Escape 82 | # NOTE: https://github.com/mooz/xkeysnail/issues/74 83 | # You need to release C-q before next key 84 | K("LC-q"): escape_next_key, 85 | # C-x YYY 86 | K("LC-x"): { 87 | # C-x h (select all) 88 | K("h"): K("LC-a"), 89 | # C-x C-f (open) 90 | K("LC-f"): K("LC-o"), 91 | # C-x C-s (save) 92 | K("LC-s"): K("LC-s"), 93 | # C-x k (kill tab) 94 | K("k"): K("LC-w"), 95 | # C-x C-c (exit) 96 | K("LC-c"): K("LC-q"), 97 | # cancel 98 | K("LC-g"): pass_through_key, 99 | # C-x u (undo) 100 | K("u"): [K("LC-z"), set_mark(False)], 101 | }, 102 | }, 103 | "Emacs-like keys", 104 | ) 105 | -------------------------------------------------------------------------------- /zsh/.config/zsh/.gitignore: -------------------------------------------------------------------------------- 1 | .z 2 | .zcompdump 3 | .zcompcache 4 | .zkbd 5 | .*_history 6 | *.bak 7 | -------------------------------------------------------------------------------- /zsh/.config/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | module_path+=( "$ZDOTDIR/zinit/module/Src" ) 2 | zmodload zdharma_continuum/zinit 3 | 4 | source $ZDOTDIR/zshrc.zsh 5 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_aliyun: -------------------------------------------------------------------------------- 1 | #compdef aliyun 2 | 3 | autoload -U +X bashcompinit && bashcompinit -i 4 | complete -o nospace -F /home/aloxaf/.local/bin/aliyun aliyun 5 | 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_aria2c: -------------------------------------------------------------------------------- 1 | #compdef aria2c 2 | 3 | _arguments \ 4 | '*:file:_files' \ 5 | {-d,--dir}'[The directory to store the downloaded file.]' \ 6 | {-i,--input-file}'[Downloads the URIs listed in FILE.]' \ 7 | {-l,--log}'[The file name of the log file. If - is specified, log is written to stdout.]' \ 8 | {-j,--max-concurrent-downloads}'[Set the maximum number of parallel downloads for every queue item.]' \ 9 | {-V,--check-integrity}'[Check file integrity by validating piece hashes or a hash of entire file.]' \ 10 | {-c,--continue}'[Continue downloading a partially downloaded file.]' \ 11 | {-h,--help}'[The help messages are classified with tags. A tag starts with #.]' \ 12 | '--all-proxy[Use a proxy server for all protocols.]' \ 13 | '--all-proxy-passwd[Set password for \\%--all-proxy option.]' \ 14 | '--all-proxy-user[Set user for \\%--all-proxy option.]' \ 15 | '--checksum[Set checksum. TYPE is hash type.]' \ 16 | '--connect-timeout[Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy …]' \ 17 | '--dry-run[If true is given, aria2 just checks whether the remote file is available and …]' \ 18 | '--lowest-speed-limit[Close connection if download speed is lower than or equal to this value(bytes…]' \ 19 | {-x,--max-connection-per-server}'[The maximum number of connections to one server for each download.]' \ 20 | '--max-file-not-found[If aria2 receives "file not found" status from the remote HTTP/FTP servers NU…]' \ 21 | {-m,--max-tries}'[Set number of tries. 0 means unlimited. See also \\%--retry-wait.]' \ 22 | {-k,--min-split-size}'[aria2 does not split less than 2*SIZE byte range.]' \ 23 | '--netrc-path[Specify the path to the netrc file. Default: $(HOME)/. netrc .]' \ 24 | {-n,--no-netrc}'[Disables netrc support. netrc support is enabled by default.]' \ 25 | '--no-proxy[Specify a comma separated list of host names, domains and network addresses w…]' \ 26 | {-o,--out}'[The file name of the downloaded file.]' \ 27 | '--proxy-method[Set the method to use in proxy request. METHOD is either get or tunnel.]' \ 28 | {-R,--remote-time}'[Retrieve timestamp of the remote file from the remote HTTP/FTP server and if …]' \ 29 | '--reuse-uri[Reuse already used URIs if no unused URIs are left. Default: true.]' \ 30 | '--retry-wait[Set the seconds to wait between retries.]' \ 31 | '--server-stat-of[Specify the file name to which performance profile of the servers is saved.]' \ 32 | '--server-stat-if[Specify the file name to load performance profile of the servers.]' \ 33 | '--server-stat-timeout[Specifies timeout in seconds to invalidate performance profile of the servers…]' \ 34 | {-s,--split}'[Download a file using N connections.]' \ 35 | '--stream-piece-selector[Specify piece selection algorithm used in HTTP/FTP download.]' \ 36 | {-t,--timeout}'[Set timeout in seconds. Default: 60.]' \ 37 | '--uri-selector[Specify URI selection algorithm.]' \ 38 | '--ca-certificate[Use the certificate authorities in FILE to verify the peers.]' \ 39 | '--certificate[Use the client certificate in FILE.]' \ 40 | '--check-certificate[Verify the peer using certificates specified in \\%--ca-certificate option.]' \ 41 | '--http-accept-gzip[Send Accept: deflate, gzip request header and inflate response if remote serv…]' \ 42 | '--http-auth-challenge[Send HTTP authorization header only when it is requested by the server.]' \ 43 | '--http-no-cache[Send Cache-Control: no-cache and Pragma: no-cache header to avoid cached cont…]' \ 44 | '--http-user[Set HTTP user. This affects all URIs.]' \ 45 | '--http-passwd[Set HTTP password. This affects all URIs.]' \ 46 | '--http-proxy[Use a proxy server for HTTP. To override a previously defined proxy, use "".]' \ 47 | '--http-proxy-passwd[Set password for \\%--http-proxy.]' \ 48 | '--http-proxy-user[Set user for \\%--http-proxy.]' \ 49 | '--https-proxy[Use a proxy server for HTTPS. To override a previously defined proxy, use "".]' \ 50 | '--https-proxy-passwd[Set password for \\%--https-proxy.]' \ 51 | '--https-proxy-user[Set user for \\%--https-proxy.]' \ 52 | '--private-key[Use the private key in FILE.]' \ 53 | '--referer[Set an http referrer (Referer). This affects all http/https downloads.]' \ 54 | '--enable-http-keep-alive[Enable HTTP/1. 1 persistent connection. Default: true.]' \ 55 | '--enable-http-pipelining[Enable HTTP/1. 1 pipelining. Default: false . sp NOTE: NDENT 7. 0 NDENT 3.]' \ 56 | '--header[Append HEADER to HTTP request header.]' \ 57 | '--load-cookies[Load Cookies from FILE using the Firefox3 format (SQLite3), Chromium/Google C…]' \ 58 | '--save-cookies[Save Cookies to FILE in Mozilla/Firefox(1. x/2. x)/ Netscape format.]' \ 59 | '--use-head[Use HEAD method for the first request to the HTTP server. Default: false.]' \ 60 | {-U,--user-agent}'[Set user agent for HTTP(S) downloads.]' \ 61 | '--ftp-user[Set FTP user. This affects all URIs. Default: anonymous.]' \ 62 | '--ftp-passwd[Set FTP password. This affects all URIs.]' \ 63 | {-p,--ftp-pasv}'[Use the passive mode in FTP. If false is given, the active mode will be used.]' \ 64 | '--ftp-proxy[Use a proxy server for FTP. To override a previously defined proxy, use "".]' \ 65 | '--ftp-proxy-passwd[Set password for \\%--ftp-proxy option.]' \ 66 | '--ftp-proxy-user[Set user for \\%--ftp-proxy option.]' \ 67 | '--ftp-type[Set FTP transfer type. TYPE is either binary or ascii. Default: binary .]' \ 68 | '--ftp-reuse-connection[Reuse connection in FTP. Default: true.]' \ 69 | '--ssh-host-key-md[Set checksum for SSH host public key. TYPE is hash type.]' \ 70 | '--select-file[Set file to download by specifying its index.]' \ 71 | {-S,--show-files}'[Print file listing of ". torrent", ". meta4" and ". metalink" file and exit.]' \ 72 | '--bt-detach-seed-only[Exclude seed only downloads when counting concurrent active downloads (See \\%…]' \ 73 | '--bt-enable-hook-after-hash-check[Allow hook command invocation after hash check (see \\%-V option) in BitTorren…]' \ 74 | '--bt-enable-lpd[Enable Local Peer Discovery.]' \ 75 | '--bt-exclude-tracker[Comma separated list of BitTorrent tracker\\(aqs announce URI to remove.]' \ 76 | '--bt-external-ip[Specify the external IP address to use in BitTorrent download and DHT.]' \ 77 | '--bt-force-encryption[Requires BitTorrent message payload encryption with arc4.]' \ 78 | '--bt-hash-check-seed[If true is given, after hash check using \\%--check-integrity option and file …]' \ 79 | '--bt-load-saved-metadata[Before getting torrent metadata from DHT when downloading with magnet link, f…]' \ 80 | '--bt-lpd-interface[Use given interface for Local Peer Discovery.]' \ 81 | '--bt-max-open-files[Specify maximum number of files to open in multi-file BitTorrent/Metalink dow…]' \ 82 | '--bt-max-peers[Specify the maximum number of peers per torrent. 0 means unlimited.]' \ 83 | '--bt-metadata-only[Download meta data only.]' \ 84 | '--bt-min-crypto-level[Set minimum level of encryption method.]' \ 85 | '--bt-prioritize-piece[Try to download first and last pieces of each file first.]' \ 86 | '--bt-remove-unselected-file[Removes the unselected files when download is completed in BitTorrent.]' \ 87 | '--bt-require-crypto[If true is given, aria2 doesn\\(aqt accept and establish connection with legac…]' \ 88 | '--bt-request-peer-speed-limit[If the whole download speed of every torrent is lower than SPEED, aria2 tempo…]' \ 89 | '--bt-save-metadata[Save meta data as ". torrent" file.]' \ 90 | '--bt-seed-unverified[Seed previously downloaded files without verifying piece hashes.]' \ 91 | '--bt-stop-timeout[Stop BitTorrent download if download speed is 0 in consecutive SEC seconds.]' \ 92 | '--bt-tracker[Comma separated list of additional BitTorrent tracker\\(aqs announce URI.]' \ 93 | '--bt-tracker-connect-timeout[Set the connect timeout in seconds to establish connection to tracker.]' \ 94 | '--bt-tracker-interval[Set the interval in seconds between tracker requests.]' \ 95 | '--bt-tracker-timeout[Set timeout in seconds. Default: 60.]' \ 96 | '--dht-entry-point[Set host and port as an entry point to IPv4 DHT network.]' \ 97 | '--dht-entry-point6[Set host and port as an entry point to IPv6 DHT network.]' \ 98 | '--dht-file-path[Change the IPv4 DHT routing table file to PATH. Default: $HOME/. aria2/dht.]' \ 99 | '--dht-file-path6[Change the IPv6 DHT routing table file to PATH. Default: $HOME/. aria2/dht6.]' \ 100 | '--dht-listen-addr6[Specify address to bind socket for IPv6 DHT.]' \ 101 | '--dht-listen-port[Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker.]' \ 102 | '--dht-message-timeout[Set timeout in seconds. Default: 10.]' \ 103 | '--enable-dht[Enable IPv4 DHT functionality. It also enables UDP tracker support.]' \ 104 | '--enable-dht6[Enable IPv6 DHT functionality.]' \ 105 | '--enable-peer-exchange[Enable Peer Exchange extension.]' \ 106 | '--follow-torrent[If true or mem is specified, when a file whose suffix is .]' \ 107 | {-O,--index-out}'[Set file path for file with index=INDEX.]' \ 108 | '--listen-port[Set TCP port number for BitTorrent downloads.]' \ 109 | '--max-overall-upload-limit[Set max overall upload speed in bytes/sec. 0 means unrestricted.]' \ 110 | {-u,--max-upload-limit}'[Set max upload speed per each torrent in bytes/sec. 0 means unrestricted.]' \ 111 | '--peer-id-prefix[Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length.]' \ 112 | '--peer-agent[Specify the string used during the bitorrent extended handshake for the peer\\…]' \ 113 | '--seed-ratio[Specify share ratio. Seed completed torrents until share ratio reaches RATIO.]' \ 114 | '--seed-time[Specify seeding time in (fractional) minutes.]' \ 115 | {-T,--torrent-file}'[The path to the ". torrent" file.]' \ 116 | '--follow-metalink[If true or mem is specified, when a file whose suffix is . meta4 or .]' \ 117 | '--metalink-base-uri[Specify base URI to resolve relative URI in metalink:url and metalink:metaurl…]' \ 118 | {-M,--metalink-file}'[The file path to ". meta4" and ". metalink" file.]' \ 119 | '--metalink-language[The language of the file to download.]' \ 120 | '--metalink-location[The location of the preferred server.]' \ 121 | '--metalink-os[The operating system of the file to download.]' \ 122 | '--metalink-version[The version of the file to download.]' \ 123 | '--metalink-preferred-protocol[Specify preferred protocol.]' \ 124 | '--metalink-enable-unique-protocol[If true is given and several protocols are available for a mirror in a metali…]' \ 125 | '--enable-rpc[Enable JSON-RPC/XML-RPC server.]' \ 126 | '--pause[Pause download after added.]' \ 127 | '--pause-metadata[Pause downloads created as a result of metadata download.]' \ 128 | '--rpc-allow-origin-all[Add Access-Control-Allow-Origin header field with value * to the RPC response.]' \ 129 | '--rpc-certificate[Use the certificate in FILE for RPC server.]' \ 130 | '--rpc-listen-all[Listen incoming JSON-RPC/XML-RPC requests on all network interfaces.]' \ 131 | '--rpc-listen-port[Specify a port number for JSON-RPC/XML-RPC server to listen to.]' \ 132 | '--rpc-max-request-size[Set max size of JSON-RPC/XML-RPC request.]' \ 133 | '--rpc-passwd[Set JSON-RPC/XML-RPC password. sp WARNING: NDENT 7. 0 NDENT 3.]' \ 134 | '--rpc-private-key[Use the private key in FILE for RPC server.]' \ 135 | '--rpc-save-upload-metadata[Save the uploaded torrent or metalink meta data in the directory specified by…]' \ 136 | '--rpc-secret[Set RPC secret authorization token.]' \ 137 | '--rpc-secure[RPC transport will be encrypted by SSL/TLS.]' \ 138 | '--rpc-user[Set JSON-RPC/XML-RPC user. sp WARNING: NDENT 7. 0 NDENT 3.]' \ 139 | '--allow-overwrite[Restart download from scratch if the corresponding control file doesn\\(aqt ex…]' \ 140 | '--allow-piece-length-change[If false is given, aria2 aborts download when a piece length is different fro…]' \ 141 | '--always-resume[Always resume download.]' \ 142 | '--async-dns[Enable asynchronous DNS. Default: true.]' \ 143 | '--async-dns-server[Comma separated list of DNS server address used in asynchronous DNS resolver.]' \ 144 | '--auto-file-renaming[Rename file name if the same file already exists.]' \ 145 | '--auto-save-interval[Save a control file(*. aria2) every SEC seconds.]' \ 146 | '--conditional-get[Download file only when the local file is older than remote file.]' \ 147 | '--conf-path[Change the configuration file path to PATH. Default: $HOME/. aria2/aria2.]' \ 148 | '--console-log-level[Set log level to output to console.]' \ 149 | '--content-disposition-default-utf8[Handle quoted string in Content-Disposition header as UTF-8 instead of ISO-88…]' \ 150 | {-D,--daemon}'[Run as daemon.]' \ 151 | '--deferred-input[If true is given, aria2 does not read all URIs and options from file specifie…]' \ 152 | '--disable-ipv6[Disable IPv6.]' \ 153 | '--disk-cache[Enable disk cache. If SIZE is 0, the disk cache is disabled.]' \ 154 | '--download-result[This option changes the way Download Results is formatted.]' \ 155 | '--dscp[Set DSCP value in outgoing IP packets of BitTorrent traffic for QoS.]' \ 156 | '--rlimit-nofile[Set the soft limit of open file descriptors.]' \ 157 | '--enable-color[Enable color output for a terminal. Default: true.]' \ 158 | '--enable-mmap[Map files into memory.]' \ 159 | '--event-poll[Specify the method for polling events.]' \ 160 | '--file-allocation[Specify file allocation method. none doesn\\(aqt pre-allocate file space.]' \ 161 | '--force-save[Save download with \\%--save-session option even if the download is completed …]' \ 162 | '--save-not-found[Save download with \\%--save-session option even if the file was not found on …]' \ 163 | '--gid[Set GID manually. aria2 identifies each download by the ID called GID.]' \ 164 | '--hash-check-only[If true is given, after hash check using \\%--check-integrity option, abort do…]' \ 165 | '--human-readable[Print sizes and speed in human readable format (e. g. , 1. 2Ki, 3.]' \ 166 | '--interface[Bind sockets to given interface.]' \ 167 | '--keep-unfinished-download-result[Keep unfinished download results even if doing so exceeds \\%--max-download-re…]' \ 168 | '--max-download-result[Set maximum number of download result kept in memory.]' \ 169 | '--max-mmap-limit[Set the maximum file size to enable mmap (see \\%--enable-mmap option).]' \ 170 | '--max-resume-failure-tries[When used with \\%--always-resume=false, aria2 downloads file from scratch whe…]' \ 171 | '--min-tls-version[Specify minimum SSL/TLS version to enable. Possible Values: TLSv1. 1, TLSv1.]' \ 172 | '--multiple-interface[Comma separated list of interfaces to bind sockets to.]' \ 173 | '--log-level[Set log level to output. LEVEL is either debug, info, notice, warn or error.]' \ 174 | '--on-bt-download-complete[For BitTorrent, a command specified in \\%--on-download-complete is called aft…]' \ 175 | '--on-download-complete[Set the command to be executed after download completed.]' \ 176 | '--on-download-error[Set the command to be executed after download aborted due to error.]' \ 177 | '--on-download-pause[Set the command to be executed after download was paused.]' \ 178 | '--on-download-start[Set the command to be executed after download got started.]' \ 179 | '--on-download-stop[Set the command to be executed after download stopped.]' \ 180 | '--optimize-concurrent-downloads[Optimizes the number of concurrent downloads according to the bandwidth avail…]' \ 181 | '--piece-length[Set a piece length for HTTP/FTP downloads.]' \ 182 | '--show-console-readout[Show console readout. Default: true.]' \ 183 | '--stderr[Redirect all console output that would be otherwise printed in stdout to stde…]' \ 184 | '--summary-interval[Set interval in seconds to output download progress summary.]' \ 185 | {-Z,--force-sequential}'[Fetch URIs in the command-line sequentially and download each URI in a separa…]' \ 186 | '--max-overall-download-limit[Set max overall download speed in bytes/sec. 0 means unrestricted.]' \ 187 | '--max-download-limit[Set max download speed per each download in bytes/sec. 0 means unrestricted.]' \ 188 | '--no-conf[Disable loading aria2. conf file.]' \ 189 | '--no-file-allocation-limit[No file allocation is made for files whose size is smaller than SIZE.]' \ 190 | {-P,--parameterized-uri}'[Enable parameterized URI support.]' \ 191 | {-q,--quiet}'[Make aria2 quiet (no console output). Default: false.]' \ 192 | '--realtime-chunk-checksum[Validate chunk of data by calculating checksum while downloading a file if ch…]' \ 193 | '--remove-control-file[Remove control file before download.]' \ 194 | '--save-session[Save error/unfinished downloads to FILE on exit.]' \ 195 | '--save-session-interval[Save error/unfinished downloads to a file specified by \\%--save-session optio…]' \ 196 | '--socket-recv-buffer-size[Set the maximum socket receive buffer in bytes.]' \ 197 | '--stop[Stop application after SEC seconds has passed.]' \ 198 | '--stop-with-process[Stop application when process PID is not running.]' \ 199 | '--truncate-console-readout[Truncate console readout to fit in a single line. Default: true.]' \ 200 | {-v,--version}'[Print the version number, copyright and the configuration information and exi…]' \ 201 | '-Vfalse[the argument will be treated as URI and usually this is not what you expect.]' 202 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_bat: -------------------------------------------------------------------------------- 1 | #compdef bat 2 | 3 | autoload -U is-at-least 4 | 5 | _bat() { 6 | typeset -A opt_args 7 | typeset -a _arguments_options 8 | local ret=1 9 | 10 | if is-at-least 5.2; then 11 | _arguments_options=(-s -S -C) 12 | else 13 | _arguments_options=(-s -C) 14 | fi 15 | 16 | local context curcontext="$curcontext" state line 17 | _arguments \ 18 | "${_arguments_options[@]}" \ 19 | {-l+,--language=}'[Set the language for syntax highlighting.]' \ 20 | {*-H+,*--highlight-line=}'[Highlight the given line.]' \ 21 | '--tabs=[Set the tab width to T spaces.]' \ 22 | '--wrap=[Specify the text-wrapping mode (default: auto).]: :(auto never character)' \ 23 | '--terminal-width=[Explicitly set the width of the terminal instead of determining it automatically. If prefixed with '\''+'\'' or '\''-'\'', the value will be treated as an offset to the actual terminal width. See also: '\''--wrap'\''.]' \ 24 | '--color=[When to use colors (default: auto).]: :(auto never always)' \ 25 | '--italic-text=[Use italics in output (default: never).]: :(always never)' \ 26 | '--decorations=[When to show the decorations (default: auto).]: :(auto never always)' \ 27 | '--paging=[Specify when to use the pager (default: auto).]: :(auto never always)' \ 28 | '--pager=[Determine which pager to use.]:pager: _command_names -e' \ 29 | {*-m+,*-map-syntax=}'[Map a file extension or name to an existing syntax.]' \ 30 | '--theme=[Set the color theme for syntax highlighting.]: :_bat_themes' \ 31 | '--style=[Comma-separated list of style elements to display (default: auto).]: : _values -s , style auto full plain changes header grid numbers snip ' \ 32 | {*-r+,*--line-range=}'[Only print the lines from N to M.]' \ 33 | '(-l --language)'{-A,--show-all}'[Show non-printable characters (space, tab, newline, ..).]' \ 34 | {*-p,*--plain}'[Show plain style (alias for '\''--style=plain'\'').]' \ 35 | {-n,--number}'[Show line numbers (alias for '\''--style=numbers'\'').]' \ 36 | '--list-themes[Display all supported highlighting themes.]' \ 37 | '(--list-themes)'{-L,--list-languages}'[Display all supported languages.]' \ 38 | {-u,--unbuffered}'[POSIX-compliant unbuffered output. Option is ignored]' \ 39 | '--no-config[Do not use the configuration file]' \ 40 | '(-L --list-languages --list-themes)--config-file[Show path to the configuration file.]' \ 41 | '--config-dir[Show bat'\''s configuration directory.]' \ 42 | '--cache-dir[Show bat'\''s cache directory.]' \ 43 | {-h,--help}'[Print this help message.]' \ 44 | {-V,--version}'[Show version information.]' \ 45 | "*::: :->bat" \ 46 | && ret=0 47 | 48 | case $state in 49 | (bat) 50 | curcontext="${curcontext%:*:*}:bat-command-$words[1]:" 51 | case $words[1] in 52 | cache) 53 | _arguments \ 54 | "${_arguments_options[@]}" \ 55 | '--source=[Use a different directory to load syntaxes and themes from.]: :_files -/' \ 56 | '--target=[Use a different directory to store the cached syntax and theme set.]: :_files -/' \ 57 | {-b,--build}'[Initialize (or update) the syntax/theme cache.]' \ 58 | {-c,--clear}'[Remove the cached syntax definitions and themes.]' \ 59 | '--blank[Create completely new syntax and theme sets (instead of appending to the default sets).]' \ 60 | {-h,--help}'[Prints help information]' \ 61 | {-V,--version}'[Prints version information]' \ 62 | && ret=0 63 | ;; 64 | "") 65 | _alternative \ 66 | 'files:FILE -- File(s) to print / concatenate. Use '-' for standard input.:_files' \ 67 | || _alternative \ 68 | 'command:bat commands:((cache\:"Modify the syntax-definition and theme cache"))' \ 69 | && ret=0 70 | ;; 71 | *) 72 | _arguments \ 73 | '*::FILE -- File(s) to print / concatenate. Use '-' for standard input.:_files' \ 74 | && ret=0 75 | ;; 76 | esac 77 | ;; 78 | esac 79 | 80 | return ret 81 | } 82 | 83 | _bat_themes() { 84 | local -a themes 85 | themes=(${(f)"$(_call_program themes bat --list-themes)"}) 86 | _describe -t themes 'themes' themes 87 | } 88 | 89 | _bat "$@" 90 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_bgrep: -------------------------------------------------------------------------------- 1 | #compdef bgrep 2 | 3 | # zsh completions for 'bgrep' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-b,--byte-offset}'[prints the byte offset of each match]' 9 | {-l,--files-with-matches}'[prints the name of the matched files (default output mode)]' 10 | {-L,--files-without-matches}'[prints the name of non-matched files]' 11 | '--help[prints help information]' 12 | {-i,--ignore-case}'[case insensitive matching for ASCII alphabetic characters]' 13 | {-v,--invert-match}'[invert the sense of matching, to select non matching slices]' 14 | {-h,--no-filename}'[suppress the file names on output (default when there is a single file).]' 15 | {-o,--only-matching}'[prints the matched bytes of each match]' 16 | {-n,--trim-ending-newline}'[if the file ends with a newline, disconsider the last byte]' 17 | {-V,--version}'[prints version information]' 18 | {-H,--with-filename}'[print the file name for each match (default when there are multiple files).]' 19 | '*:filename:_files' 20 | ) 21 | 22 | _arguments -s $arguments 23 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_cargo-add: -------------------------------------------------------------------------------- 1 | #compdef cargo-add 2 | 3 | _cargo-edit-curl() { 4 | if (( $+commands[curl] )); then 5 | curl -s $1 6 | fi 7 | # TODO: wget 8 | } 9 | 10 | _cargo-add() { 11 | emulate -L zsh -o extended_glob 12 | 13 | typeset -A opt_args 14 | local context state state_descr line 15 | 16 | local curcontext=$curcontext ret=1 17 | 18 | _arguments -s -C \ 19 | '--allow-prerelease[Include prerelease versions when fetching from crates.io]' \ 20 | {-B,--build}'[Add crate as build dependency]' \ 21 | {-D,--dev}'[Add crate as development dependency]' \ 22 | {-h,--help}'[Prints help information]' \ 23 | '--no-default-features[Set `default-features = false` for the added dependency]' \ 24 | '--offline[Run without accessing the network]' \ 25 | '--optional[Add as an optional dependency (for use in features)]' \ 26 | {-q,--quiet}'[Do not print any output in case of success]' \ 27 | {-s,--sort}'[Sort dependencies even if currently unsorted]' \ 28 | {-V,--version}'[Prints version information]' \ 29 | '--branch=[Specify a git branch to download the crate from]' \ 30 | '--features=[Space-separated list of features to add]' \ 31 | '--git=[Specify a git repository to download the crate from]' \ 32 | '--manifest-path=[Path to the manifest to add a dependency to]:file:_files' \ 33 | '--path=[Specify the path the crate should be loaded from]:path:_files -/' \ 34 | {-p,--package=}'[Package id of the crate to add this dependency to]' \ 35 | '--registry[Registry to use]' \ 36 | {-r,--rename=}'[Rename a dependency in Cargo.toml]' \ 37 | '--targe=t[Add as dependency to the given target platform]:targets:_cargo-edit_targets' \ 38 | '--upgrade=[Choose method of semantic version upgrade (default: default)]:method:(none patch minor all default)' \ 39 | '--vers=[Specify the version to grab from the registry(crates.io)]:crate version:->version' \ 40 | '*:crate:_cargo-edit_cached_crates' \ 41 | && return 0 42 | 43 | case $state in 44 | version) 45 | local package=${${words/-*/}[2]} 46 | local -a versions=($(_cargo-edit-curl "https://crates.io/api/v1/crates/$package" | jq --raw-output '.versions[] | .num')) 47 | # TODO: don't sort 48 | _describe -t version 'crate version' -a versions 49 | ;; 50 | esac 51 | 52 | } 53 | 54 | _cargo-edit_cached_crates() { 55 | local -Ua crates 56 | crates=(~/.cargo/registry/cache/**/*.crate(:r:t)) 57 | crates=(${crates%%-[0-9].[0-9]*}) 58 | _describe -t crates 'local cached crates' crates 59 | } 60 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_cargo-rm: -------------------------------------------------------------------------------- 1 | #compdef cargo-rm 2 | 3 | _cargo-rm() { 4 | _arguments \ 5 | {-B,--build}"[Remove crate as build dependency]" \ 6 | {-D,--dev}"[Remove crate as development dependency]" \ 7 | {-h,--help}"[Prints help information]" \ 8 | {-q,--quiet}"[Do not print any output in case of success]" \ 9 | {-V,--version}"[Prints version information]" \ 10 | '--manifest-path=[Path to the manifest to add a dependency to]:file:_files' \ 11 | '*:crate:_cargo-edit_local_crates' 12 | } 13 | 14 | _cargo-edit_local_crates() { 15 | local -a crates 16 | crates=(${${(f)"$(cargo read-manifest | jq -r '.dependencies[] | "\(.name):\(.kind)"')"}%:null}) 17 | _describe -t crates 'local crates' crates 18 | } 19 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_cargo-upgrade: -------------------------------------------------------------------------------- 1 | #compdef cargo-upgrade 2 | 3 | _cargo-upgrade() { 4 | _arguments \ 5 | '--all[upgrade all packages in the workspace]' \ 6 | '--allow-prerelease[include prerelease versions when fetching from crates.io (e.g. 0.6.0-alpha)]' \ 7 | '--dry-run[print changes to be made without making them]' \ 8 | {-h,--help}'[prints help information]' \ 9 | '--offline[run without accessing the network]' \ 10 | '--skip-compatible[only update a dependency if the new version is semver incompatible]' \ 11 | '--to-lockfile[upgrade all packages to the version in the lockfile]' \ 12 | {-V,--version}'[prints version information]' \ 13 | '--manifest-path=[path to the manifest to upgrade]:file:_files' \ 14 | '*:crate:_cargo-edit_local_crates' 15 | } 16 | 17 | _cargo-edit_local_crates() { 18 | local -a crates 19 | crates=(${${(f)"$(cargo read-manifest | jq -r '.dependencies[] | "\(.name):\(.kind)"')"}%:null}) 20 | _describe -t crates 'local crates' crates 21 | } 22 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_cppman: -------------------------------------------------------------------------------- 1 | #compdef cppman 2 | 3 | # A function calling _arguments with at least one action containing a ‘->string’ 4 | # must therefore declare appropriate local parameters to prevent _arguments 5 | # from altering the global environment. 6 | local context state state_descr line 7 | typeset -A opt_args 8 | 9 | _arguments \ 10 | {-s,--source}'[Select source, either '"'"'cppreference. com'"'"' or '"'"'cplusplus. com'"'"'.]' \ 11 | {-c,--cache-all}'[cache all available man pages from cplusplus. com to enable offline browsing.]' \ 12 | {-C,--clear-cache}'[clear all cached files.]' \ 13 | {-f,--find-page}'[find man page.]' \ 14 | {-o,--force-update}'[force cppman to update existing cache when '"'"'--cache-all'"'"' or browsing man page…]' \ 15 | {-m,--use-mandb}'[Accepts '"'"'true'"'"' or '"'"'false'"'"'.]' \ 16 | {-p,--pager}'[Select pager to use, accepts '"'"'vim'"'"', '"'"'nvim'"'"' or '"'"'less'"'"'.]' \ 17 | {-r,--rebuild-index}'[rebuild index database from cplusplus. com.]' \ 18 | {-v,--version}'[show version information.]' \ 19 | {-h,--help}'[show this help message and exit NOTE All contents should be cached by the use…]' \ 20 | '*::: :->keywords' \ 21 | 22 | case $state in; 23 | keywords) 24 | if [[ -z $words[CURRENT] ]] then; 25 | compadd -x "%F{yellow}[Please provide a keyword]%f" 26 | return 0 27 | fi 28 | local -a descr=(${${${(f)"$(command cppman -f $words[CURRENT])"}//:/\\:}/ - /:}) 29 | _describe "keywords" descr 30 | esac 31 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_file: -------------------------------------------------------------------------------- 1 | #compdef file 2 | 3 | # zsh completions for 'file' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | '--help[display this help and exit]' 9 | {-v,--version}'[output version information and exit]' 10 | {-m,--magic-file}'[use LIST as a colon-separated list of magic]' 11 | {-z,--uncompress}'[try to look inside compressed files]' 12 | {-Z,--uncompress-noreport}'[only print the contents of compressed files]' 13 | {-b,--brief}'[do not prepend filenames to output lines]' 14 | {-c,--checking-printout}'[print the parsed form of the magic file]' 15 | {-e,--exclude}'[exclude TEST from the list of test to be performed for file]' 16 | '--exclude-quiet[like exclude, but ignore unknown tests]' 17 | {-f,--files-from}'[read the filenames to be examined from FILE]' 18 | {-F,--separator}'[use string as separator instead of `:]' 19 | {-i,--mime}'[output MIME type strings]' 20 | '--apple[output the Apple CREATOR/TYPE]' 21 | '--extension[output a slash-separated list of extensions]' 22 | '--mime-type[output the MIME type]' 23 | '--mime-encoding[output the MIME encoding]' 24 | {-k,--keep-going}'[dont stop at the first match]' 25 | {-l,--list}'[list magic strength]' 26 | {-L,--dereference}'[follow symlinks]' 27 | {-h,--no-dereference}'[dont follow symlinks (default)]' 28 | {-n,--no-buffer}'[do not buffer output]' 29 | {-N,--no-pad}'[do not pad output]' 30 | {-0,--print0}'[terminate filenames with ASCII NUL]' 31 | {-p,--preserve-date}'[preserve access times on files]' 32 | {-P,--parameter}'[set file engine parameter limits]' 33 | {-r,--raw}'[dont translate unprintable chars to \ooo]' 34 | {-s,--special-files}'[treat special (block/char devices) files as ordinary ones]' 35 | {-S,--no-sandbox}'[disable system call sandboxing]' 36 | {-C,--compile}'[compile file specified by -m]' 37 | {-d,--debug}'[print debugging messages]' 38 | '*:filename:_files' 39 | ) 40 | 41 | _arguments -s $arguments 42 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_fzf: -------------------------------------------------------------------------------- 1 | #compdef fzf 2 | 3 | local context state state_descr line 4 | local -A val_args opt_args 5 | 6 | local -a fzf_keys=( 7 | ctrl-{a..z} 8 | ctrl-{space,'\',']',^,/} 9 | ctrl-alt-{a..z} 10 | alt-{a..z} 11 | alt-{0..9} 12 | f{1..12} 13 | enter space bspace 14 | alt-{up,down,left,right,enter,space,bspace,/} 15 | tab btab esc del up down left right home end insert pgup pgdn 16 | shift-{up,down,left-right} 17 | {left,right,doule}-click 18 | change 19 | ) 20 | 21 | local -a fzf_actions=( 22 | abort 23 | accept 24 | accept-non-empty 25 | backward-delete-char 26 | backward-delete-char/eof 27 | backward-kill-word 28 | beginning-of-line 29 | cancel 30 | clear-{screen,selection,query} 31 | delete-{char,char/eof} 32 | {select,deselect}-all 33 | down 34 | end-of-line 35 | execute 36 | execurt-{silent,multi} 37 | {forward,backword}-{char,word} 38 | ignore 39 | jump 40 | jump-accept 41 | kill-{line,word} 42 | {next,previous}-history 43 | {half,preview}-page-{down,up} 44 | {page,preview}-{down,up} 45 | {print,replace}-query 46 | reload 47 | toggle 48 | toggle-{all,in,out,preview,preview-wrap,sort} 49 | toggle+{down,up} 50 | top 51 | unix-line-discard 52 | unix-word-rubout 53 | up 54 | yank 55 | ) 56 | 57 | _fzf_tiebreak() { 58 | _values -s , tiebreak \ 59 | 'length[Prefers line with shorter length]' \ 60 | 'begin[Prefers line with matched substring closer to the beginning]' \ 61 | 'end[Prefers line with matched substring closer to the end]' \ 62 | 'index[Prefers line that appeared earlier in the input stream]' 63 | } 64 | 65 | _fzf_keybindings() { 66 | _sep_parts fzf_keys ':' fzf_actions 67 | } 68 | 69 | _arguments \ 70 | '*:file:_files' \ 71 | {-x,--extended}'[Extended-search mode. Since 0.10.9, this is enabled by default.]' \ 72 | {+x,--no-extended}'[Disable extended-search mode]' \ 73 | {-e,--exact}'[Enable exact-match]' \ 74 | '-i[Case-insensitive match (default: smart-case match)]' \ 75 | '+i[Case-sensitive match]' \ 76 | '--literal[Do not normalize latin script letters for matching]' \ 77 | '--algo=[Fuzzy matching algorithm (default: v2)]:algo:(v1 v2)' \ 78 | {-n+,--nth=}'[Comma-separated list of field index expressions for limiting search scope]' \ 79 | '--with-nth[Transform the presentation of each line using field index expressions]' \ 80 | {-d+,--delimiter=}'[Field delimiter regex for --nth and --with-nth (default: AWK-style)]' \ 81 | '--phony[Do not perform search]' \ 82 | {+s,--no-sort}'[Do not sort the result]' \ 83 | '--tac[Reverse the order of the input]' \ 84 | '--tiebreak=[Comma-separated list of sort criteria to apply when the scores are tied.]:tiebreak:_fzf_tiebreak' \ 85 | {-m,--multi}'[Enable multi-select with tab/shift-tab]' \ 86 | {+m,--no-multi}'[Disable multi-select]' \ 87 | '--no-mouse[Disable mouse]' \ 88 | '--bind=[Comma-separated list of custom key bindings]:key bindings:_sequence -s , _fzf_keybindings' \ 89 | '--cycle[Enable cyclic scroll]' \ 90 | '--keep-right[Keep the right end of the line visible when it'"'"'s too long]' \ 91 | '--no-hscroll[Disable horizontal scroll.]' \ 92 | '--hscroll-off=[Number of screen columns to keep to the right of the highlighted substring (default: 10)]' \ 93 | '--filepath-word[Make word-wise movements and actions respect path separators]' \ 94 | '--jump-labels=[Label characters for jump and jump-accept]' \ 95 | '--height=[Display fzf window below the cursor with the given height instead of using the full screen]' \ 96 | '--min-height=[Minimum height when --height is given in percent (default: 10)]' \ 97 | '--layout=[Choose the layout (default: default)]:layout:(default reverse reverse-list)' \ 98 | '--reverse[A synonym for --layout=reverse]' \ 99 | '--border=[Draw border around the finder]:border:(rounded sharp horizontal)' \ 100 | '--no-unicode[Use ASCII characters instead of Unicode box drawing characters to draw border]' \ 101 | '--margin=[Comma-separated expression for margins around the finder]' \ 102 | '--info=[Determines the display style of finder info]:style:(default inline hidden)' \ 103 | '--no-info[A synonym for --info=hidden]' \ 104 | '--prompt=[Input prompt (default: '"'"'> '"'"')]' \ 105 | '--pointer=[Pointer to the current line (default: '"'"'>'"'"')]' \ 106 | '--marker=[Multi-select marker (default: '"'"'>'"'"')]' \ 107 | '--header=[The given string will be printed as the sticky header]' \ 108 | '--header-lines=[The first N lines of the input are treated as the sticky header]' \ 109 | '--ansi[Enable processing of ANSI color codes]' \ 110 | '--tabstop=[Number of spaces for a tab character (default: 8)]' \ 111 | '--color=[Color configuration]' \ 112 | '--no-bold[Do not use bold text]' \ 113 | '--black[Use black background]' \ 114 | '--history=[Load search history from the specified file and update the file on completion]: :_files' \ 115 | '--history-size=[Maximum number of entries in the history file (default: 1000)]' \ 116 | '--preview=[Execute the given command for the current line and display the result on the preview window]' \ 117 | '--preview-window[Determines the layout of the preview window]' \ 118 | {-q+,--query=}'[Start the finder with the given query]' \ 119 | {-1,--select-1}'[Automatically select the only match]' \ 120 | {-0,--exit-0}'[Exit immediately when there'"'"'s no match]' \ 121 | {-f+,--filter=}'[Filter mode. Do not start interactive finder]' \ 122 | '--print-query[Print query as the first line]' \ 123 | '--expect=[Comma-separated list of keys that can be used to complete fzf in addition to the default enter key]:keys:_values -s , $fzf_keys' \ 124 | '--read0[Read input delimited by ASCII NUL characters instead of newline characters]' \ 125 | '--print0[Print output delimited by ASCII NUL characters instead of newline characters]' \ 126 | '--no-clear[Do not clear finder interface on exit]' \ 127 | '--sync[Synchronous search for multi-staged filtering]' \ 128 | '--version[Display version information and exit]' 129 | 130 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_git-brws: -------------------------------------------------------------------------------- 1 | #compdef git-brws 2 | 3 | _git-brws() { 4 | _arguments \ 5 | {-r,--repo}'[Shorthand format or Git URL you want to see]' \ 6 | {-b,--branch}'[Branch name to browse (default: current branch)]: :_git-brws_branch_names' \ 7 | {-d,--dir}'[Directory path to the repository (default: current dir)]: :_files -/' \ 8 | {-R,--remote}'[Remote name (default: the remote current branch tracking)]' \ 9 | {-u,--url}'[Output URL to stdout instead of opening in browser]' \ 10 | {-p,--pr}'[Open/Create pull request page instead of repository page]' \ 11 | {-w,--website}'[Open website page instead of repository page]' \ 12 | {-B,--blame}'[Open blame page instead of repository page]: :_files' \ 13 | {-h,--help}'[Print this help]' \ 14 | {-v,--version}'[Show version]' \ 15 | '*:: :_files' 16 | } 17 | 18 | _git-brws_branch_names() { 19 | local -a branch_names 20 | branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}) 21 | _describe -t branch 'branch names' branch_names 22 | } 23 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_grc: -------------------------------------------------------------------------------- 1 | #compdef grc 2 | 3 | # zsh completions for 'grc' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-e,--stderr}'[redirect stderr. If this option is selected]' 9 | {-s,--stdout}'[redirect stdout, even if -e is selected]' 10 | {-c,--config=}'[use name as configuration file for grcat]' 11 | '--colour=[word is one of: on, off, auto]: :(on off auto)' 12 | '--pty[run command in pseudoterminal (experimental)]' 13 | '(-)1:command: _command_names -e' 14 | '*::arguments: _normal' 15 | ) 16 | 17 | _arguments -s -S $arguments 18 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_lotus: -------------------------------------------------------------------------------- 1 | #compdef lotus lotus-miner lotus-worker 2 | 3 | _cli_zsh_autocomplete() { 4 | 5 | local -a opts 6 | local cur 7 | cur=${words[-1]} 8 | if [[ "$cur" == "-"* ]]; then 9 | opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}") 10 | else 11 | opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}") 12 | fi 13 | 14 | if [[ "${opts[1]}" != "" ]]; then 15 | _describe 'values' opts 16 | else 17 | _files 18 | fi 19 | 20 | return 21 | } 22 | 23 | compdef _cli_zsh_autocomplete lotus lotus-miner lotus-worker 24 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_pactree: -------------------------------------------------------------------------------- 1 | #compdef pactree 2 | 3 | local arguments 4 | 5 | (( $+functions[_pacman_completions_installed_packages] )) || { 6 | _pacman 2>/dev/null 7 | } 8 | 9 | arguments=( 10 | {-a,--ascii}'[use ASCII characters for tree formatting]' 11 | {-b,--dbpath}'[set an alternate database location]' 12 | {-c,--color}'[colorize output]' 13 | {-d,--depth}'[limit the depth of recursion]' 14 | {-g,--graph}'[generate output for graphvizs dot]' 15 | {-h,--help}'[display this help message]' 16 | {-l,--linear}'[enable linear output]' 17 | {-r,--reverse}'[list packages that depend on the named package]' 18 | {-s,--sync}'[search sync databases instead of local]' 19 | {-u,--unique}'[show dependencies with no duplicates (implies -l)]' 20 | {-v,--version}'[display the version]' 21 | '--config[set an alternate configuration file]' 22 | '*:package:_pacman_completions_installed_packages' 23 | ) 24 | 25 | _arguments -s $arguments 26 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_pdm: -------------------------------------------------------------------------------- 1 | #compdef pdm 2 | 3 | PDM_PIP_INDEXES=('https://pypi.org/simple/') 4 | 5 | _pdm() { 6 | emulate -L zsh -o extended_glob 7 | 8 | typeset -A opt_args 9 | local context state state_descr line 10 | 11 | local curcontext=$curcontext ret=1 12 | local -a arguments=( 13 | {-h,--help}'[Show help message and exit]' 14 | {-v,--verbose}'[Show detailed output]' 15 | {-p,--project}'=[Specify another path as the project root]:directory:_files -/' 16 | '-vv[Show more detailed output]' 17 | ) 18 | local sub_commands=( 19 | 'add:Add package(s) to pyproject.toml and install them' 20 | 'build:Build artifacts for distribution' 21 | 'cache:Control the caches of PDM' 22 | 'completion:Generate completion scripts for the given shell' 23 | 'config:Display the current configuration' 24 | 'export:Export the locked packages set to other formats' 25 | 'import:Import project metadata from other formats' 26 | 'info:Show the project information' 27 | 'init:Initialize a pyproject.toml for PDM' 28 | 'install:Install dependencies from lock file' 29 | 'list:List packages installed in the current working set' 30 | 'lock:Resolve and lock dependencies' 31 | 'remove:Remove packages from pyproject.toml' 32 | 'run:Run commands or scripts with local packages loaded' 33 | 'search:Search for PyPI packages' 34 | 'show:Show the package information' 35 | 'sync:Synchronize the current working set with lock file' 36 | 'update:Update package(s) in pyproject.toml' 37 | 'use:Use the given python version or path as base interpreter' 38 | ) 39 | 40 | _arguments -s -C -A '-*' \ 41 | $arguments \ 42 | {-V,--version}'[Show the version and exit]' \ 43 | {-I,--ignore-python}'[Ignore the Python path saved in the pdm.toml config]' \ 44 | '--pep582=[Print the command line to be eval by the shell]:shell:(zsh bash fish tcsh csh)' \ 45 | '*:: :->_subcmds' \ 46 | && return 0 47 | 48 | if (( CURRENT == 1 )); then 49 | _describe -t commands 'pdm subcommand' sub_commands 50 | return 51 | fi 52 | 53 | curcontext=${curcontext%:*}:$words[1] 54 | 55 | case $words[1] in 56 | add) 57 | arguments+=( 58 | {-g+,--global+}'[Use the global project, accepts an optional path to the project directory]:project:_files' 59 | {-d,--dev}'[Add packages into dev dependencies]' 60 | {-s+,--section+}'[Specify target section to add into]:section:_pdm_sections' 61 | '--no-sync[Only write pyproject.toml and do not sync the working set]' 62 | '--save-compatible[Save compatible version specifiers]' 63 | '--save-wildcard[Save wildcard version specifiers]' 64 | '--save-exact[Save exact version specifiers]' 65 | '--update-reuse[Reuse pinned versions already present in lock file if possible]' 66 | '--update-eager[Try to update the packages and their dependencies recursively]' 67 | {-e+,--editables}'[Specify editable packages]:packages' 68 | '*:packages:_pdm_pip_packages' 69 | ) 70 | ;; 71 | build) 72 | arguments+=( 73 | "--no-sdist[Don't build source tarballs]" 74 | "--no-wheel[Don't build wheels]" 75 | {-d+,--dest+}'[Target directory to put artifacts]:directory:_files -/' 76 | '--no-clean[Do not clean the target directory]' 77 | ) 78 | ;; 79 | cache) 80 | _arguments -C \ 81 | $arguments \ 82 | ': :->command' \ 83 | '*:: :->args' && ret=0 84 | case $state in 85 | command) 86 | local -a actions=( 87 | "clear:Clean all the files under cache directory" 88 | "remove:Remove files matching the given pattern" 89 | "list:List the built wheels stored in the cache" 90 | "info:Show the info and current size of caches" 91 | ) 92 | _describe -t command 'pdm cache actions' actions && ret=0 93 | ;; 94 | args) 95 | case $words[1] in 96 | clear) 97 | compadd -X type 'hashes' 'http' 'wheels' 'metadata' && ret=0 98 | ;; 99 | *) 100 | _message "pattern" && ret=0 101 | ;; 102 | esac 103 | ;; 104 | esac 105 | return $ret 106 | ;; 107 | config) 108 | _arguments -s \ 109 | {-g+,--global+}'[Use the global project, accepts an optional path to the project directory]:directory:_files -/' \ 110 | {-l,--local}"[Set config in the project's local configuration filie]" \ 111 | {-d,--delete}'[Unset a configuration key]' \ 112 | '1:key:->keys' \ 113 | '2:value:_files' && return 0 114 | if [[ $state == keys ]]; then 115 | local l mbegin mend match keys=() 116 | for l in ${(f)"$(command pdm config)"}; do 117 | if [[ $l == (#b)" "#(*)" = "(*) ]]; then 118 | keys+=("$match[1]:$match[2]") 119 | fi 120 | done 121 | _describe -t key "key" keys && return 0 122 | fi 123 | ;; 124 | export) 125 | arguments+=( 126 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 127 | {-f+,--format+}"[Specify the export file format]:format:(pipfile poetry flit requirements)" 128 | "--without-hashes[Don't include artifact hashes]" 129 | {-o+,--output+}"[Write output to the given file, or print to stdout if not given]:output file:_files" 130 | {-s+,--section+}'[Specify target section to add into]:section:_pdm_sections' 131 | {-d,--dev}"[Include dev dependencies]" 132 | "--no-default[Don't include dependencies from default seciton]" 133 | ) 134 | ;; 135 | import) 136 | arguments+=( 137 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 138 | {-f+,--format+}"[Specify the export file format]:format:(pipfile poetry flit requirements)" 139 | '1:filename:_files' 140 | ) 141 | ;; 142 | info) 143 | arguments+=( 144 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 145 | '--python[Show the interpreter path]' 146 | '--where[Show the project root path]' 147 | '--env[Show PEP 508 environment markers]' 148 | ) 149 | ;; 150 | init|lock) 151 | arguments+=( 152 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 153 | ) 154 | ;; 155 | install) 156 | arguments+=( 157 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 158 | {-s+,--section+}'[Specify target section to add into]:section:_pdm_sections' 159 | {-d,--dev}"[Include dev dependencies]" 160 | "--no-lock[Don't do lock if lockfile is not found or outdated]" 161 | "--no-default[Don't include dependencies from default seciton]" 162 | ) 163 | ;; 164 | list) 165 | arguments+=( 166 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 167 | {-r,--reverse}'[Reverse the dependency graph]' 168 | '--graph[Display a graph of dependencies]' 169 | ) 170 | ;; 171 | remove) 172 | arguments+=( 173 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 174 | {-s+,--section+}'[Specify target section to add into]:section:_pdm_sections' 175 | {-d,--dev}"[Include dev dependencies]" 176 | "--no-sync[Only write pyproject.toml and do not uninstall packages]" 177 | "*:packages:_pdm_packages" 178 | ) 179 | ;; 180 | run) 181 | _arguments -s \ 182 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" \ 183 | {-l,--list}'[Show all available scripts defined in pyproject.toml]' \ 184 | {-s,--site-packages}'[Load site-packages from system interpreter]' \ 185 | '(-)1:command:->command' \ 186 | '*:arguments: _normal ' && return 0 187 | if [[ $state == command ]]; then 188 | _command_names -e 189 | local local_commands=(__pypackages__/3.9/bin/*(N:t)) 190 | _describe "local command" local_commands 191 | return 0 192 | fi 193 | ;; 194 | search) 195 | arguments+=( 196 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 197 | '1:query string:' 198 | ) 199 | ;; 200 | show) 201 | arguments+=( 202 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 203 | '1:package:' 204 | ) 205 | ;; 206 | sync) 207 | arguments+=( 208 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 209 | {-s+,--section+}'[Specify target section to add into]:section:_pdm_sections' 210 | {-d,--dev}"[Include dev dependencies]" 211 | '--dry-run[Only prints actions without actually running them]' 212 | '--clean[Clean unused packages]' 213 | "--no-clean[Don't clean unused packages]" 214 | ) 215 | ;; 216 | update) 217 | arguments+=( 218 | {-g+,--global+}"[Use the global project, accepts an optional path to the project directory]:directory:_files -/" 219 | {-s+,--section+}'[Specify target section to add into]:section:_pdm_sections' 220 | '--save-compatible[Save compatible version specifiers]' 221 | '--save-wildcard[Save wildcard version specifiers]' 222 | '--save-exact[Save exact version specifiers]' 223 | '--update-reuse[Reuse pinned versions already present in lock file if possible]' 224 | '--update-eager[Try to update the packages and their dependencies recursively]' 225 | {-u,--unconstrained}'[Ignore the version constraint of packages]' 226 | {-d,--dev}'[Include dev dependencies]' 227 | "--no-default[Don't include dependencies from default seciton]" 228 | "*:packages:_pdm_packages" 229 | ) 230 | ;; 231 | use) 232 | arguments+=( 233 | {-f,--first}'[Select the first matched interpreter]' 234 | '*:python:_files' 235 | ) 236 | ;; 237 | esac 238 | 239 | _arguments -s $arguments && ret=0 240 | 241 | return ret 242 | } 243 | 244 | _pdm_sections() { 245 | if [[ ! -f pyproject.toml ]]; then 246 | _message "not a pdm project" 247 | return 1 248 | fi 249 | local l mbegin mend match sections=() 250 | while IFS= read -r l; do 251 | if [[ $l == (#b)"["tool.pdm.(*)-dependencies"]" ]]; then 252 | sections+=$match[1] 253 | fi 254 | done (.+)<.*/\1/p')) 279 | done 280 | _store_cache pdm_packages _pdm_packages 281 | fi 282 | } 283 | 284 | _pdm_pip_packages() { 285 | if (( ! $+commands[curl] || ! $+commands[sed] )); then 286 | _message "package name" 287 | return 1 288 | fi 289 | 290 | local update_policy 291 | zstyle ":completion:${curcontext%:}:" use-cache on 292 | zstyle -s ":completion:${curcontext%:}:" cache-policy update_policy 293 | if [[ -z $update_policy ]]; then 294 | zstyle ":completion:${curcontext%:}:" cache-policy _pdm_caching_policy 295 | fi 296 | 297 | local -a _pdm_packages 298 | _pdm_pip_packages_update 299 | compadd -X packages -a _pdm_packages 300 | } 301 | 302 | _pdm "$@" 303 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_pkgconf: -------------------------------------------------------------------------------- 1 | #compdef pkgconf 2 | 3 | # zsh completions for 'pkgconf' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | '--help[this message]' 9 | '--about[print pkgconf version and license to stdout]' 10 | '--version[print supported pkg-config version to stdout]' 11 | '--atleast-pkgconfig-version[check whether or not pkgconf is compatible with a specified pkg-config version]' 12 | '--errors-to-stdout[print all errors on stdout instead of stderr]' 13 | '--print-errors[ensure all errors are printed]' 14 | '--short-errors[be less verbose about some errors]' 15 | '--silence-errors[explicitly be silent about errors]' 16 | '--list-all[list all known packages]' 17 | '--list-package-names[list all known package names]' 18 | '--simulate[simulate walking the calculated dependency graph]' 19 | '--no-cache[do not cache already seen packages when walking the dependency graph]' 20 | '--log-file=[write an audit log to a specified file]' 21 | '--with-path=[adds a directory to the search path]' 22 | '--define-prefix[override the prefix variable with one that is guessed based on the location of the .pc file]' 23 | '--dont-define-prefix[do not override the prefix variable under any circumstances]' 24 | '--prefix-variable=[sets the name of the variable that pkgconf considers to be the package prefix]' 25 | '--relocate=[relocates a path and exits (mostly for testsuite)]' 26 | '--dont-relocate-paths=[disables path relocation support]' 27 | 28 | '--personality=[sets the personality to triplet or a file named filename]' 29 | '--dump-personality[dumps details concerning selected personality]' 30 | 31 | '--atleast-version[require a specific version of a module]' 32 | '--exact-version[require an exact version of a module]' 33 | '--max-version[require a maximum version of a module]' 34 | '--exists[check whether or not a module exists]' 35 | '--uninstalled[check whether or not an uninstalled module will be used]' 36 | '--no-uninstalled[never use uninstalled modules when satisfying dependencies]' 37 | '--no-provides[do not use provides rules to resolve dependencies]' 38 | '--maximum-traverse-depth[maximum allowed depth for dependency graph]' 39 | '--static[be more aggressive when computing dependency graph (for static linking)]' 40 | '--shared[use a simplified dependency graph (usually default)]' 41 | '--pure[optimize a static dependency graph as if it were a normal dependency graph]' 42 | '--env-only[look only for package entries in PKG_CONFIG_PATH]' 43 | '--ignore-conflicts[ignore conflicts rules in modules]' 44 | '--validate[validate specific .pc files for correctness]' 45 | 46 | '--define-variable=[value define variable varname as value]' 47 | '--variable=[print specified variable entry to stdout]' 48 | '--cflags[print required CFLAGS to stdout]' 49 | '--cflags-only-I[print required include-dir CFLAGS to stdout]' 50 | '--cflags-only-other[print required non-include-dir CFLAGS to stdout]' 51 | '--libs[print required linker flags to stdout]' 52 | '--libs-only-L[print required LDPATH linker flags to stdout]' 53 | '--libs-only-l[print required LIBNAME linker flags to stdout]' 54 | '--libs-only-other[print required other linker flags to stdout]' 55 | '--print-requires[print required dependency frameworks to stdout]' 56 | '--print-requires-private[print required dependency frameworks for static linking to stdout]' 57 | '--print-provides[print provided dependencies to stdout]' 58 | '--print-variables[print all known variables in module to stdout]' 59 | '--digraph[print entire dependency graph in graphviz dot format]' 60 | '--keep-system-cflags[keep -I/usr/include entries in cflags output]' 61 | '--keep-system-libs[keep -L/usr/lib entries in libs output]' 62 | '--path[show the exact filenames for any matching .pc files]' 63 | '--modversion[print the specified modules version to stdout]' 64 | '--internal-cflags[do not filter internal cflags from output]' 65 | 66 | '--msvc-syntax[print translatable fragments in MSVC syntax]' 67 | '--fragment-filter=[filter output fragments to the specified types]' 68 | '*:librarys:_pkgconf_librarys' 69 | ) 70 | 71 | _pkgconf_librarys() { 72 | compadd -- ${(z)$(command pkgconf --list-package-names)} 73 | } 74 | 75 | _arguments -s $arguments 76 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_rlwrap: -------------------------------------------------------------------------------- 1 | #compdef rlwrap 2 | 3 | _arguments \ 4 | {-a,--always-readline}'[Always remain in "readline mode", regardless of command'"'"'s terminal settings.]' \ 5 | {-A,--ansi-colour-aware}'[Prompts that use colour will confuse rlwrap, especially at the end of long in…]' \ 6 | {-b,--break-chars}'[Consider the specified characters word-breaking (whitespace is always word-br…]' \ 7 | {-c,--complete-filenames}'[Complete filenames (filename completion is always case-sensitive, even with t…]' \ 8 | {-C,--command-name}'[Use command_name instead of command to determine the names of history and com…]' \ 9 | {-D,--history-no-dupes}'[How aggressively to weed out duplicate entries from the input history.]' \ 10 | {-e,--extra-char-after-completion}'[By default, rlwrap appends a space after any inserted completion text.]' \ 11 | {-f,--file}'[Split file into words (using the default word-breaking characters, or those s…]' \ 12 | {-g,--forget-matching}'[Forget (i. e.]' \ 13 | {-h,--help}'[Print a short help message.]' \ 14 | {-H,--history-filename}'[Read command history from file (and write it back there if --histsize >= 0).]' \ 15 | {-i,--case-insensitive}'[Ignore case when completing (filename completion remains case-sensitive).]' \ 16 | {-I,--pass-sigint-as-sigterm}'[Send a TERM signal to command when an INT is received (e. g.]' \ 17 | {-l,--logfile}'[When in readline mode, append command'"'"'s output (including echo'"'"'ed user input)…]' \ 18 | {-n,--no-warnings}'[Don'"'"'t print warnings.]' \ 19 | {-N,--no-children}'[Don'"'"'t rlwrap command'"'"'s children: whenever rlwrap notices that command is wai…]' \ 20 | {-m,--multi-line}'[Enable multi-line input using a "newline substitute" character sequence (" \\"…]' \ 21 | {-M,--multi-line-ext}'[Call multi-line-editor on temporary files with filename extension .]' \ 22 | {-o,--one-shot}'[Send an EOF to command after accepting the first line of input.]' \ 23 | {-O,--only-cook}'[Only ever "cook" prompts that match regexp.]' \ 24 | {-p,--prompt-colour}'[Use one of the colour names black, red, green, yellow, blue, cyan, purple (=m…]' \ 25 | {-P,--pre-given}'[Start rlwrap with text in its edit buffer (this will automatically set the -…]' \ 26 | {-q,--quote-characters}'[Assume that the given characters act as quotes, e. g.]' \ 27 | {-r,--remember}'[Put all words seen on in- and output on the completion list.]' \ 28 | {-R,--renice}'[Make rlwrap nicer than command (cf nice (1)).]' \ 29 | {-s,--histsize}'[Limit the history list to N entries, truncating the history file (default: 30…]' \ 30 | {-S,--substitute-prompt}'[Substitute the specified prompt for command'"'"'s own prompt.]' \ 31 | {-t,--set-term-name}'[Set command'"'"'s TERM to name.]' \ 32 | {-U,--mirror-arguments}'[(linux only) Keep track of command'"'"'s arguments as seen by the ps (1) command,…]' \ 33 | {-v,--version}'[Print rlwrap version.]' \ 34 | {-w,--wait-before-prompt}'[In order to determine if command'"'"'s last output is a prompt, rlwrap waits tim…]' \ 35 | {-W,--polling}'[EXPERIMENTAL: Wake up every timeout millisecs, where timeout is the same as f…]' \ 36 | '(-)1:command: _command_names -e' \ 37 | '*::arguments: _normal ' 38 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_silicon: -------------------------------------------------------------------------------- 1 | #compdef silicon 2 | 3 | # zsh completions for 'silicon' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | '--from-clipboard[read input from clipboard.]' 9 | {-h,--help}'[prints help information]' 10 | '--list-themes[list all themes.]' 11 | '--no-line-number[hide the line number.]' 12 | '--no-round-corner[dont round the corner]' 13 | '--no-window-controls[hide the window controls.]' 14 | {-c,--to-clipboard}'[]' 15 | {-V,--version}'[prints version information]' 16 | {-b,--background}'[background color of the image \[default: #aaaaff\]]' 17 | {-f,--font}'[the font list. eg. Hack; SimSun=31]' 18 | '--highlight-lines[lines to high light. rg. 1-3; 4]' 19 | {-l,--language}'[the language for syntax highlighting. You can use full name ("Rust")]' 20 | '--line-pad[pad between lines \[default: 2\]]' 21 | {-o,--output}'[write output image to specific location instead of cwd.]' 22 | '--pad-horiz[pad horiz \[default: 80\]]' 23 | '--pad-vert[pad vert \[default: 100\]]' 24 | '--shadow-blur-radius[blur radius of the shadow. (set it to 0 to hide shadow) \[default: 0\]]' 25 | '--shadow-color[color of shadow \[default: #555555\]]' 26 | '--shadow-offset-x[shadows offset in X axis \[default: 0\]]' 27 | '--shadow-offset-y[shadows offset in Y axis \[default: 0\]]' 28 | '--tab-width[tab width \[default: 4\]]' 29 | '--theme[the syntax highlight theme. It can be a theme name or path to a]' 30 | '*:filename:_files' 31 | ) 32 | 33 | _arguments -s $arguments 34 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_sk: -------------------------------------------------------------------------------- 1 | #compdef sk 2 | 3 | _sk() { 4 | _arguments \ 5 | '*:file:_files' \ 6 | {-e,--exact}'[Enable exact-match.]' \ 7 | '--regex[Search with regular expression instead of fuzzy match.]' \ 8 | '--algo=[Fuzzy matching algorithm (default: skim_v2) .]:algo:(skim_v1 skim_v1 clangd)' \ 9 | '--case=[To ignore case on matching or not. (default smart) .]:case:(smart respect ignore)' \ 10 | {-n+,--nth=}'[Comma-separated list of field index expressions for limiting search scope.]' \ 11 | '--with-nth=[Transform the presentation of each line using field index expressions.]' \ 12 | {-d+,--delimiter=}'[Field delimiter regex for --nth and --with-nth (default: AWK-style) .]' \ 13 | '--tac[Reverse the order of the input . RS e. g. history | sk --tac . RE.]' \ 14 | '--tiebreak=[Comma-separated list of sort criteria to apply when the scores are tied. br .]: :_sk_tiebreak' \ 15 | {-i,--interactive}'[Start the finder in the command query.]' \ 16 | {-c,--cmd}'[Specify the command to invoke for fetching options.]' \ 17 | '-I[Replace replstr with the selected item.]' \ 18 | {-m,--multi}'[Enable multi-select with tab/shift-tab.]' \ 19 | '--no-multi[Disable multi-select.]' \ 20 | '--bind=[Comma-separated list of custom key bindings.]' \ 21 | '--no-hscroll[Disable horizontal scroll.]' \ 22 | '--height=[Display sk window below the cursor with the given height instead of using the…]' \ 23 | '--min-height=[Minimum height when --height is given in percent (default: 10).]' \ 24 | '--layout=[Choose the layout (default: default) .]:layout:(default reverse reverse-list)' \ 25 | '--reverse[A synonym for --layout=reverse.]' \ 26 | '--margin=[Comma-separated expression for margins around the finder. br . br .]' \ 27 | '--inline-info[Display finder info inline with the query.]' \ 28 | {-p+,--prompt=}'[Input prompt (default: '"'"'> '"'"').]' \ 29 | '--cmd-prompt=[Command prompt (default: '"'"'c> '"'"').]' \ 30 | '--header=[The given string will be printed as the sticky header.]' \ 31 | '--header-lines=[The first N lines of the input are treated as the sticky header.]' \ 32 | '--ansi[Enable processing of ANSI color codes.]' \ 33 | '--tabstop=[Number of spaces for a tab character (default: 8).]' \ 34 | '--color=[Color configuration.]' \ 35 | '--history=[Load search history from the specified file and update the file on completion.]' \ 36 | '--history-size=[Maximum number of entries in the history file (default: 1000).]' \ 37 | '--cmd-history=[Load command query history from the specified file and update the file on com…]: :_file' \ 38 | '--cmd-history-size=[Maximum number of command query entries in the history file (default: 1000).]' \ 39 | '--preview=[Execute the given command for the current line and display the result on the …]' \ 40 | '--preview-window=[Determine the layout of the preview window.]' \ 41 | {-q+,--query=}'[Start the finder with the given query.]' \ 42 | '--cmd-query=[Specify the initial query for the command query.]' \ 43 | '--print-query[Print query as the first line.]' \ 44 | {-f+,--filter=}'[Filter mode. Do not start interactive finder.]' \ 45 | '--expect=[Comma-separated list of keys that can be used to complete sk in addition to t…]' \ 46 | '--read0[Read input delimited by ASCII NUL characters instead of newline characters.]' \ 47 | '--print0[Print output delimited by ASCII NUL characters instead of newline characters.]' \ 48 | '--version[Display version information and exit.]' 49 | } 50 | 51 | _sk_tiebreak() { 52 | _values -s , tiebreak \ 53 | 'score[Prefers line with shorter length]' \ 54 | 'index[Prefers line with matched substring closer to the beginning]' \ 55 | 'begin[Prefers line that appeared earlier in the input stream]' \ 56 | 'end[Prefers line with matched substring closer to the end]' 57 | } 58 | 59 | _sk "$@" 60 | -------------------------------------------------------------------------------- /zsh/.config/zsh/completions/_tokei: -------------------------------------------------------------------------------- 1 | #compdef tokei 2 | 3 | # zsh completions for 'tokei' 4 | # automatically generated with http://github.com/RobSis/zsh-completion-generator 5 | local arguments 6 | 7 | arguments=( 8 | {-f,--files}'[will print out statistics on individual files.]' 9 | {-h,--help}'[prints help information]' 10 | '--hidden[count hidden files.]' 11 | {-l,--languages}'[prints out supported languages and their extensions.]' 12 | '--no-ignore[dont respect ignore files.]' 13 | '--no-ignore-parent[dont respect ignore files in parent directories.]' 14 | '--no-ignore-vcs[dont respect VCS (.gitignore, .hgignore, etc) ignore files.]' 15 | {-V,--version}'[prints version information]' 16 | {-v,--verbose}'[set log output level:]' 17 | {-c,--columns}'[sets a strict column width of the output, only available for terminal output.]' 18 | {-e,--exclude}'[... Ignore all files & directories matching the pattern.]' 19 | {-i,--input}'[gives statistics from a previous tokei run. Can be given a file path, or "stdin" to]' 20 | {-o,--output}'[outputs Tokei in a specific format. Compile with additional features for more format]' 21 | {-s,--sort}'[sort languages based on column \[possible values: files, lines, blanks, code, comments\]]' 22 | {-t,--type}'[filters output by language type, seperated by a comma. i.e. -t=Rust,Markdown]' 23 | '*:filename:_files' 24 | ) 25 | 26 | _arguments -s $arguments 27 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/bracketed-paste-win-path: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | # usage: 3 | # autoload -Uz bracketed-paste-win-path 4 | # zle -N bracketed-paste bracketed-paste-win-path 5 | 6 | local content 7 | 8 | zle .$WIDGET -N content 9 | 10 | if [[ $content =~ '^([A-Z]:\\)?[^/\\*?<>|"]+(\\[^/\\*?<>|"]+)*\\?$' ]]; then 11 | LBUFFER+=${content//\\/\/} 12 | fi 13 | 14 | YANK_START=$start 15 | YANK_END=$#LBUFFER 16 | zle -f yank 17 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/colors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | from functools import partial 4 | 5 | def colors16(): 6 | for bold in [0, 1]: 7 | for i in range(30, 38): 8 | for j in range(40, 48): 9 | print(f'\x1b[{bold};{i};{j}m {bold};{i};{j} |\x1b[0m', end='') 10 | print() 11 | print() 12 | 13 | for bold in [0, 1]: 14 | for i in range(90, 98): 15 | for j in range(100, 108): 16 | print(f'\x1b[{bold};{i};{j}m {bold};{i};{j} |\x1b[0m', end='') 17 | print() 18 | print() 19 | 20 | def color1(c, n=0): 21 | print(f'\x1b[{n};38;5;{c}m{c:4}\x1b[0m', end='') 22 | 23 | def color1_sep(c): 24 | if (c - 15) % 18 == 0: 25 | print() 26 | 27 | def color2(c): 28 | print(f'\x1b[48;5;{c}m \x1b[0m', end='') 29 | 30 | def color2_sep(c): 31 | if (c - 15) % 36 == 0: 32 | print() 33 | elif (c - 15) % 6 == 0: 34 | print(' ', end='') 35 | 36 | def colors256(color, sepfunc): 37 | for i in range(0, 8): 38 | color(i) 39 | print() 40 | for i in range(8, 16): 41 | color(i) 42 | print('\n') 43 | 44 | for i in range(16, 232): 45 | color(i) 46 | sepfunc(i) 47 | print() 48 | 49 | for i in range(232, 256): 50 | color(i) 51 | print('\n') 52 | 53 | def colors_gradient(): 54 | s= '/\\' * 40 55 | for col in range(0, 77): 56 | r = 255 - col * 255 // 76 57 | g = col * 510 // 76 58 | b = col * 255 // 76 59 | if g > 255: 60 | g = 510 - g 61 | print(f'\x1b[48;2;{r};{g};{b}m\x1b[38;2;{255-r};{255-g};{255-b}m{s[col]}\x1b[0m', end='') 62 | print() 63 | 64 | def other_attributes(): 65 | for i in range(0, 10): 66 | print(f' \x1b[{i}mSGR {i:2}\x1b[m', end=' ') 67 | print(f' \x1b[53mSGR {53:2}\x1b[m', end=' ') 68 | print('\n') 69 | # https://askubuntu.com/a/985386/235132 70 | for i in range(1, 4): 71 | print(f' \x1b[4:{i}mSGR 4:{i}\x1b[m', end=' ') 72 | print(' \x1b[21mSGR 21\x1b[m', end=' ') 73 | 74 | print(' \x1b[4:3m\x1b[58;2;135;0;255mtruecolor underline\x1b[59m\x1b[4:0m', end=' ') 75 | print(' \x1b]8;;https://askubuntu.com/a/985386/235132\x1b\\hyperlink\x1b]8;;\x1b\\') 76 | 77 | if __name__ == '__main__': 78 | print('basic 16 colors, foreground & background:\n') 79 | colors16() 80 | 81 | print('256 colors:\n') 82 | colors256(color1, color1_sep) 83 | 84 | print('256 colors, bold:\n') 85 | colors256(partial(color1, n=1), color1_sep) 86 | 87 | print('256 colors, dim:\n') 88 | colors256(partial(color1, n=2), color1_sep) 89 | 90 | print('256 colors, bold dim:\n') 91 | colors256(partial(color1, n='1;2'), color1_sep) 92 | 93 | print('256 colors, solid background:\n') 94 | colors256(color2, color2_sep) 95 | 96 | print('true colors gradient:\n') 97 | colors_gradient() 98 | 99 | print('other attributes:\n') 100 | other_attributes() 101 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/colors.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/zsh 2 | 3 | colors16() { 4 | for bold in {0..1}; do 5 | for i in {30..38}; do 6 | for j in {40..48}; do 7 | print -n "\x1b[$bold;$i;${j}m $bold;$i;$j |\x1b[0m" 8 | done 9 | print 10 | done 11 | print 12 | done 13 | 14 | for bold in {0..1}; do 15 | 16 | done 17 | } 18 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/ebindkey: -------------------------------------------------------------------------------- 1 | # DESC: Emacs 风格语法的 bindkey 2 | # C-v + 按键 以查看特殊按键的转义序列 3 | zmodload zsh/zutil 4 | 5 | local -a remove keymap array 6 | 7 | zparseopts -D r=remove M:=keymap A:=array 8 | 9 | function escape-single-key() { 10 | local -A name=( 11 | up kcuu1 down kcud1 left kcub1 right kcuf1 12 | home khome end kend delete kdch1 13 | ) 14 | 15 | if (( $#1 == 1 )) { 16 | ret=$1 17 | } elif [[ ${(L)1} == "backspace" ]] { 18 | ret="^?" 19 | } elif [[ ${(L)1} == "space" ]] { 20 | ret=" " 21 | } elif (( $+name[${(L)1}] )) { 22 | ret="$terminfo[$name[${(L)1}]]" 23 | } else { 24 | print -P "%F{red}%BERROR: $1%b%F" >&2 25 | } 26 | } 27 | 28 | function escape-mod-key() { 29 | local mod=${(U)1[(ws:-:)1]} key=${(L)1[(ws:-:)2]} 30 | local -A modifier spkeys 31 | 32 | [[ $key == space ]] && key=" " 33 | 34 | if [[ $key == "backspace" ]] { 35 | modifier=("C" "^h" "M" "^[^?") 36 | ret="$modifier[$mod]" 37 | } elif (( $#key == 1 )) { 38 | modifier=(C "^" M "^[") 39 | ret="$modifier[$mod]${1[(ws:-:)2]}" 40 | } else { 41 | spkeys=(up A down B right C left D end F home H) 42 | modifier=("C" "^[[1;5" "M" "^[[1;3") 43 | ret="$modifier[$mod]$spkeys[$key]" 44 | } 45 | } 46 | 47 | function bind() { 48 | local escaped ret 49 | local -a sequence=(${(s: :)1}) 50 | 51 | for i ($sequence) { 52 | if [[ $i == *-* ]] { 53 | escape-mod-key $i 54 | } else { 55 | escape-single-key $i 56 | } 57 | escaped+=$ret 58 | } 59 | 60 | bindkey $remove $keymap $escaped $2 61 | } 62 | 63 | if [[ $array ]]; then 64 | local k v 65 | for k v in ${(Pkv)${array[2]}}; do 66 | bind $k $v 67 | done 68 | else 69 | bind $1 $2 70 | fi 71 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/explain_permission: -------------------------------------------------------------------------------- 1 | local -a permission=(${(s::)${_PMS:-"rwxrwxrwx"}}) 2 | local -a binary=() 3 | 4 | for i in ${(s::)1}; do 5 | binary+=(${(s::)${(l:3::0:)${"$(( [#2]i ))":2}}}) 6 | done 7 | 8 | for i j in ${permission:^binary}; do 9 | if (( $j )); then 10 | echo -n $i 11 | else 12 | echo -n _ 13 | fi 14 | done 15 | 16 | echo 17 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/hhsh: -------------------------------------------------------------------------------- 1 | local API=https://lab.magiconch.com/api/nbnhhsh/guess 2 | curl -s $API -d "text='$1'" | jq --raw-output '.[].trans | .[]' 3 | 4 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/man: -------------------------------------------------------------------------------- 1 | # See https://unix.stackexchange.com/questions/119/colors-in-man-pages 2 | 3 | export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green 4 | export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan 5 | export LESS_TERMCAP_me=$(tput sgr0) 6 | export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) # yellow on blue 7 | export LESS_TERMCAP_se=$(tput rmso; tput sgr0) 8 | export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white 9 | export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) 10 | export LESS_TERMCAP_mr=$(tput rev) 11 | export LESS_TERMCAP_mh=$(tput dim) 12 | export LESS_TERMCAP_ZN=$(tput ssubm) 13 | export LESS_TERMCAP_ZV=$(tput rsubm) 14 | export LESS_TERMCAP_ZO=$(tput ssupm) 15 | export LESS_TERMCAP_ZW=$(tput rsupm) 16 | 17 | unfunction man 18 | 19 | man $@ 20 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/oomscore: -------------------------------------------------------------------------------- 1 | for proc in /proc/<0-9>#; do 2 | printf "%2d %5d %s\n" \ 3 | $(<$proc/oom_score) \ 4 | ${proc:t} \ 5 | ${"$(<$proc/cmdline)"[1,80]} 6 | done | sort -nr | head -n 15 7 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/palette: -------------------------------------------------------------------------------- 1 | # DESC: 输出调色板, 可以额外指定背景色或加粗(-b) 2 | 3 | local -a colors 4 | local bold bg="%K{000}" 5 | 6 | for i ($@) { 7 | [[ $i == -b ]] && bold=%B 8 | [[ $i == <-> ]] && bg="%K{$i}" 9 | } 10 | 11 | for i ({000..255}) { 12 | colors+=("$bold$bg%F{$i}$i%f%k${(L)bold}") 13 | } 14 | 15 | print -cP $colors 16 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/pb: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | 3 | PB_HOST="https://fars.ee" 4 | 5 | pb() { 6 | emulate -L zsh 7 | case $1 in 8 | --rec) 9 | asciinema rec /tmp/$$.json 10 | local url=$(pb_core < /tmp/$$.json) 11 | print "${${url%/json}/.ee/.ee/t}" 12 | ;; 13 | --tmux) 14 | tmux capture-pane -J -p | pb_core 15 | ;; 16 | --delete) 17 | if [[ ! -f ~/.cache/pb/$2 ]]; then 18 | print "$2 doesn't exists!" 19 | return 1 20 | fi 21 | local -A info=(${(@s/: /)${${(f)"$(<~/.cache/pb/$2)"}//$'\n'/: }}) 22 | local uuid=$info[uuid] 23 | curl -X DELETE "$PB_HOST/$uuid" 24 | ;; 25 | *) 26 | pb_core ${*:1} 27 | ;; 28 | esac 29 | } 30 | 31 | pb_core() { 32 | local file==(<<<'') 33 | 34 | if (( $# == 0 )); then 35 | cat > $file 36 | else 37 | file=$1 38 | fi 39 | 40 | local res=${(f)"$(curl -F "c=@-" "$PB_HOST" < $file)"} 41 | local -A info=(${(s/: /)${res//$'\n'/: }}) 42 | local url=$info[url] 43 | 44 | [[ -d ~/.cache/pb ]] || mkdir ~/.cache/pb 45 | print $res > ~/.cache/pb/$info[short] 46 | 47 | local mime=$(file --mime-type -b $file) 48 | case $mime in 49 | image/*) 50 | local type=${${file:e}:-${mime#*/}} 51 | print "$url.$type" ;; 52 | text/x-*) 53 | local lang=${${file:e}:-${mime#*-}} 54 | print "$url/$lang" ;; 55 | application/json) 56 | print "$url/json" ;; 57 | *) print "$url${(M)${file:t}%.*}" ;; 58 | esac 59 | 60 | (( $# == 0 )) && rm $file 61 | } 62 | 63 | pb $* 64 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/printc: -------------------------------------------------------------------------------- 1 | # DESC: 输出指定颜色的 ANSi 转义序列, -b 表示加粗 2 | 3 | echo -E ${(qqqq)${(%)1}} 4 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/pslist: -------------------------------------------------------------------------------- 1 | # DESC: Lists ~/.config/zsh/functions/* with their embedded descriptions 2 | # from https://github.com/zdharma/zplugin-configs/tree/master/psprint/functions 3 | 4 | setopt localoptions extendedglob 5 | 6 | local -a pfxs lines desc files 7 | pfxs=( ps t1 f1 g1 n1 x1 ) # grouped commands 8 | pfxs+=( "*~$HOME/.config/zsh/functions/(${(j:|:)pfxs}|lps)" ) # ungrouped commands 9 | pfxs+=( lps ) # local, uncommited commands 10 | 11 | integer pass longest=0 longest2=0 12 | local p file header="# DESC: " 13 | 14 | for (( pass = 1; pass <= 2; ++ pass )); do 15 | for p in "${pfxs[@]}"; do 16 | files=( $HOME/.config/zsh/functions/${~p}*(N) ) 17 | 18 | if (( pass == 2 )); then 19 | if (( ${#files[@]} )); then 20 | if [[ "$p" = "lps" ]]; then 21 | print -r -- ${(l:(longest+longest2)/2-4::-:):-} LOCAL ${(l:longest+longest2-(longest+longest2)/2-3::-:):-} 22 | else 23 | print -r -- ${(l:longest+longest2::-:):-} 24 | fi 25 | fi 26 | fi 27 | 28 | for file in "${files[@]}"; do 29 | lines=( ${(f)"$(<$file)"} ) 30 | desc=( "${(M)lines[@]:#${header}*}" ) 31 | desc[1]="${desc[1]#$header}" 32 | file="${file:t}" 33 | [[ "$file" = (LICENSE|README.md) ]] && continue 34 | if (( pass == 1 )); then 35 | (( longest < ${#file} + 3 )) && longest=$(( ${#file} + 3 )) 36 | (( longest2 < ${#desc[1]} )) && longest2=$(( ${#desc[1]} )) 37 | else 38 | echo "${file}${(l:longest-${#file}:: :):- }${desc[1]}" 39 | fi 40 | done 41 | done 42 | if (( pass == 2 )); then 43 | print -r -- ${(l:longest+longest2::-:):-} 44 | fi 45 | done 46 | 47 | # vim:ft=zsh:et 48 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/rgdata: -------------------------------------------------------------------------------- 1 | # DESC: 在 CDDA 数据中搜索指定字符串($1) 2 | 3 | str=$1 4 | shift 5 | rg "$str" ~/Coding/C++/Cataclysm-DDA/data -I -N "$@" | bat --language=json 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/rgdoc: -------------------------------------------------------------------------------- 1 | # DESC: 在 CDDA 文档中搜索指定字符串($1) 2 | 3 | str=$1 4 | shift 5 | rg "$str" ~/Coding/C++/Cataclysm-DDA/doc -I -N "$@" | mdcat 6 | 7 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/rgsrc: -------------------------------------------------------------------------------- 1 | # DESC: 在 CDDA 源码中搜索指定字符串($1) 2 | 3 | str=$1 4 | shift 5 | rg "$str" ~/Coding/C++/Cataclysm-DDA/src -I -N "$@" | bat --language=C++ 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/rgzh: -------------------------------------------------------------------------------- 1 | # DESC: 在 CDDA 翻译中搜索指定字符串($1) 2 | 3 | str=$1 4 | shift 5 | rg "$str" ~/Coding/C++/Cataclysm-DDA/lang/po/zh_CN.po "$@" 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/functions/zman: -------------------------------------------------------------------------------- 1 | # DESC: Searches ${2:-zshall} with special keyword ($1) matching 2 | # from https://github.com/zdharma/zplugin-configs/tree/master/psprint/functions 3 | 4 | PAGER="less -g -s '+/^ "$1"'" man ${2:-zshall} 5 | 6 | # vim:ft=zsh:et 7 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/alias-tips/_altp_check: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | 3 | local result reply i 4 | 5 | # init once 6 | (( $#_altp_aliases != 0 )) || _altp_init 7 | 8 | [[ -n $2 ]] || return 9 | 10 | # find longest aviable alias 11 | local -a alias 12 | for i in ${_altp_aliases[(K)$2]}; do 13 | _altp_expand ${(z)aliases[$i]} 14 | if (( $#alias == 0 || $#reply > $#alias[2] )); then 15 | alias=($i $reply) 16 | fi 17 | done 18 | 19 | (( $#alias != 0 )) || return 20 | 21 | result=${3/$alias[2]/$alias[1]} 22 | 23 | # strip whitespace and detect whether this alias will make command shorter 24 | if (( ${#${1/# #}/% #} > $#result )) { 25 | ALIAS_TIPS_BUFFER=$result 26 | } 27 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/alias-tips/_altp_expand: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | # DESC: expand alias 3 | # _altp_expand gcmsg "abc" => reply=git commit -m "abc" 4 | 5 | local command=$1 6 | local -a result=($@) used tmp 7 | 8 | while (( $+aliases[$command] )) { 9 | tmp=(${(z)aliases[$command]}) 10 | # avoid infinite loop 11 | (( $used[(I)$tmp[1]] != 0 )) && break 12 | result[1]=($tmp) 13 | command=$result[1] 14 | used+=($command) 15 | } 16 | 17 | typeset -g reply="$result" 18 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/alias-tips/_altp_init: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | 3 | typeset -g -A _altp_aliases 4 | 5 | local k v reply 6 | 7 | for k v (${(kv)aliases}) { 8 | _altp_expand ${(z)v} 9 | # `alias gru=git reset --` shouldn't match `git reset --soft` 10 | _altp_aliases[${reply}( *|)]=$k 11 | } 12 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/alias-tips/_altp_show_tips: -------------------------------------------------------------------------------- 1 | #!hint/zsh 2 | if [[ -n $ALIAS_TIPS_BUFFER ]] { 3 | print -P "%B%F{yellow}Tips: you can use %f%K{011}%F{016}\$ALIAS_TIPS_BUFFER%f%k%b" 4 | } 5 | ALIAS_TIPS_BUFFER= 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/alias-tips/alias-tips.plugin.zsh: -------------------------------------------------------------------------------- 1 | 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 2 | 0="${${(M)0:#/*}:-$PWD/$0}" 3 | 4 | autoload -Uz ${0:h}/_altp_* 5 | autoload -Uz add-zsh-hook 6 | 7 | add-zsh-hook preexec _altp_check 8 | add-zsh-hook precmd _altp_show_tips 9 | 10 | typeset -g ALIAS_TIPS_BUFFER 11 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/atuin/atuin.plugin.zsh: -------------------------------------------------------------------------------- 1 | # shellcheck disable=SC2034,SC2153,SC2086,SC2155 2 | 3 | # Above line is because shellcheck doesn't support zsh, per 4 | # https://github.com/koalaman/shellcheck/wiki/SC1071, and the ignore: param in 5 | # ludeeus/action-shellcheck only supports _directories_, not _files_. So 6 | # instead, we manually add any error the shellcheck step finds in the file to 7 | # the above line ... 8 | 9 | # Source this in your ~/.zshrc 10 | autoload -U add-zsh-hook 11 | 12 | zmodload zsh/datetime 2>/dev/null 13 | 14 | typeset -g _autin_histdb 15 | 16 | _atuin_histdb_init() { 17 | if (( $+_autin_histdb )); then 18 | zsqlite_open -r _autin_histdb ~/.local/share/atuin/history.db 19 | fi 20 | } 21 | 22 | # If zsh-autosuggestions is installed, configure it to use Atuin's search. If 23 | # you'd like to override this, then add your config after the $(atuin init zsh) 24 | # in your .zshrc 25 | _zsh_autosuggest_strategy_atuin() { 26 | emulate -L zsh 27 | _atuin_histdb_init 28 | local reply=$(zsqlite_exec _autin_histdb " 29 | SELECT command FROM ( 30 | SELECT h1.* 31 | FROM history h1, history h2 32 | WHERE h1.ROWID = h2.ROWID + 1 33 | AND h1.session = h2.session 34 | AND h2.exit = 0 35 | AND h1.command LIKE ?1 36 | AND h2.command = ?2 37 | AND h1.cwd = ?3 38 | ORDER BY timestamp DESC 39 | LIMIT 1 40 | ) 41 | UNION ALL 42 | SELECT command FROM ( 43 | SELECT * FROM history WHERE cwd = ?3 AND command LIKE ?1 ORDER BY timestamp DESC LIMIT 1 44 | ) 45 | UNION ALL 46 | SELECT command FROM ( 47 | SELECT * FROM history WHERE command LIKE ?1 ORDER BY timestamp DESC LIMIT 1 48 | ) 49 | LIMIT 1 50 | " ${1}% ${history[$((HISTCMD-1))]} $PWD ) 51 | typeset -g suggestion=$reply 52 | } 53 | 54 | if [ -n "${ZSH_AUTOSUGGEST_STRATEGY:-}" ]; then 55 | ZSH_AUTOSUGGEST_STRATEGY=("atuin" "${ZSH_AUTOSUGGEST_STRATEGY[@]}") 56 | else 57 | ZSH_AUTOSUGGEST_STRATEGY=("atuin") 58 | fi 59 | 60 | export ATUIN_SESSION=$(atuin uuid) 61 | ATUIN_HISTORY_ID="" 62 | 63 | _atuin_preexec() { 64 | local id 65 | id=$(atuin history start -- "$1") 66 | export ATUIN_HISTORY_ID="$id" 67 | __atuin_preexec_time=${EPOCHREALTIME-} 68 | } 69 | 70 | _atuin_precmd() { 71 | local EXIT="$?" __atuin_precmd_time=${EPOCHREALTIME-} 72 | 73 | [[ -z "${ATUIN_HISTORY_ID:-}" ]] && return 74 | 75 | local duration="" 76 | if [[ -n $__atuin_preexec_time && -n $__atuin_precmd_time ]]; then 77 | printf -v duration %.0f $(((__atuin_precmd_time - __atuin_preexec_time) * 1000000000)) 78 | fi 79 | 80 | (ATUIN_LOG=error atuin history end --exit $EXIT ${duration:+--duration=$duration} -- $ATUIN_HISTORY_ID &) >/dev/null 2>&1 81 | export ATUIN_HISTORY_ID="" 82 | } 83 | 84 | _atuin_search() { 85 | emulate -L zsh 86 | 87 | _atuin_histdb_init 88 | 89 | local query=" 90 | SELECT DISTINCT command 91 | FROM history 92 | WHERE command LIKE ? 93 | ORDER BY cwd = ? DESC, timestamp DESC 94 | " 95 | 96 | local output=$(zsqlite_exec -q _autin_histdb $query ${LBUFFER}% $PWD | ftb-tmux-popup --tiebreak=index --prompt="cmd> " ${LBUFFER:+-q$LBUFFER}) 97 | 98 | if [[ $output != "" ]]; then 99 | BUFFER=$(echo $output) 100 | CURSOR=$#BUFFER 101 | fi 102 | } 103 | 104 | 105 | add-zsh-hook preexec _atuin_preexec 106 | add-zsh-hook precmd _atuin_precmd 107 | 108 | zle -N atuin-search _atuin_search 109 | 110 | # These are compatibility widget names for "atuin <= 17.2.1" users. 111 | zle -N _atuin_search_widget _atuin_search 112 | 113 | bindkey -M emacs '^r' atuin-search 114 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/zb/_zb: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | compadd -- ${(s:/:)PWD} 3 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/zb/zb: -------------------------------------------------------------------------------- 1 | #!/hint/zsh 2 | local -a pwd=("${(@s:/:)PWD}") 3 | local dir 4 | 5 | for i in $pwd; do 6 | dir+=/$i 7 | if [[ ${(SM)i#$1} ]]; then 8 | cd $dir 9 | return 10 | fi 11 | done 12 | -------------------------------------------------------------------------------- /zsh/.config/zsh/plugins/zb/zb.plugin.zsh: -------------------------------------------------------------------------------- 1 | 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 2 | 0="${${(M)0:#/*}:-$PWD/$0}"y 3 | 4 | autoload -Uz ${0:h}/{zb,_zb} 5 | compdef _zb zb 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/snippets/alias.zsh: -------------------------------------------------------------------------------- 1 | # global alias 2 | alias -g H='| head ' T='| tail ' L='| less ' R='| rgc ' 3 | alias -g S='| sort ' U='| uniq ' 4 | alias -g N='>/dev/null ' 5 | # https://roylez.info/2010-03-06-zsh-recent-file-alias/ 6 | alias -g NN="*(oc[1])" NNF="*(oc[1].)" NND="*(oc[1]/)" 7 | 8 | # 文件系统相关 9 | alias rd='rm -rd' md='mkdir -p' 10 | alias rm='rm -i --one-file-system' 11 | alias ls='eza -bh' la='ls -la' lt='ls --tree' ll='ls -l' l='ls' 12 | alias dfh='df -h' dus='du -sh' del='gio trash' dusa='dus --apparent-size' 13 | alias cp='cp --reflink=auto' 14 | alias bdu='btrfs fi du' bdus='bdu -s' 15 | 16 | # gdb 17 | alias gdb-peda='command gdb -q -ex init-peda' 18 | alias gdb-pwndbg='command gdb -q -ex init-pwndbg' 19 | alias gdb-gef='command gdb -q -ex init-gef' 20 | alias gdb=gdb-pwndbg 21 | 22 | # pacman 23 | alias S='sudo pacman -S' Syu='sudo pacman -Syu' Rcs='sudo pacman -Rcs' 24 | alias Si='pacman -Si' Sl='pacman -Sl' Ss='noglob pacman -Ss' 25 | alias Qi='pacman -Qi' Ql='pacman -Ql' Qs='noglob pacman -Qs' 26 | alias Qm='pacman -Qm' Qo='pacman -Qo' 27 | alias Fl='pacman -Fl' F='pacman -F' Fx='pacman -Fx' 28 | alias Fy='sudo pacman -Fy' 29 | alias U='sudo pacman -U' 30 | alias pikaur='p pikaur' 31 | 32 | # git 33 | # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ 34 | alias gclt='git clone --filter=tree:0' 35 | alias gclb='git clone --filter=blob:none' 36 | alias gcld='git clone --depth=1' 37 | 38 | function Qlt() { 39 | pacman -Ql $1 | cut -d' ' -f2 | tree --fromfile=. 40 | } 41 | 42 | function compsize-package { 43 | sudo compsize $(pacman -Ql $1 | cut -d' ' -f2 | grep -v '/$') 44 | } 45 | 46 | function _pacman_packages { 47 | (( $+functions[_pacman_completions_installed_packages] )) || { 48 | _pacman 2>/dev/null 49 | } 50 | _pacman_completions_installed_packages 51 | } 52 | 53 | compdef _pacman_packages Qlt compsize-package 54 | 55 | alias zmv='noglob zmv' 56 | alias zcp='zmv -C' 57 | alias zln='zmv -L' 58 | 59 | function pp() { 60 | # aria2 只吃 http[s]_proxy 并且只支持 http 61 | env HTTP_PROXY="http://127.0.0.1:8877" \ 62 | HTTPS_PROXY="http://127.0.0.1:8877" \ 63 | http_proxy="http://127.0.0.1:8877" \ 64 | https_proxy="http://127.0.0.1:8877" $* 65 | } 66 | 67 | # wrapper 68 | alias rlwrap="rlwrap " 69 | alias sudo='sudo ' 70 | 71 | # 乱七八糟的 72 | alias http=xh 73 | alias h="tldr" 74 | alias checksec="pwn checksec" 75 | alias amd="env DRI_PRIME=1" 76 | alias trid="LC_ALL=C trid" 77 | alias wtf='wtf -f ~/.local/share/wtf/acronyms' 78 | alias rgc='rg --color=always' 79 | alias less='less -r' 80 | alias history='fc -l 1' 81 | alias open='xdg-open' 82 | 83 | function dsf() { 84 | diff -u $@ | delta 85 | } 86 | -------------------------------------------------------------------------------- /zsh/.config/zsh/snippets/completion.zsh: -------------------------------------------------------------------------------- 1 | # 参考资料: 2 | # http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control 3 | # http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System 4 | 5 | # TODO: complete-with-dot 6 | # https://github.com/romkatv/dotfiles-public/commit/50647477461db9ed767d134884527217943a5587 7 | # https://www.zsh.org/mla/users/2007/msg00465.html 8 | 9 | # 可以 hook zstyle 来查看究竟请求了哪些玩意儿 10 | # 更好的方法是 C-x h 11 | 12 | # 禁用旧补全系统 13 | zstyle ':completion:*' use-compctl false 14 | 15 | compctl() { 16 | print -P "\n%F{red}Don't use compctl anymore%f" 17 | } 18 | 19 | # 缓存补全结果 20 | zstyle ':completion:*:complete:*' use-cache true 21 | zstyle ':completion:*:complete:*' cache-policy _aloxaf_caching_policy 22 | _aloxaf_caching_policy() { 23 | # 缓存策略:若不存在或 14 天以前则认定为失效 24 | [[ ! -f $1 && -n "$1"(Nm+14) ]] 25 | } 26 | 27 | # 补全顺序: 28 | # _complete - 普通补全函数 _extensions - 通过 *.\t 选择扩展名 29 | # _match - 和 _complete 类似但允许使用通配符 30 | # _expand_alias - 展开别名 _ignored - 被 ignored-patterns 忽略掉的 31 | # zstyle ':completion:*' completer _expand_alias _complete _extensions _match _files 32 | # 由于某些 completer 调用的代价比较昂贵,第一次调用时不考虑它们 33 | zstyle -e ':completion:*' completer ' 34 | if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]]; then 35 | _last_try="$HISTNO$BUFFER$CURSOR" 36 | reply=(_expand_alias _complete _extensions _match _files) 37 | else 38 | reply=(_complete _ignored _correct) 39 | fi' 40 | 41 | # 增强版文件名补全 42 | # 0 - 完全匹配 ( Abc -> Abc ) 1 - 大写修正 ( abc -> Abc ) 43 | # 2 - 单词补全 ( f-b -> foo-bar ) 3 - 后缀补全 ( .cxx -> foo.cxx ) 44 | zstyle ':completion:*:(argument-rest|files):*' matcher-list '' \ 45 | 'm:{[:lower:]-}={[:upper:]_}' \ 46 | 'r:|[.,_-]=* r:|=*' \ 47 | 'r:|.=* r:|=*' 48 | # zstyle ':completion:*' matcher-list 'b:=*' 49 | 50 | # 不展开普通别名 51 | zstyle ':completion:*' regular false 52 | 53 | # 结果样式 54 | zstyle ':completion:*' menu no 55 | zstyle ':completion:*' list-separator '' 56 | zstyle ':completion:*' group-name '' 57 | zstyle ':completion:*' verbose yes 58 | zstyle ':completion:*:matches' group 'yes' 59 | zstyle ':completion:*:warnings' format '%F{red}%B-- No match for: %d --%b%f' 60 | zstyle ':completion:*:messages' format '%d' 61 | zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' 62 | zstyle ':completion:*:descriptions' format '[%d]' 63 | 64 | # 补全当前用户所有进程列表 65 | zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm,cmd -w -w" 66 | zstyle ':completion:*:kill:*' ignored-patterns '0' 67 | 68 | # complete manual by their section, from grml 69 | zstyle ':completion:*:manuals' separate-sections true 70 | zstyle ':completion:*:manuals.*' insert-sections true 71 | 72 | # 补全第三方 Git 子命令 73 | # 直接用 git-extras 提供的补全更好 74 | # zstyle ':completion:*:*:git:*' user-commands ${${(M)${(k)commands}:#git-*}/git-/} 75 | 76 | # zwc 什么的忽略掉吧 77 | # FIXME: 导致 zmodload 的补全结果出现其他文件 78 | # zstyle ':completion:*:*:*:*' file-patterns '^*.(zwc|pyc):compiled-files' '*:all-files' 79 | # zstyle ':completion:*:*:rm:*' file-patterns '*:all-files' 80 | # zstyle ':completion:*:*:gio:*' file-patterns '*:all-files' 81 | 82 | # 允许 docker 补全时识别 -it 之类的组合命令 83 | zstyle ':completion:*:*:docker:*' option-stacking yes 84 | zstyle ':completion:*:*:docker-*:*' option-stacking yes 85 | 86 | # color 87 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 88 | 89 | # fg/bg 补全时使用 jobs id 90 | zstyle ':completion:*:jobs' verbose true 91 | zstyle ':completion:*:jobs' numbers true 92 | 93 | zstyle ":completion:*:git-checkout:*" sort false 94 | zstyle ':completion:*' file-sort modification 95 | zstyle ':completion:*:exa' sort false 96 | zstyle ':completion:files' sort false 97 | 98 | # 单词中也进行补全 99 | setopt complete_in_word 100 | setopt no_beep 101 | -------------------------------------------------------------------------------- /zsh/.config/zsh/snippets/history.zsh: -------------------------------------------------------------------------------- 1 | # 限制单条历史记录长度 2 | # return 1: will not be saved 3 | # reutnr 2: saved on the internal history list 4 | autoload -Uz add-zsh-hook 5 | add-zsh-hook zshaddhistory max_history_len 6 | function max_history_len() { 7 | if (($#1 > 240)) { 8 | return 2 9 | } 10 | return 0 11 | } 12 | 13 | HISTFILE="$ZDOTDIR/.zsh_history" 14 | HISTSIZE=50000 15 | SAVEHIST=100000 16 | 17 | # 记录时间戳 18 | setopt extended_history 19 | # 首先移除重复历史 20 | # NOTE: 此选项有时会严重影响 zsh 启动速度 21 | #setopt hist_expire_dups_first 22 | # 忽略重复 23 | setopt hist_ignore_all_dups 24 | setopt hist_ignore_dups 25 | setopt hist_save_no_dups 26 | # 忽略空格开头的命令 27 | setopt hist_ignore_space 28 | # 展开历史时不执行 29 | setopt hist_verify 30 | # 按执行顺序添加历史 31 | setopt inc_append_history 32 | # 更佳性能 33 | setopt hist_fcntl_lock 34 | # 实例之间即时共享历史 35 | # setopt share_history 36 | # 使用 fc -IR 读取历史 fc -IA 保存历史 37 | # 感叹号总是莫名其妙被展开太烦了 38 | setopt no_hist_expand 39 | -------------------------------------------------------------------------------- /zsh/.config/zsh/snippets/key-bindings.zsh: -------------------------------------------------------------------------------- 1 | # 参考资料: 2 | # http://zshwiki.org/home/#reading_terminfo 3 | # https://stackoverflow.com/questions/31641910/why-is-terminfokcuu1-eoa 4 | # https://www.reddit.com/r/zsh/comments/eblqvq/del_pgup_and_pgdown_input_in_terminal/fb7337q/ 5 | 6 | bindkey -e # Emacs 键绑定 7 | 8 | # make sure the terminal is in application mode, when zle is 9 | # active. Only then are the values from $terminfo valid. 10 | if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )) { 11 | function zle-line-init() { 12 | echoti smkx 13 | } 14 | function zle-line-finish() { 15 | echoti rmkx 16 | } 17 | zle -N zle-line-init 18 | zle -N zle-line-finish 19 | } 20 | 21 | autoload -U up-line-or-beginning-search 22 | autoload -U down-line-or-beginning-search 23 | 24 | zle -N up-line-or-beginning-search 25 | zle -N down-line-or-beginning-search 26 | 27 | local -A keybindings=( 28 | 'Home' beginning-of-line 29 | 'End' end-of-line 30 | 'Delete' delete-char 31 | 'Up' up-line-or-beginning-search 32 | 'Down' down-line-or-beginning-search 33 | 34 | 'C-Right' forward-word 35 | 'C-Left' backward-word 36 | 'C-Backspace' backward-kill-word 37 | 'Space' magic-space # 按空格展开历史 38 | 'C-d' delete-char # 不需要触发补全的功能 39 | 'C-w' kill-region 40 | 41 | # 单行模式下将当前内容入栈开启一个临时 prompt 42 | # 多行模式下允许编辑前面的行 43 | 'M-q' push-line-or-edit 44 | 45 | 'C-j' self-insert-unmeta 46 | ) 47 | 48 | ebindkey -M command "Backspace" backward-delete-char 49 | 50 | # 按参数边界跳转 51 | # 参考 https://blog.lilydjwg.me/2013/11/14/zsh-move-by-shell-arguments.41712.html 52 | () { 53 | local -a to_bind=(forward-word backward-word backward-kill-word) 54 | local widget 55 | for widget ($to_bind) { 56 | autoload -Uz $widget-match 57 | zle -N $widget-match 58 | } 59 | zstyle ':zle:*-match' word-style shell 60 | } 61 | keybindings+=( 62 | 'M-Right' forward-word-match 63 | 'M-Left' backward-word-match 64 | 'C-Backspace' backward-kill-word-match 65 | ) 66 | 67 | # 搜索历史 68 | function fz-history-widget() { 69 | local query=" 70 | SELECT commands.argv 71 | FROM history 72 | LEFT JOIN commands 73 | ON history.command_id = commands.rowid 74 | LEFT JOIN places 75 | ON history.place_id = places.rowid 76 | GROUP BY commands.argv 77 | ORDER BY places.dir != '${PWD//'/''}', 78 | commands.argv LIKE '${BUFFER//'/''}%' DESC, 79 | Count(*) DESC 80 | " 81 | # 保证搜索的是全部历史 82 | # NOTE: 此处依赖 fzf-tab 83 | local selected=$(fc -rl 1 | ftb-tmux-popup -n "2.." --tiebreak=index --prompt="cmd> " ${BUFFER:+-q$BUFFER}) 84 | if [[ "$selected" != "" ]] { 85 | zle vi-fetch-history -n $selected 86 | } 87 | } 88 | zle -N fz-history-widget 89 | keybindings[C-r]=fz-history-widget 90 | 91 | # 搜索文件 92 | # 会将 * 或 ** 替换为搜索结果 93 | # 前者表示搜索单层, 后者表示搜索子目录 94 | function fz-find() { 95 | local selected dir cut 96 | cut=$(grep -oP '[^* ]+(?=\*{1,2}$)' <<< $BUFFER) 97 | eval "dir=${cut:-.}" 98 | if [[ $BUFFER == *"**"* ]] { 99 | selected=$(fd -H . $dir | ftb-tmux-popup --tiebreak=end,length --prompt="cd> ") 100 | } elif [[ $BUFFER == *"*"* ]] { 101 | selected=$(fd -d 1 . $dir | ftb-tmux-popup --tiebreak=end --prompt="cd> ") 102 | } 103 | BUFFER=${BUFFER/%'*'*/} 104 | BUFFER=${BUFFER/%$cut/$selected} 105 | zle end-of-line 106 | } 107 | zle -N fz-find 108 | keybindings[M-s]=fz-find 109 | 110 | 111 | # 快速跳转到指定字符 112 | function zce-jump-char() { 113 | [[ -z $BUFFER ]] && zle up-history 114 | zstyle ':zce:*' keys 'asdghklqwertyuiopzxcvbnmfj;23456789' 115 | zstyle ':zce:*' prompt-char '%B%F{green}Jump to character:%F%b ' 116 | zstyle ':zce:*' prompt-key '%B%F{green}Target key:%F%b ' 117 | with-zce zce-raw zce-searchin-read 118 | CURSOR+=1 119 | } 120 | zle -N zce-jump-char 121 | keybindings[M-j]=zce-jump-char 122 | 123 | # 快速跳转到上级目录: ... => ../.. 124 | # https://grml.org/zsh/zsh-lovers.html 125 | function rationalise-dot() { 126 | if [[ $LBUFFER = *.. ]] { 127 | LBUFFER+=/.. 128 | } else { 129 | LBUFFER+=. 130 | } 131 | } 132 | zle -N rationalise-dot 133 | keybindings[.]=rationalise-dot 134 | 135 | # 用编辑器编辑当前行 136 | autoload -U edit-command-line 137 | function edit-command-line-as-zsh { 138 | TMPSUFFIX=.zsh 139 | edit-command-line 140 | unset TMPSUFFIX 141 | } 142 | zle -N edit-command-line-as-zsh 143 | keybindings+=('C-x C-e' edit-command-line-as-zsh) 144 | 145 | # 棒棒 M-x 146 | function execute-command() { 147 | local selected=$(printf "%s\n" ${(k)widgets} | ftb-tmux-popup --reverse --prompt="cmd> " --height=10 ) 148 | zle redisplay 149 | [[ $selected ]] && zle $selected 150 | } 151 | zle -N execute-command 152 | keybindings[M-x]=execute-command 153 | 154 | ebindkey -A keybindings 155 | -------------------------------------------------------------------------------- /zsh/.config/zsh/snippets/misc.zsh: -------------------------------------------------------------------------------- 1 | # https://superuser.com/questions/480928/is-there-any-command-like-time-but-for-memory-usage/767491 2 | autoload -Uz colors 3 | colors 4 | 5 | () { 6 | local white_b=$fg_bold[white] blue=$fg[blue] rst=$reset_color 7 | TIMEFMT=("$white_b%J$rst"$'\n' 8 | "User: $blue%U$rst"$'\t'"System: $blue%S$rst Total: $blue%*Es$rst"$'\n' 9 | "CPU: $blue%P$rst"$'\t'"Mem: $blue%M MB$rst") 10 | } 11 | 12 | SPROMPT="%B%F{yellow}zsh: correct '%R' be '%r' [nyae]?%f%b " 13 | WORDCHARS='' 14 | DIRSTACKSIZE=100 15 | PROMPT_EOL_MARK="⏎" 16 | 17 | hash -d target=~/.cache/cargo-build 18 | hash -d zsh=~/.config/zsh 19 | hash -d dot=~/dotfiles 20 | hash -d zinit=$ZDOTDIR/zinit 21 | hash -d cache=$XDG_CACHE_HOME 22 | hash -d share=$XDG_DATA_HOME 23 | hash -d config=$XDG_CONFIG_HOME 24 | 25 | export FZF_DEFAULT_OPTS='--color=bg+:23 -m --bind ctrl-space:toggle,pgup:preview-up,pgdn:preview-down' 26 | 27 | # 直接输入路径即可跳转 28 | setopt auto_cd 29 | # 允许多次重定向 30 | setopt multios 31 | # 自动添加目录栈 32 | setopt auto_pushd 33 | setopt pushd_ignore_dups 34 | # 补全列表允许不同列宽 35 | setopt listpacked 36 | # 交互模式下使用注释 37 | setopt interactive_comments 38 | # RPROMPT 执行完命令后就消除, 便于复制 39 | setopt transient_rprompt 40 | # setopt 输出显示开关状态 41 | setopt ksh_option_print 42 | # 单引号中 '' 表示一个 ' 43 | setopt rc_quotes 44 | # 增强 glob 45 | setopt extended_glob 46 | # 没有匹配时原样输出 glob 而不是报错 47 | setopt no_nomatch 48 | # 开启拼写检查 49 | setopt correct 50 | 51 | # export EDITOR="emacsclient -nw -c -a ''" 52 | EDITOR=vim 53 | 54 | # rustup mirror 55 | export RUSTUP_DIST_SERVER="https://rsproxy.cn" 56 | export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" 57 | 58 | # for python-better-expections 59 | export FORCE_COLOR=1 60 | # 配置 GOPROXY 环境变量 61 | export GOPROXY=https://goproxy.io,direct 62 | # 还可以设置不走 proxy 的私有仓库或组,多个用逗号相隔(可选) 63 | export GOPRIVATE=git.mycompany.com,github.com/my/private 64 | # 使用 bat 作为 man 的语法高亮 65 | #export MANPAGER="sh -c 'col -bx | bat -l man -p'" 66 | #export MANROFFOPT='-c' 67 | 68 | # speed up rustc compile 69 | # removed because all cache has be placed in ~/.cache/cargo-build 70 | # export RUSTC_WRAPPER=sccache 71 | 72 | # https://archive.zhimingwang.org/blog/2015-09-21-zsh-51-and-bracketed-paste.html 73 | autoload -Uz bracketed-paste-url-magic 74 | zle -N bracketed-paste bracketed-paste-url-magic 75 | -------------------------------------------------------------------------------- /zsh/.config/zsh/zinit/.gitignore: -------------------------------------------------------------------------------- 1 | snippets 2 | services 3 | plugins 4 | completions 5 | polaris 6 | -------------------------------------------------------------------------------- /zsh/.config/zsh/zshrc.zsh: -------------------------------------------------------------------------------- 1 | # 如果是非 tmux 启动的交互式终端,考虑启动 tmux 2 | if [[ ( ! "$(' 114 | 115 | FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}alias]='fg=blue' 116 | FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}function]='fg=cyan' 117 | # 对 man 的高亮会卡住上下翻历史的动作 118 | # FAST_HIGHLIGHT[chroma-man]= 119 | 120 | -------------------------------------------------------------------------------- /zsh/.gitignore: -------------------------------------------------------------------------------- 1 | .zplugin 2 | *.zwc 3 | -------------------------------------------------------------------------------- /zsh/.zshenv: -------------------------------------------------------------------------------- 1 | export XDG_CONFIG_HOME=$HOME/.config 2 | export XDG_CACHE_HOME=$HOME/.cache 3 | export XDG_DATA_HOME=$HOME/.local/share 4 | 5 | export LANGUAGE=en_US # :zh_CN 6 | 7 | export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" 8 | 9 | ZDOTDIR=$XDG_CONFIG_HOME/zsh 10 | 11 | path+=( 12 | ~/.local/bin 13 | ~/go/bin 14 | ~/.cargo/bin 15 | ~/.pub-cache/bin 16 | ) --------------------------------------------------------------------------------