SmiteshP / nvim-gps

Simple statusline component that shows what scope you are working inside
Apache License 2.0
478 stars 47 forks source link

Global config vs Lang config #97

Open rodhash opened 2 years ago

rodhash commented 2 years ago

Hi

Not sure whether this is an issue but am I not able to set "string-name" globally? Do I need to add this for each language if I wish to customize it?

In the README we have the following example:

require("nvim-gps").setup({

    disable_icons = false,           -- Setting it to true will disable all icons

    icons = {
        ["class-name"] = ' ',      -- Classes and class-like objects
        ["function-name"] = ' ',   -- Functions
        ["method-name"] = ' ',     -- Methods (functions inside class-like objects)
        ["container-name"] = '⛶ ',  -- Containers (example: lua tables)
        ["tag-name"] = '炙'         -- Tags (example: html tags)
    },

Adding ["string-name"] = ' ' in there doesn't work, tried opening yaml files but doesn't work.

It works only when adding a custom configuation for "yaml", like it's shown in the README:

    languages = {
        -- Some languages have custom icons
        ["yaml"] = {
            icons = {
                                ["mapping-name"] = ' ',
                                ["sequence-name"] = ' ',
                                ["null-name"] = '[] ',
                                ["boolean-name"] = 'ﰰﰴ ',
                                ["integer-name"] = '# ',
                                ["float-name"] = ' ',
                ["string-name"] = '    '
            }
        },

Is this expected? string-name can't be set globally for every language?

Thank you

SmiteshP commented 2 years ago

Yep, this is expected. Only class, function, method, container and tag name are global. However I can try to make this work for other names too.