mirror of
https://github.com/mhinz/neovim-remote
synced 2024-11-11 13:10:34 +00:00
Implement --remote-expr
This commit is contained in:
parent
37d851bb34
commit
0306a433a1
@ -37,7 +37,7 @@ def main():
|
||||
parser.add_argument('--remote-wait-silent', help="Same, don't complain if there is no server")
|
||||
parser.add_argument('--remote-tab', help='As --remote but use tab page per file')
|
||||
parser.add_argument('--remote-send', help='Send <keys> to a Vim server and exit')
|
||||
parser.add_argument('--remote-expr', help='Evaluate <expr> in a Vim server and print result ')
|
||||
parser.add_argument('--remote-expr', action='append', help='Evaluate <expr> in a Vim server and print result ')
|
||||
args, unused = parser.parse_known_args()
|
||||
|
||||
sockpath = os.environ.get('NVIM_LISTEN_ADDRESS')
|
||||
@ -55,6 +55,10 @@ def main():
|
||||
for fname in args.remote:
|
||||
nvim.command('edit {}'.format(fname))
|
||||
|
||||
if args.remote_expr:
|
||||
for expr in args.remote_expr:
|
||||
print(nvim.eval(expr))
|
||||
|
||||
if unused:
|
||||
os.putenv('VIMRUNTIME', '/data/repo/neovim/runtime')
|
||||
subprocess.Popen(['/data/repo/neovim/build/bin/nvim'] + unused)
|
||||
|
Loading…
Reference in New Issue
Block a user