2
0
mirror of https://github.com/mhinz/neovim-remote synced 2024-11-11 13:10:34 +00:00

Implement -O and -p

This commit is contained in:
Marco Hinz 2015-12-16 18:25:58 +01:00
parent 2f35681794
commit 8e649507b3

16
nvr
View File

@ -77,6 +77,14 @@ def parse_args():
action = 'append', action = 'append',
metavar = '<files>', metavar = '<files>',
help = 'open files via :split') help = 'open files via :split')
parser.add_argument('-O',
action = 'append',
metavar = '<files>',
help = 'open files via :vsplit')
parser.add_argument('-p',
action = 'append',
metavar = '<files>',
help = 'open files via :tabedit')
parser.add_argument('--remote', parser.add_argument('--remote',
action = 'append', action = 'append',
@ -144,6 +152,14 @@ def main():
for fname in args.o: for fname in args.o:
n.server.command('split {}'.format(fname.replace(" ", "\ ")), async=True) n.server.command('split {}'.format(fname.replace(" ", "\ ")), async=True)
if args.O and n.attached():
for fname in args.O:
n.server.command('vsplit {}'.format(fname.replace(" ", "\ ")), async=True)
if args.p and n.attached():
for fname in args.p:
n.server.command('tabedit {}'.format(fname.replace(" ", "\ ")), async=True)
# The following options exactly emulate their vim equivalents. # The following options exactly emulate their vim equivalents.
if args.remote_silent and n.attached(silent=True): if args.remote_silent and n.attached(silent=True):