GithubHelp home page GithubHelp logo

`setup()` refactoring about onedark.nvim HOT 20 CLOSED

navarasu avatar navarasu commented on June 15, 2024 1
`setup()` refactoring

from onedark.nvim.

Comments (20)

navarasu avatar navarasu commented on June 15, 2024 2

Today I added better screenshots for the existing dark themes in the NEW_README .

Next, I will update the configuration section for the new config based on the above discussion.

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024 1

@navarasu I agree
Since in this period I'm busy I won't finish my PR these days, so we'll have to wait a bit before it gets ready to be merged

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024 1

Not meaningful. Nvim means it as highlight attributes for cterm.

If you scroll down a bit (or :h highlight-gui) you'll see that these attributes are the same for cterm and gui

What about text_format or text_style?

Good, but what about code_style?

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024 1

Today I added better screenshots for the existing dark themes in the NEW_README .

Next, I will update the configuration section for the new config based on the above discussion.

Looks great!

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

Let's not break existing configs. We can support both legacy and new options. But we can remove the old config details from README.

" Option 1  - Old one  (Priority 2)
let g:onedark_style = 'darker'
let g:onedark_transparent_background = v:true

" Option 2 (Priority 1)
let g:onedark_option = { 'theme':  'darker',  transparent: v:true }
colorscheme onedark
-- Option 3  - Old one (Priority 2)
vim.g.onedark_style = 'deep'
vim.g.onedark_italic_comment = false

-- Option 4 (Priority 1)
 require('onedark').setup {
       theme = 'darker',
       transparent = true,
       toggle_theme_key = '<leader>ct',
       terminal_colors = true, -- True enable the terminal
       hide_ending_tilde = true
       styles = {
         comment = 'italic'
       },
       diagnostics = {
         undercurl = true,
         darker_color = true
       }
 }

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024

So you'd like to keep g:onedark_* options?
Maybe we could keep them for a month or so, printing warning messages to tell users that these options will be deprecated in favor of the config dictionary (g:onedark_setup or g:onedark_options) or the lua setup() function...

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

Yes. We can print a deprecated message and support g:onedark_* options for the next 4 months. So we support both options with the above said priority

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

@xeluxee As part of this ticket, we can just implement new setup option and support existing config. No need to solve the issues mentioned in description. We can do that after you complete this migration.

Meanwhile I will work on transparency based on float value and adding light theme.

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024

Before proceeding, can you tell me if this dictionary looks good or if you have any setting to add?

local default_config = {
    toggle_style_keymap = '<leader>cs',
    italics = {
        comments = true,
        keywords = false,
        functions = false,
        strings = false,
        variables = false
    },
    bolds = {
        comments = false,
        keywords = true,
        functions = false,
        strings = false,
        variables = false
    },
    contrast_windows = {
        -- specify which windows get the contrasted (darker) background
        "NvimTree",
        "terminal",
        "packer",
        "qf",
    },
    diagnostics = {
        darker = true,        -- darker colors for diagnostics
        undercurl = true,     -- use undercurl for diagnostics
        background = true,    -- use background color for virtual text
    },
    disable = {
        background = false,     -- don't set background (NeoVim then uses your teminal background). If you want transparent background set it to true and enable transparency in your terminal's settings
        term_colors = false,    -- prevent the theme from setting terminal colors
        eob_lines = false       -- hide the end-of-buffer tildes
    },

    custom_highlights = {}
}

This configuration was heavily inspired by material.nvim

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

@xeluxee Looks fine. But we can avoid too many child parents. This nightfox.nvim config looks cleaner.

Let's have a config like this,

local default_config = { 
    -- Main options --
     theme = 'dark', 
     transparent = false,  -- don't set background 
     term_colors = true, -- True enable the terminal
     ending_tilde = false,  -- show the end-of-buffer tildes
     toggle_theme_key = '<leader>ct',

     -- Changing Styles --
     styles = {
       comment = 'italic',
       keywords = 'NONE',
       functions = 'NONE',
       strings = 'NONE',
       variables = 'NONE'
     },

    -- Custom Highlights --
     colors = {}, -- Override default colors
     highlights = {}, -- Override highlight groups

    -- Plugins Related --
     diagnostics = {
        darker = true, -- darker colors for diagnostic
        undercurl = true,   -- use undercurl for diagnostics
        background = true,    -- use background color for virtual text
     },
 }

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024
toggle_theme_key

Wouldn't toggle_style_key be better? Since that keymap doesn't change theme but it changes onedark style

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

Yeah. You are right. Lets keep it as toggle_style_key. Also, we can change the theme to style. Then styles params have to be changed. So we can call it format.
Then the config will be as,

local default_config = { 
    -- Main options --
     style = 'dark', 
     toggle_style_key = '<leader>ts',
     toggle_style_list = ['dark', 'darker', 'cool, 'deep', 'warm', 'warmer'],
     transparent = false,  -- don't set background 
     term_colors = true, -- True enable the terminal
     ending_tilde = false,  -- show the end-of-buffer tildes

     -- Changing Formats --
     format = {
       comment = 'italic',
       keywords = 'NONE',
       functions = 'NONE',
       strings = 'NONE',
       variables = 'NONE'
     },

    -- Custom Highlights --
     colors = {}, -- Override default colors
     highlights = {}, -- Override highlight groups

    -- Plugins Related --
     diagnostics = {
        darker = true, -- darker colors for diagnostic
        undercurl = true,   -- use undercurl for diagnostics
        background = true,    -- use background color for virtual text
     },
 }

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024

https://neovim.io/doc/user/syntax.html#attr-list

What about changing format to attributes or hlattributes?

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

Not meaningful. Nvim means it as highlight attributes for cterm.
What about text_format or text_style? I remember a very old vim plugin with that name like txtfmt

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024

And what about contrast_windows?

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

And what about contrast_windows?

That we can implement pluginwize later and I have other bigger ideas. Planning to add multiple styles for lualine, nvimtree, etc.

First, we can implement existing configs and bring in this new setup concept. Then we can add necessary features one by one like custom highlights, text formatting, etc.

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

Good, but what about code_style?

Yes. Meaningful

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024

<a href="https://github.com/navarasu/onedark.nvim/#installation">Installation</a>

Instead why not using [Installation](#installation)? This is a markdown notation, so the page isn't reloaded

from onedark.nvim.

navarasu avatar navarasu commented on June 15, 2024

@xeluxee I am a little free for the next two days. Shall I work on this ticket?

from onedark.nvim.

xeluxee avatar xeluxee commented on June 15, 2024

I'll be available for this in two weeks or so
@navarasu sorry for the delay but in this period I'm really busy

Shall I work on this ticket?

If you wish you can start refactoring or making light theme in the meantime

from onedark.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.