Skip to content

Commit

Permalink
add vws (vim window split) command for loading a file into a split
Browse files Browse the repository at this point in the history
  • Loading branch information
nikvdp committed Jan 15, 2023
1 parent 17e13e2 commit ecc59e7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugin/bin/funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ vimwindow() {
fi
}

# (vws from the command line) -- open a file in the window with the specified
# number in a split
vimwindowsplit() {
# remote nvim open file $2 in window $1
local win="$1"
local file="$2"
nvr -cc "${win}wincmd w" -c "split"
vimwindow "$win" "$file"
}


abspath() {
local in_path
if [[ ! "$1" =~ ^/ ]]; then
Expand Down
7 changes: 7 additions & 0 deletions plugin/bin/vws
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

SCRIPT_LOCATION="$( cd "$( dirname "$0" )" && pwd )"

source "$SCRIPT_LOCATION/funcs.sh"

vimwindowsplit "$@"

0 comments on commit ecc59e7

Please sign in to comment.