Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind_option函数bug? #31

Closed
LLouice opened this issue Sep 10, 2021 · 8 comments
Closed

bind_option函数bug? #31

LLouice opened this issue Sep 10, 2021 · 8 comments
Labels
bug Something isn't working question Further information is requested

Comments

@LLouice
Copy link

LLouice commented Sep 10, 2021

这个设置 buffer local 变量的函数对于 false 的处理是有bug吧?

local function bind_option(options)
for k, v in pairs(options) do
if v == true or v == false then
vim.cmd('set ' .. k)
else
vim.cmd('set ' .. k .. '=' .. v)
end
end
end

@1096015776
Copy link
Contributor

Hi,thanks, I test it.
yes, there all setting is true
false is not work
maybe use vim.opt setting can work.
if you want to change these so easy
let vim.opt setting like wrap
vim.opt.wrap=false.
maybe just author's default settings,the setting is ok.
because no opt ,almost the opt is false.

@ayamir ayamir added invalid This doesn't seem right question Further information is requested and removed invalid This doesn't seem right labels Sep 10, 2021
@ayamir
Copy link
Owner

ayamir commented Sep 10, 2021

如果直接给我个pr就更好了

@LLouice
Copy link
Author

LLouice commented Sep 10, 2021

在我本地测试 buffer local 的 relative number 和 wrap 不生效,我改成了

local function bind_option(options)
    for k, v in pairs(options) do
        if v == true then
            vim.cmd('set ' .. k)
        elseif v == false then
            vim.cmd('set no' .. k)
        else
            vim.cmd('set ' .. k .. '=' .. v)
        end
    end
end

不知道是不是所有的 false 都可以通过no前缀设置,如果不是的话就使用 vim.opt

@LLouice
Copy link
Author

LLouice commented Sep 10, 2021

@ayamir 另外目前没有抽离出自定义的入口,我都是通过改动原文件修改的,这样同步github改动就很麻烦,希望作者添加一下个人自定义配置的 feature

@ayamir ayamir added the bug Something isn't working label Sep 10, 2021
@1096015776
Copy link
Contributor

you can fork the origin ,then add branch,when change,you can merge,as i know,it is easy to do it.
if you just want to add plugin,you can mkdir the dir to the module , that you can no merge

@LLouice
Copy link
Author

LLouice commented Sep 10, 2021

@1096015776 yes, we can do it by cloning a new local repo or creating a new branch.
But i think it's bettter if we have a entry for private config.
Personal configuration is not in git and has a higher priority than default.

@1096015776
Copy link
Contributor

yes,i think it is better,I just give you a temp answer to solve that.

@ayamir ayamir closed this as completed in c9a3c3e Sep 10, 2021
@ayamir
Copy link
Owner

ayamir commented Sep 10, 2021

@ayamir 另外目前没有抽离出自定义的入口,我都是通过改动原文件修改的,这样同步github改动就很麻烦,希望作者添加一下个人自定义配置的 feature

这个并不是我想做的,同时目前也没有精力去做,你想要的可能是lunarvim

vkingw pushed a commit to vkingw/nvimdots that referenced this issue Feb 7, 2023
YanTree pushed a commit to YanTree/nvim that referenced this issue Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants