本文整理汇总了TypeScript中promised-neovim-client.Nvim.setOption方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Nvim.setOption方法的具体用法?TypeScript Nvim.setOption怎么用?TypeScript Nvim.setOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类promised-neovim-client.Nvim
的用法示例。
在下文中一共展示了Nvim.setOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: syncVSToVim
// Data flows from VS to Vim
private async syncVSToVim(vimState: VimState) {
const buf = await this.nvim.getCurrentBuf();
if (configuration.expandtab) {
await vscode.commands.executeCommand('editor.action.indentationToTabs');
}
await this.nvim.setOption('gdefault', configuration.substituteGlobalFlag === true);
await buf.setLines(0, -1, true, TextEditor.getText().split('\n'));
const [rangeStart, rangeEnd] = [
Position.EarlierOf(vimState.cursorPosition, vimState.cursorStartPosition),
Position.LaterOf(vimState.cursorPosition, vimState.cursorStartPosition),
];
await this.nvim.callFunction('setpos', [
'.',
[0, vimState.cursorPosition.line + 1, vimState.cursorPosition.character, false],
]);
await this.nvim.callFunction('setpos', [
"'<",
[0, rangeStart.line + 1, rangeEnd.character, false],
]);
await this.nvim.callFunction('setpos', [
"'>",
[0, rangeEnd.line + 1, rangeEnd.character, false],
]);
for (const mark of vimState.historyTracker.getMarks()) {
await this.nvim.callFunction('setpos', [
`'${mark.name}`,
[0, mark.position.line + 1, mark.position.character, false],
]);
}
// We only copy over " register for now, due to our weird handling of macros.
let reg = await Register.get(vimState);
let vsRegTovimReg = [undefined, 'c', 'l', 'b'];
await this.nvim.callFunction('setreg', [
'"',
reg.text as string,
vsRegTovimReg[vimState.effectiveRegisterMode] as string,
]);
}