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

21 lines
455 B
Swift

//: 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
guard let nvim = NvimApi(at: "/tmp/nvim.sock") else {
preconditionFailure("Could not connect to nvim")
}
nvim.connect()
if nvim.getMode().value?.dictionaryValue?[.string("blocked")]?.boolValue == true {
print("blocked!")
} else {
print("not blocked!")
}
print(nvim.getMode())