Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ for details.
~/.vim-anywhere/uninstall
```

## Arguments

By default, vim-anywhere will open a gvim session with minimal configuration. The below settings can be used to customize vim-anywhere's behavior.

| Option | Description |
| --------------- |-----------------------------|
| -v | Enable verbose output |
| -t \<term\> | Specify a terminal emulator instead of gvim |

__OSX:__

Currently the '-t' flag is not supported.

## Keybinding

__OSX:__ ( default = unbound, suggested = `ctrl+cmd+v` )
Expand Down
14 changes: 12 additions & 2 deletions bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ require_file_exists() {
# opts
###

while getopts ":v" opt; do
while getopts ":t:v" opt; do
case "$opt" in
t) LAUNCH_TERM=$OPTARG ;;
v) set -x ;;
\?) echo "Invalid option: -$OPTARG" >&2 ;;
:) echo "Option -$OPTARG requires an argument" >&2 ;;
esac
done

Expand Down Expand Up @@ -56,11 +58,19 @@ touch $TMPFILE
# Linux
if [[ $OSTYPE == "linux-gnu" ]]; then
chmod o-r $TMPFILE # Make file only readable by you
gvim $VIM_OPTS $TMPFILE
if [[ "" != "$LAUNCH_TERM" ]]; then
$LAUNCH_TERM -e vim $VIM_OPTS $TMPFILE
else
gvim $VIM_OPTS $TMPFILE
fi
cat $TMPFILE | xclip -selection clipboard

# OSX
elif [[ $OSTYPE == "darwin"* ]]; then
if [[ "" != "$LAUNCH_TERM" ]]; then
echo "The -t option is not supported by OSX at this time"
exit 1
fi
# if there is no path file, it must have been deleted or the installer failed
require_file_exists $AW_PATH/.path \
"Please reinstall vim-anywhere."
Expand Down