KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
osc.nvim
★ 27
Open GitHub ↗
Open Sound Control for Neovim
Download README (.md)
Explore Similar Repositories
PingAnChengDian
:
No description available.
Rn6Pan
:
另一个 6盘 非官方 Android 客户端
Lenovo-LEGION-i7-4720HQ-hd4600-14-OpenCore-Hackintosh
:
联想(Lenovo)拯救者 14(i7-4720HQ 8G 128G SSD+1T GTX960M )
FHF
:
A facebook hacking framework made by me to hack facebook account using bruteforcing or phishimg and also get auto likes on fb
particles-sandbox
:
GPU-accelerated cellular automata in Godot (OBSOLETE: could be done in better ways in Godot 4)
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
osc.nvim
?
Download (.md)
# osc.nvim [Open Sound Control][osc] (OSC) library for Neovim. [](https://asciinema.org/a/387587) `osc.nvim` can be used as an OSC 1.0 compliant client/server in order to let `nvim` communicate with OSC enabled applications over UDP/TCP. `osc.nvim` exposes the full API from the [losc][losc] OSC library, read the documentation for `losc` [here](https://davidgranstrom.github.io/losc/). This plugin does *not* expose any mappings or commands and is `lua` only, see the examples below for usage. ## Project status - [x] Send - [x] Receive - [x] UDP - [ ] TCP ## Features * Full OSC 1.0 compatability (see [losc] for more details). * No binary dependencies (pure lua). * TCP/UDP transport layers using `vim.loop`. * Can be used as a dependency to enable OSC communication for any `nvim` plugin. ## Examples ### Simple server ```lua local osc = require'osc'.new{ transport = 'udp', recvAddr = '127.0.0.1', recvPort = 9000, } -- register a "catch all" handler osc:add_handler('*', function(data) print(vim.inspect(data)) end) -- open the OSC server osc:open() ``` ### Simple client ```lua local osc = require'osc'.new{ transport = 'udp', sendAddr = '127.0.0.1', sendPort = 57120, } local message = osc.new_message{ address = '/test', types = 'ifs', 1, 2, 'hello from nvim!' } local ok, err = osc:send(message) if not ok then print(err) end ``` ### Full example ```lua --- Send an OSC message on every keystroke. -- -- Save this file in a `lua` directory available in your `runtimepath`. -- Example: `~/.config/nvim/lua/osc-keydown.lua` -- -- Usage: `:lua require'osc-keydown'` -- `:OSCEnable` to start sending OSC on every keystroke. -- `:OSCDisable` to stop sending OSC. local osc = require'osc'.new{ transport = 'udp', sendAddr = '127.0.0.1', sendPort = 57120, } local M = {} local on_keystroke = function(k) local message = osc.new_message{ address = '/nvim/key', types = 'si', k, string.byte(k) } local ok, err = osc:send(message) if not ok then print(err) end end function M.enable() if not M.id then M.id = vim.register_keystroke_callback(on_keystroke) end end function M.disable() if M.id then vim.register_keystroke_callback(nil, M.id) end M.id = nil end -- Register commands vim.cmd [[ com! OSCEnable :lua require'osc-keydown'.enable() ]] vim.cmd [[ com! OSCDisable :lua require'osc-keydown'.disable() ]] return M ``` [osc]: http://opensoundcontrol.org/spec-1_0 [losc]: https://github.com/davidgranstrom/losc