本文整理匯總了TypeScript中neovim.Neovim.setOption方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Neovim.setOption方法的具體用法?TypeScript Neovim.setOption怎麽用?TypeScript Neovim.setOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.setOption方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: syncVSToVim
// Data flows from VS to Vim
private async syncVSToVim(vimState: VimState) {
const buf = await this.nvim.buffer;
if (configuration.expandtab) {
await vscode.commands.executeCommand('editor.action.indentationToTabs');
}
await this.nvim.setOption('gdefault', configuration.substituteGlobalFlag === true);
await buf.setLines(TextEditor.getText().split('\n'), {
start: 0,
end: -1,
strictIndexing: true,
});
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,
]);
}