我想查看已设置到某个窗口的所有选项
current_window = vim.api.nvim_get_current_win()
vim.wo[current_window].wrap = true
尝试调用 print(vim.inspect(current_window))
会给我这个:
{
<metatable> = {
__index = <function 1>,
__newindex = <function 2>
}
}
尝试获取表格大小时结果为零:
local v = vim.wo[current_window]
print(#v) -- result is 0
但同时这个属性是存在的。下一个片段给了我 true
print(vim.inspect(vim.wo[current_window].wrap)) -- result is true
如何提取所有窗口选项?
最佳答案
- 输入
:h options.txt
- 输入
/local to window
并按 Enter - 按
n
或N
前进和后退
确保您已阅读 :h help-summary
和 :h user-manual
关于lua - NeoVim中如何获取window的所有属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73850771/