本文整理汇总了TypeScript中neovim/lib/api/client.NeovimClient类的典型用法代码示例。如果您正苦于以下问题:TypeScript NeovimClient类的具体用法?TypeScript NeovimClient怎么用?TypeScript NeovimClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NeovimClient类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: attachBindings
export function attachBindings(nvim: NeovimClient, bindings: IBindings) {
let commands: string[] = [];
for (let key in bindings) {
commands.push(
`nnoremap <silent> <buffer> ${key} :call rpcnotify(g:chrome_rpc_id, '${NOTIFICATION_TYPE}', '${escape(key)}')<cr>`
);
}
activeBindings = bindings;
return nvim.command(commands.join(' | '));
}
示例2: setupBindings
export function setupBindings(nvim: NeovimClient) {
nvim.removeListener('notification', onNotify);
nvim.on('notification', onNotify);
activeBindings = {};
}
示例3: inspectSite
export function inspectSite(options: IPromiseReturn) {
const wsUrl = options.site.webSocketDebuggerUrl;
nvim = options.nvim;
ws = new WebSocket(wsUrl);
ws.on('open', listenMessages);
ws.on('message', onMessage);
ws.on('close', onClose);
nvim.on('notification', onNvimNotify);
scripts = new Scripts();
page = new VTreePage(nvim);
}
示例4: Promise
export async function fetchSites(): Promise<IPromiseReturn> {
try {
nvim = await attach({ reader: process.stdin, writer: process.stdout });
page = new VPage(nvim);
await page.init();
await step1();
await step2();
await step3();
nvim.command('setlocal nomodifiable cursorline buftype=nofile');
return new Promise(function(rs: SiteCB, rj) {
resolve = rs;
});
} catch(ex) {
if (page.buffer) {
await page.fill(ex.toString());
nvim.command('setlocal nomodifiable buftype=nofile');
} else {
logger.error(ex);
}
return;
}
}