在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:bfredl/Neovim.jl开源软件地址:https://github.com/bfredl/Neovim.jl开源编程语言:Julia 97.0%开源软件介绍:Neovim client for JuliaNeovim.jl is a Neovim API client and plugin host for Julia. It supports:
Requirements
InstallationAdd this package to your current Julia environment: using Pkg
Pkg.add(url="https://github.com/bfredl/Neovim.jl") UsageAs an embedded processThe simplest way to test the API client is to spawn an embedded instance: using Neovim
nvim, proc = nvim_spawn() or connecting to an external instance: nvim = nvim_connect("/socket/address") (this address can be found by As a shortcut, All API methods defined in the Neovim metadata (see import Neovim: get_buffers, set_line, vim_eval
buf = get_buffers(nvim)[1]
set_line(buf, 1, "some text")
@assert vim_eval(nvim, "2+2") == 4 A high level interface is work in progress. For the moment The module exports a low-level interface for handling asynchronous events (notifications and requests). A prototype (read: ugly hack) implementation of Vim bindings for the Julia REPL is included as an example, see As a plugin hostThis package also includes a remote plugin host, similar to the one in the Python client pynvim. To use it, add this repo root to
A Julia plugin can then be defined in a Functions defined at the top-level of your script can be exported using the macros: For example: # In MyPlugin/rplugin/julia/MyPlugin.jl
module MyPlugin
using Neovim
@Neovim.fn function AsyncFun(nvim, args)
# "args" is Vector of arguments passed to ":call AsyncFun(args...)".
end
@Neovim.fnsync function SyncFun(nvim, args)
# This will block neovim while SyncFun is running.
end
@Neovim.fnsync OneLiner(nvim, args) = "expression"
# Add some options. -> is required to define function on next line.
@Neovim.commandsync (nargs="*", range="") ->
function JLCommand(nvim, args, range)
end
# The name of the function/command can also be defined on the macro.
# This is equivalent to the above.
@Neovim.commandsync JLCommand(nargs="*", range="") ->
function (nvim, args, range)
end
end After writing your Julia script, you should call |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论