mirror of
https://github.com/mhinz/neovim-remote
synced 2024-11-11 13:10:34 +00:00
Implement -l
This commit is contained in:
parent
a2ce603beb
commit
d69792bcc6
@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Option: `-o`
|
||||
- Option: `-O`
|
||||
- Option: `-p`
|
||||
- Option: `-l`
|
||||
|
||||
### Changed
|
||||
- Renamed `nvim-remote.py` to `nvr` for convenience.
|
||||
|
14
nvr
14
nvr
@ -76,21 +76,24 @@ def parse_args():
|
||||
# The following options are similar to their vim equivalents,
|
||||
# but work on the remote instance instead.
|
||||
|
||||
parser.add_argument('-l',
|
||||
action = 'store_true',
|
||||
help = 'change to previous window via ":wincmd p"')
|
||||
parser.add_argument('-o',
|
||||
action = 'append',
|
||||
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')
|
||||
help = 'open files via ":vsplit"')
|
||||
|
||||
# The following options exactly emulate their vim equivalents.
|
||||
|
||||
parser.add_argument('--remote',
|
||||
action = 'append',
|
||||
metavar = '<files>',
|
||||
help = 'open files via :edit')
|
||||
help = 'open files via ":edit"')
|
||||
parser.add_argument('--remote-wait',
|
||||
action = 'append',
|
||||
metavar = '<files>',
|
||||
@ -106,7 +109,7 @@ def parse_args():
|
||||
parser.add_argument('--remote-tab', '-p',
|
||||
action = 'append',
|
||||
metavar = '<files>',
|
||||
help = 'open files via :tabedit')
|
||||
help = 'open files via ":tabedit"')
|
||||
parser.add_argument('--remote-send',
|
||||
action = 'append',
|
||||
metavar = '<keys>',
|
||||
@ -154,6 +157,9 @@ def main():
|
||||
|
||||
n = Neovim(sockpath)
|
||||
|
||||
if args.l and n.attached(silent=True):
|
||||
n.server.command('wincmd p', async=True)
|
||||
|
||||
if args.remote_silent and n.attached(silent=True):
|
||||
for fname in args.remote_silent:
|
||||
n.server.command('edit {}'.format(fname.replace(" ", "\ ")), async=True)
|
||||
|
Loading…
Reference in New Issue
Block a user