]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/vim-interaction/README.md
681648018e69ccb077909e9fcd6346be9d55d4d1
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / vim-interaction / README.md
1 # Vim Interaction #
2
3 The plugin presents a function called `callvim` whose usage is:
4
5     usage: callvim [-b cmd] [-a cmd] [file ... fileN]
6     
7       -b cmd     Run this command in GVIM before editing the first file
8       -a cmd     Run this command in GVIM after editing the first file
9       file       The file to edit
10       ... fileN  The other files to add to the argslist
11
12 ## Rationale ##
13
14 The idea for this script is to give you some decent interaction with a running
15 GVim session.  Normally you'll be running around your filesystem doing any
16 number of amazing things and you'll need to load some files into GVim for
17 editing, inspecting, destruction, or other bits of mayhem.  This script lets you
18 do that.
19
20 ## Aliases ##
21
22 There are a few aliases presented as well:
23
24 * `v` A shorthand for `callvim`
25 * `vvsp` Edits the passed in file but first makes a vertical split
26 * `vhsp` Edits the passed in file but first makes a horizontal split
27
28 ## Post Callout ##
29
30 At the end of the `callvim` function we invoke the `postCallVim` function if it
31 exists.  If you're using MacVim, for example, you could define a function that
32 brings window focus to it after the file is loaded:
33
34     function postCallVim
35     {
36       osascript -e 'tell application "MacVim" to activate'
37     }
38
39 This'll be different depending on your OS / Window Manager.
40
41 ## Examples ##
42
43 This will load `/tmp/myfile.scala` into the running GVim session:
44
45     > v /tmp/myfile.scala
46
47 This will load it after first doing a vertical split:
48
49     > vvsp /tmp/myfile.scala
50     or
51     > v -b':vsp' /tmp/myfile.scala
52
53 This will load it after doing a horizontal split, then moving to the bottom of
54 the file:
55
56     > vhsp -aG /tmp/myfile.scala
57     or
58     > v -b':sp' -aG /tmp/myfile.scala
59
60 This will load the file and then copy the first line to the end (Why you would
61 ever want to do this... I dunno):
62
63     > v -a':1t$' /tmp/myfile.scala
64
65 And this will load all of the `*.txt` files into the args list:
66
67     > v *.txt
68
69 If you want to load files into areas that are already split, use one of the
70 aliases for that:
71
72     # Do a ':wincmd h' first
73     > vh /tmp/myfile.scala
74
75     # Do a ':wincmd j' first
76     > vj /tmp/myfile.scala
77
78     # Do a ':wincmd k' first
79     > vk /tmp/myfile.scala
80
81     # Do a ':wincmd l' first
82     > vl /tmp/myfile.scala