Compare commits
5
Commits
bb226fff73
...
61ff4a8daa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61ff4a8daa | ||
|
|
a7a06cd75e | ||
|
|
bf77e1486b | ||
|
|
ee189b408b | ||
|
|
c7569e48dc |
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
set formatoptions+=1rnmBa
|
setlocal formatoptions+=1rnmBj
|
||||||
|
|
||||||
" Reformat lines (getting the spacing correct) {{{
|
" Reformat lines (getting the spacing correct) {{{
|
||||||
fun! TeX_fmt()
|
fun! TeX_fmt()
|
||||||
|
|||||||
+13
-6
@@ -96,7 +96,14 @@ local function check_plugin_updates()
|
|||||||
local concurrency = 2
|
local concurrency = 2
|
||||||
|
|
||||||
local function git_command(args)
|
local function git_command(args)
|
||||||
local command = { 'ionice', '-c', '3', 'nice', '-n', '10', 'git' }
|
local command = {}
|
||||||
|
if vim.fn.executable('ionice') == 1 then
|
||||||
|
vim.list_extend(command, { 'ionice', '-c', '3' })
|
||||||
|
end
|
||||||
|
if vim.fn.executable('nice') == 1 then
|
||||||
|
vim.list_extend(command, { 'nice', '-n', '10' })
|
||||||
|
end
|
||||||
|
table.insert(command, 'git')
|
||||||
vim.list_extend(command, args)
|
vim.list_extend(command, args)
|
||||||
return command
|
return command
|
||||||
end
|
end
|
||||||
@@ -371,16 +378,16 @@ let g:UltiSnipsEditSplit="vertical"
|
|||||||
set rtp+=~/.config/nvim/my-snippets
|
set rtp+=~/.config/nvim/my-snippets
|
||||||
|
|
||||||
" Folding
|
" Folding
|
||||||
set foldmethod=syntax
|
set foldmethod=indent
|
||||||
set foldlevel=100
|
set foldlevel=100
|
||||||
" Use F9 to toggle folding
|
" Use F9 or <Leader>z to toggle folding
|
||||||
inoremap <F9> <C-O>za
|
inoremap <F9> <C-O>za
|
||||||
nnoremap <F9> za
|
nnoremap <F9> za
|
||||||
onoremap <F9> <C-C>za
|
onoremap <F9> <C-C>za
|
||||||
vnoremap <F9> zf
|
vnoremap <F9> zf
|
||||||
nnoremap <Leader>a za
|
nnoremap <Leader>z za
|
||||||
onoremap <Leader>a <C-C>za
|
onoremap <Leader>z <C-C>za
|
||||||
vnoremap <Leader>a zf
|
vnoremap <Leader>z zf
|
||||||
|
|
||||||
try
|
try
|
||||||
source ~/.config/nvim/.vimrc_config_expand_region
|
source ~/.config/nvim/.vimrc_config_expand_region
|
||||||
|
|||||||
@@ -7,14 +7,12 @@ ohmyzsh/ohmyzsh path:plugins/ssh-agent
|
|||||||
ohmyzsh/ohmyzsh path:plugins/pip
|
ohmyzsh/ohmyzsh path:plugins/pip
|
||||||
ohmyzsh/ohmyzsh path:plugins/python
|
ohmyzsh/ohmyzsh path:plugins/python
|
||||||
ohmyzsh/ohmyzsh path:plugins/virtualenv
|
ohmyzsh/ohmyzsh path:plugins/virtualenv
|
||||||
ohmyzsh/ohmyzsh path:plugins/python
|
|
||||||
ohmyzsh/ohmyzsh path:plugins/docker
|
ohmyzsh/ohmyzsh path:plugins/docker
|
||||||
ohmyzsh/ohmyzsh path:plugins/docker-compose
|
ohmyzsh/ohmyzsh path:plugins/docker-compose
|
||||||
ohmyzsh/ohmyzsh path:plugins/command-not-found
|
ohmyzsh/ohmyzsh path:plugins/command-not-found
|
||||||
|
|
||||||
|
|
||||||
romkatv/powerlevel10k
|
romkatv/powerlevel10k
|
||||||
zsh-users/zsh-syntax-highlighting
|
|
||||||
zsh-users/zsh-autosuggestions
|
zsh-users/zsh-autosuggestions
|
||||||
zsh-users/zsh-completions
|
zsh-users/zsh-completions
|
||||||
zsh-users/zsh-history-substring-search
|
zsh-users/zsh-history-substring-search
|
||||||
|
|||||||
@@ -6,14 +6,12 @@ ohmyzsh/ohmyzsh path:plugins/ssh-agent
|
|||||||
ohmyzsh/ohmyzsh path:plugins/pip
|
ohmyzsh/ohmyzsh path:plugins/pip
|
||||||
ohmyzsh/ohmyzsh path:plugins/python
|
ohmyzsh/ohmyzsh path:plugins/python
|
||||||
ohmyzsh/ohmyzsh path:plugins/virtualenv
|
ohmyzsh/ohmyzsh path:plugins/virtualenv
|
||||||
ohmyzsh/ohmyzsh path:plugins/python
|
|
||||||
ohmyzsh/ohmyzsh path:plugins/docker
|
ohmyzsh/ohmyzsh path:plugins/docker
|
||||||
ohmyzsh/ohmyzsh path:plugins/docker-compose
|
ohmyzsh/ohmyzsh path:plugins/docker-compose
|
||||||
ohmyzsh/ohmyzsh path:plugins/command-not-found
|
ohmyzsh/ohmyzsh path:plugins/command-not-found
|
||||||
|
|
||||||
|
|
||||||
romkatv/powerlevel10k
|
romkatv/powerlevel10k
|
||||||
zsh-users/zsh-syntax-highlighting
|
|
||||||
zsh-users/zsh-completions
|
zsh-users/zsh-completions
|
||||||
zsh-users/zsh-history-substring-search
|
zsh-users/zsh-history-substring-search
|
||||||
urbainvaes/fzf-marks
|
urbainvaes/fzf-marks
|
||||||
|
|||||||
+69
-2
@@ -21,10 +21,77 @@ alias ls='ls --color=always'
|
|||||||
alias cgrep='grep --color=always'
|
alias cgrep='grep --color=always'
|
||||||
alias cdiff='git diff --color-words --no-index'
|
alias cdiff='git diff --color-words --no-index'
|
||||||
|
|
||||||
|
# Remove the files an archive extracted into the current directory.
|
||||||
|
# Lists what it will delete and asks first; -f skips the prompt, -n dry-runs.
|
||||||
|
# Directories are only removed if they end up empty.
|
||||||
delzip() {
|
delzip() {
|
||||||
unzip -Z -1 "$@" | xargs -I{} rm -rf {}
|
emulate -L zsh
|
||||||
|
setopt local_options
|
||||||
|
|
||||||
|
local dry=0 force=0
|
||||||
|
while [[ $1 == -[nf] ]]; do
|
||||||
|
[[ $1 == -n ]] && dry=1 || force=1
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
(( $# )) || { print -ru2 "usage: delzip [-n|-f] <archive.zip>..."; return 2 }
|
||||||
|
|
||||||
|
local zip entry parent
|
||||||
|
local -a entries files dirs
|
||||||
|
for zip in "$@"; do
|
||||||
|
[[ -f $zip ]] || { print -ru2 "delzip: no such file: $zip"; return 1 }
|
||||||
|
entries=("${(f)$(unzip -Z -1 -- $zip)}") || return 1
|
||||||
|
for entry in $entries; do
|
||||||
|
[[ -n $entry ]] || continue
|
||||||
|
# zip-slip guard: never touch anything outside the cwd
|
||||||
|
if [[ $entry == (/|~)* || $entry == (|*/)..(|/*) ]]; then
|
||||||
|
print -ru2 "delzip: refusing unsafe path: $entry"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
[[ $entry == */ ]] && dirs+=(${entry%/}) || files+=($entry)
|
||||||
|
# many archives omit directory entries, so infer them from the
|
||||||
|
# paths as well; unzip creates those dirs regardless
|
||||||
|
parent=${entry%/}
|
||||||
|
while [[ $parent == */* ]]; do
|
||||||
|
parent=${parent%/*}
|
||||||
|
dirs+=($parent)
|
||||||
|
done
|
||||||
|
done
|
||||||
|
done
|
||||||
|
dirs=(${(u)dirs})
|
||||||
|
|
||||||
|
# only keep what is actually on disk, so the list reflects reality;
|
||||||
|
# -L catches broken symlinks, which -e alone misses
|
||||||
|
local -a present
|
||||||
|
present=(); for entry in $files; do [[ -e $entry || -L $entry ]] && present+=($entry); done
|
||||||
|
files=($present)
|
||||||
|
present=(); for entry in $dirs; do [[ -d $entry ]] && present+=($entry); done
|
||||||
|
dirs=($present)
|
||||||
|
|
||||||
|
(( $#files + $#dirs )) || { print -ru2 "delzip: nothing to remove here (already gone?)"; return 1 }
|
||||||
|
|
||||||
|
if (( dry )); then
|
||||||
|
print -rl -- ${files} ${(O)dirs}
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( ! force )); then
|
||||||
|
[[ -t 0 ]] || { print -ru2 "delzip: not a terminal, use -f to skip the prompt"; return 1 }
|
||||||
|
print -r -- "delzip: remove ${#files} file(s) under ${PWD}:"
|
||||||
|
print -rl -- " "${^files[1,20]}
|
||||||
|
(( $#files > 20 )) && print -r -- " ... and $(( $#files - 20 )) more"
|
||||||
|
(( $#dirs )) && print -r -- "plus ${#dirs} directory/ies, if they end up empty."
|
||||||
|
read -q "?Proceed? [y/N] " || { print -r -- $'\naborted'; return 1 }
|
||||||
|
print
|
||||||
|
fi
|
||||||
|
|
||||||
|
(( $#files )) && rm -f -- $files
|
||||||
|
# deepest first, so parents can empty out; rmdir refuses non-empty dirs
|
||||||
|
for entry in ${(O)dirs}; do
|
||||||
|
[[ -d $entry ]] && rmdir -- $entry 2>/dev/null
|
||||||
|
done
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
export MITMPROXY_SSLKEYLOGFILE='~/.mitmproxy/sslkeylogfile.txt'
|
export MITMPROXY_SSLKEYLOGFILE="$HOME/.mitmproxy/sslkeylogfile.txt"
|
||||||
|
|
||||||
unset ZSH_AUTOSUGGEST_USE_ASYNC
|
unset ZSH_AUTOSUGGEST_USE_ASYNC
|
||||||
export LANG='en_US.UTF-8'
|
export LANG='en_US.UTF-8'
|
||||||
|
|||||||
Reference in new issue
Block a user