1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 11:35:35 +03:00
vimr/NvimMsgPack.playground/Contents.swift

21 lines
455 B
Swift
Raw Normal View History

2017-11-26 22:25:25 +03:00
//: Playground - noun: a place where people can play
import Cocoa
import NvimMsgPack
// Start nvim as follows:
// $ NVIM_LISTEN_ADDRESS=/tmp/nvim.sock nvim $SOME_FILES
2017-12-03 11:59:15 +03:00
guard let nvim = NvimApi(at: "/tmp/nvim.sock") else {
2017-11-26 22:25:25 +03:00
preconditionFailure("Could not connect to nvim")
}
2017-12-01 17:34:00 +03:00
nvim.connect()
2017-12-01 23:37:06 +03:00
if nvim.getMode().value?.dictionaryValue?[.string("blocked")]?.boolValue == true {
print("blocked!")
} else {
print("not blocked!")
}
print(nvim.getMode())