|
Warning: this is an htmlized version!
The original is across this link, and the conversion rules are here. |
#######
#
# E-scripts on vi things (mainly vi emulation in Emacs)
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/vi.e>
# or at <http://angg.twu.net/e/vi.e.html>.
# See also <http://angg.twu.net/emacs.html>,
# <http://angg.twu.net/.emacs[.html]>,
# <http://angg.twu.net/.zshrc[.html]>,
# <http://angg.twu.net/escripts.html>,
# and <http://angg.twu.net/>.
#
#######
# «.viper» (to "viper")
# «.viblock_1» (to "viblock_1")
# «.viblock_2» (to "viblock_2")
# «.vim-emacs-bridge» (to "vim-emacs-bridge")
#####
#
# viper
# 2001aug06
#
#####
# «viper» (to ".viper")
# (code-c-d "viper" "/usr/share/emacs/20.7/lisp/emulation/" "viper-e20")
# (find-vipernode "Commands")
# (find-vipernode "Groundwork")
# (find-vipernode "Move Commands")
# (find-vipernode "Appending Text")
# (find-vipernode "Editing in Insert State")
# (find-vipernode "Deleting Text")
# (find-vipernode "Changing Text")
# (find-vipernode "Search and Replace")
# (find-vipernode "Yanking")
# (find-vipernode "Undoing")
# (find-vipernode "Display")
# (find-vipernode "File and Buffer Handling")
# (find-vipernode "Shell Commands")
# (find-vipernode "Options")
# (find-vipernode "Emacs Related Commands")
# (find-vipernode "Rudimentary Changes" "`viper-vi-style-in-minibuffer t'")
# (find-vipernode "Viper Specials" "`M-x viper-go-away'")
# (find-vipernode "Vi Macros")
# (find-vipernode "Mapping")
# (find-vipernode "Groundwork" "textmarkers")
# (find-vipernode "Marking")
# (find-vipernode "Shell Commands")
#####
#
# saving a block in vi, version 1 (thxs to \Igor\ from #debian)
# 2001sep09
#
#####
# «viblock_1» (to ".viblock_1")
#*
cd /tmp/
cat > 1 <<'---'
one
two
three
four
five
---
cat > $EEG <<'---'
Tcl: set tcl_prefix ""
proc kstr {str} { append_action [list sendstr $str] }
k down right m a
k down down
kstr { :'a,.w!2}
ks ret
kstr { :q!}
k ret
---
eeg3 vi 1
cat 2
#*
#####
#
# saving a block in vi, version 2 (thxs to \Igor\ from #debian)
# 2001sep09
#
#####
# «viblock_2» (to ".viblock_2")
#*
cd /tmp/
cat > 1 <<'---'
one
two
three
four
five
---
echo bla bla > 2
cat > $EEG <<'---'
Tcl: set tcl_prefix ""
proc kstr {str} { append_action [list sendstr $str] }
proc kcmd {str} { kstr $str; k ret }
k down right m a
k down down
kcmd ":'a,.y t"
kcmd ":w"
kcmd ":e 2"
kcmd {:1,$d}
kstr {"tP}
kcmd ":w"
kcmd ":q!"
---
eeg3 vi 1
cat 2
#*
# (find-fline "~/EXPECT/eeg3")
:`a,.y t :w :e <new file> "tP :w CTRL-O
<\Igor\> edrx: i should annotate that, | separates different commands and : means it's an ex command
<\Igor\> edrx, :`a,.y t|:w|:e <new file>|"tP|:w|CTRL-O
#####
#
# vim script
# 2004jul24
#
#####
# (find-status "vim")
# (find-vldifile "vim.list")
# (find-fline "/usr/doc/vim/")
# (find-fline "/usr/share/doc/vim/macros/maze/")
# (find-fline "/usr/share/vim/vim61/tutor/")
# (find-eetcfile "viperCard.tex")
#*
cd /tmp/
cp -v /usr/share/emacs/20.7/etc/viperCard.tex .
tex viperCard.tex
#*
xdvi /tmp/viperCard.dvi &
#*
# (find-viperfile "")
# (find-viperfile "viper-keym.el")
<edrx> xp: I friend who's a vi'er once tried to teach me how to mark regions
in vim, but my notes about that look like line noise to me now :(
<sachac> edrx: V, then use arrow keys. Works in vim.
#####
#
# a vim<->emacs bridge (joint work with Thomas Adam)
# 2007apr01
#
#####
# «vim-emacs-bridge» (to ".vim-emacs-bridge")
# http://starshine.org/xteddy/thomas/
# (find-fline "~/LOGS/2007apr01.eev")
# (find-status "vim")
# (find-vldifile "vim.list")
# (find-udfile "vim/")
# (find-status "vim-tcl")
# (find-vldifile "vim-tcl.list")
# (find-udfile "vim-tcl/")
# (find-udfile "vim-tcl/FAQ.gz")
* (eechannel-xterm "A")
vim --servername FOO
ia
* (eechannel-xterm "B")
vim --servername FOO --remote-expr 1+2
* (eechannel-xterm "A")
:q!
--remote-expr :2+1
<thomas_adam> Ah, OK. Like vim --remote-expr then.
<edrx> the middle line should be "3"
<thomas_adam> Hehe.
<edrx> hm, how does --remote-expr work?
<thomas_adam> [n6tadam@workstation ~]% vim --servername GVIM
--remote-expr 1+2
<thomas_adam> 3
<thomas_adam> So you tell it to connect to an already running client,
tell it something, and see the results. I don't know
how it works internally.
<edrx> ok
<edrx> how do you start a vim telling it to answer requests to the vim
server FOO?
<thomas_adam> You'd have to ensure that the named session had started
first.
<thomas_adam> gvim --servername FOO
<edrx> ok
<thomas_adam> gvim --servername FOO --remote-expr :2+1
<thomas_adam> Ehem, s/://
<edrx> I'm trying...
<edrx> if you have good pointers to sections of the vim docs I'll be
http://www.troubleshooters.com/lpm/200310/200310.htm executable lines
# Local Variables:
# coding: raw-text-unix
# ee-delimiter-hash: "\n#*\n"
# ee-delimiter-percent: "\n%*\n"
# ee-anchor-format: "«%s»"
# End: