zsh-workers
 help / color / mirror / code / Atom feed
b952d84786cae84ce900660ab36b95d113f21f16 blob 897 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
# bracketed-paste-url-magic quotes pasted urls automatically, if the
# paste exactly starts with a url, eg no spaces or other characters precede it
#
# To use it, put this in your startup files (eg, .zshrc)
#
# autoload -Uz bracketed-paste-url-magic
# zle -N bracketed-paste bracketed-paste-url-magic
#
# You can customize which schemas are to be quoted by using
#
# zstyle :bracketed-paste-url-magic schema http https ftp
#
# The default can be seen just below.

local -a schema
zstyle -a :bracketed-paste-url-magic schema schema || schema=(http https ftp ftps file ssh sftp)

local wantquote=${NUMERIC:-0}
local content
local start=$#LBUFFER

zle .$WIDGET -N content

if ! (( $wantquote )); then
  if [[ $content = (${(~j:|:)schema})://* ]]; then
    wantquote=1
  fi
fi

if (( $wantquote )); then
  content=${(q-)content}
fi

LBUFFER+=$content

YANK_START=$start
YANK_END=$#LBUFFER
zle -f yank
debug log:

solving b952d84 ...
found b952d84 in https://inbox.vuxu.org/zsh-workers/1443578812-18807-1-git-send-email-mikachu@gmail.com/

applying [1/1] https://inbox.vuxu.org/zsh-workers/1443578812-18807-1-git-send-email-mikachu@gmail.com/
diff --git a/Functions/Zle/bracketed-paste-url-magic b/Functions/Zle/bracketed-paste-url-magic
new file mode 100644
index 0000000..b952d84

Checking patch Functions/Zle/bracketed-paste-url-magic...
Applied patch Functions/Zle/bracketed-paste-url-magic cleanly.

index at:
100644 b952d84786cae84ce900660ab36b95d113f21f16	Functions/Zle/bracketed-paste-url-magic

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).