mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
11299: edit-command-line zle widget
This commit is contained in:
parent
2da726eaf1
commit
50997c02b3
3 changed files with 25 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-05-10 Peter Stephenson <pws@cambridgesiliconradio.com>
|
||||||
|
|
||||||
|
* 11299: Bart/pws: Functions/Zle/edit-command-line: edit command
|
||||||
|
line with external editor.
|
||||||
|
|
||||||
2000-05-10 Sven Wischnowsky <wischnow@zsh.org>
|
2000-05-10 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
* 11298: Doc/Zsh/compsys.yo, Src/Zle/computil.c: more fixes for
|
* 11298: Doc/Zsh/compsys.yo, Src/Zle/computil.c: more fixes for
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
DISTFILES_SRC='
|
DISTFILES_SRC='
|
||||||
.distfiles incremental-complete-word insert-files
|
.distfiles history-search-end edit-command-line incremental-complete-word
|
||||||
|
incarg insert-files predict-on
|
||||||
'
|
'
|
||||||
|
|
18
Functions/Zle/edit-command-line
Normal file
18
Functions/Zle/edit-command-line
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Edit the command line using your usual editor.
|
||||||
|
# Binding this to 'v' in the vi command mode map,
|
||||||
|
# autoload edit-command-line
|
||||||
|
# zle -N edit-command-line
|
||||||
|
# bindkey -M vicmd v edit-command-line
|
||||||
|
# will give ksh-like behaviour for that key.
|
||||||
|
|
||||||
|
local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
|
||||||
|
|
||||||
|
print $BUFFER >$tmpfile
|
||||||
|
exec </dev/tty
|
||||||
|
${VISUAL:-${EDITOR:-vi}} $tmpfile
|
||||||
|
LBUFFER=
|
||||||
|
RBUFFER=
|
||||||
|
BUFFER=$(<$tmpfile)
|
||||||
|
|
||||||
|
rm -f $tmpfile
|
||||||
|
zle redisplay
|
Loading…
Reference in a new issue