This repository has been archived on 2025-01-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
.bin
.config
.local
.oh-my-zsh
lib
plugins
adb
ant
apache2-macports
arcanist
archlinux
asdf
autoenv
autojump
autopep8
aws
battery
bbedit
bgnotify
boot2docker
bower
branch
brew
bundler
bwana
cabal
cake
cakephp3
capistrano
cargo
cask
catimg
celery
chruby
chucknorris
cloudapp
codeclimate
coffee
colemak
colored-man-pages
colorize
command-not-found
common-aliases
compleat
composer
copybuffer
copydir
copyfile
cp
cpanm
debian
dircycle
dirhistory
dirpersist
django
dnf
docker
docker-compose
dotenv
droplr
emacs
ember-cli
emoji
emoji-clock
emotty
encode64
extract
fabric
fancy-ctrl-z
fasd
fastfile
fbterm
fedora
firewalld
forklift
fossil
frontend-search
gas
gb
geeknote
gem
git
git-extras
git-flow
git-flow-avh
git-hubflow
git-prompt
git-remote-branch
gitfast
github
gitignore
glassfish
globalias
gnu-utils
go
golang
gpg-agent
gradle
grails
grunt
gulp
heroku
history
history-substring-search
httpie
iwhois
jake-node
jhbuild
jira
jruby
jsontools
jump
kate
kitchen
knife
knife_ssh
kubectl
laravel
laravel4
laravel5
last-working-dir
lein
lighthouse
lol
macports
man
marked2
mercurial
meteor
mix
mix-fast
mosh
mvn
mysql-macports
n98-magerun
nanoc
ng
nmap
node
nomad
npm
nvm
nyan
osx
pass
paver
pep8
per-directory-history
perl
perms
phing
pip
pj
pod
postgres
pow
powder
powify
profiles
pyenv
pylint
python
rails
rake
rake-fast
rand-quote
rbenv
rbfu
react-native
rebar
redis-cli
repo
rsync
ruby
rust
rvm
safe-paste
sbt
scala
scd
screen
scw
sfffe
shrink-path
singlechar
spring
sprunge
ssh-agent
stack
sublime
sudo
supervisor
suse
svn
svn-fast-info
swiftpm
symfony
symfony2
systemadmin
systemd
taskwarrior
terminalapp
terminitor
terraform
textastic
textmate
thefuck
themes
thor
tig
tmux
tmux-cssh
tmuxinator
torrent
tugboat
ubuntu
urltools
vagrant
vault
vi-mode
vim-interaction
README.md
vim-interaction.plugin.zsh
virtualenv
virtualenvwrapper
vundle
wakeonlan
wd
web-search
wp-cli
xcode
yarn
yii
yii2
yum
z
zeus
zsh-navigation-tools
zsh_reload
templates
themes
tools
CONTRIBUTING.md
LICENSE.txt
README.md
oh-my-zsh.sh
.themes
.Xdefaults
.Xresources
.bash_profile
.profile
.xinitrc
.xsessionrc
.zshrc
README.md
home/.oh-my-zsh/plugins/vim-interaction

Vim Interaction

The plugin presents a function called callvim whose usage is:

usage: callvim [-b cmd] [-a cmd] [file ... fileN]

  -b cmd     Run this command in GVIM before editing the first file
  -a cmd     Run this command in GVIM after editing the first file
  file       The file to edit
  ... fileN  The other files to add to the argslist

Rationale

The idea for this script is to give you some decent interaction with a running GVim session. Normally you'll be running around your filesystem doing any number of amazing things and you'll need to load some files into GVim for editing, inspecting, destruction, or other bits of mayhem. This script lets you do that.

Aliases

There are a few aliases presented as well:

  • v A shorthand for callvim
  • vvsp Edits the passed in file but first makes a vertical split
  • vhsp Edits the passed in file but first makes a horizontal split

Post Callout

At the end of the callvim function we invoke the postCallVim function if it exists. If you're using MacVim, for example, you could define a function that brings window focus to it after the file is loaded:

function postCallVim
{
  osascript -e 'tell application "MacVim" to activate'
}

This'll be different depending on your OS / Window Manager.

Examples

This will load /tmp/myfile.scala into the running GVim session:

> v /tmp/myfile.scala

This will load it after first doing a vertical split:

> vvsp /tmp/myfile.scala
or
> v -b':vsp' /tmp/myfile.scala

This will load it after doing a horizontal split, then moving to the bottom of the file:

> vhsp -aG /tmp/myfile.scala
or
> v -b':sp' -aG /tmp/myfile.scala

This will load the file and then copy the first line to the end (Why you would ever want to do this... I dunno):

> v -a':1t$' /tmp/myfile.scala

And this will load all of the *.txt files into the args list:

> v *.txt

If you want to load files into areas that are already split, use one of the aliases for that:

# Do a ':wincmd h' first
> vh /tmp/myfile.scala

# Do a ':wincmd j' first
> vj /tmp/myfile.scala

# Do a ':wincmd k' first
> vk /tmp/myfile.scala

# Do a ':wincmd l' first
> vl /tmp/myfile.scala