Code Monkey home page Code Monkey logo

vscode.nvim's Introduction

vscode.nvim

vscode.nvim (formerly codedark.nvim) is a Lua port of vim-code-dark colorscheme for neovim with VScode's light and dark theme

VSCode.nvim

Supported Plugins

⬇️ Installation

Install via package manager

-- Packer:
use 'Mofiqul/vscode.nvim'
" Vim-Plug:
Plug 'Mofiqul/vscode.nvim'

⚠️ Warnings

The theme is manipulating the treesitter highlight queries as follows:

JavaScript and TypeScript

[
  "export"
] @keyword.import

[
  "break"
] @keyword.repeat

[
  "break"
] @keyword.conditional

this mimics the behavior of VSCode's default theme more closely. Be aware that this is not a perfect solution but as far as we know, there is no better way to achieve this and most popular themes are doing the same thing.

🚀 Usage

-- Lua:
-- For dark theme (neovim's default)
vim.o.background = 'dark'
-- For light theme
vim.o.background = 'light'

local c = require('vscode.colors').get_colors()
require('vscode').setup({
    -- Alternatively set style in setup
    -- style = 'light'

    -- Enable transparent background
    transparent = true,

    -- Enable italic comment
    italic_comments = true,

    -- Underline `@markup.link.*` variants
    underline_links = true,

    -- Disable nvim-tree background color
    disable_nvimtree_bg = true,

    -- Override colors (see ./lua/vscode/colors.lua)
    color_overrides = {
        vscLineNumber = '#FFFFFF',
    },

    -- Override highlight groups (see ./lua/vscode/theme.lua)
    group_overrides = {
        -- this supports the same val table as vim.api.nvim_set_hl
        -- use colors from this colorscheme by requiring vscode.colors!
        Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true },
    }
})
-- require('vscode').load()

-- load the theme without affecting devicon colors.
vim.cmd.colorscheme "vscode"

If you are using lualine, you can also enable the provided theme:

require('lualine').setup({
    options = {
        -- ...
        theme = 'vscode',
        -- ...
    },
})

nvim-bufferline.lua setup for exact match as screenshots

require("bufferline").setup({
    options = {
        buffer_close_icon = "",
        close_command = "bdelete %d",
        close_icon = "",
        indicator = {
          style = "icon",
          icon = " ",
        },
        left_trunc_marker = "",
        modified_icon = "",
        offsets = { { filetype = "NvimTree", text = "EXPLORER", text_align = "center" } },
        right_mouse_command = "bdelete! %d",
        right_trunc_marker = "",
        show_close_icon = false,
        show_tab_indicators = true,
    },
    highlights = {
        fill = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLineNC" },
        },
        background = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLine" },
        },
        buffer_visible = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        buffer_selected = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        separator = {
            fg = { attribute = "bg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLine" },
        },
        separator_selected = {
            fg = { attribute = "fg", highlight = "Special" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        separator_visible = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLineNC" },
        },
        close_button = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLine" },
        },
        close_button_selected = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        close_button_visible = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
    },
})

Switching theme

:lua require('vscode').load('light')
:lua require('vscode').load('dark')

🍭 Extra folder

Something is broken but I know how to fix it!

Pull requests are welcome! Feel free to send one with an explanation!

vscode.nvim's People

Contributors

4lxs avatar alvaroping1 avatar andis-sprinkis avatar baco-ceg avatar barbmich avatar bryankenote avatar bukata-sa avatar daephx avatar david-else avatar deforde avatar devadathanmb avatar enochmtzr avatar flamarique avatar fnune avatar gepbird avatar johannesrld avatar mofiqul avatar pixelino avatar pysan3 avatar realh avatar rockyzhang24 avatar rykersun avatar saccarosium avatar sand4rt avatar teamtamoad avatar vytautast avatar wongjiahau avatar xyven1 avatar yochem avatar ztnel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode.nvim's Issues

Markdown inline code highlighted

Hi! Thanks for this great plugin.

I wrote code in markdown. It had inline code, something like this in file hello.md:

This is `some` code.

Is it possible to make some highlighted? Currently it's not highlighted.

Thanks.

Configuration into init.vim

How can I configure in the init.vim? I configured like that ant it works:

init.vim:

call plug#begin('~/.vim/plugged')

Plug 'Mofiqul/vscode.nvim'

call plug#end()

colorscheme vscode

But, I dont know how can I change configurations of the theme.

[Feature Request] Update to Neovim 0.7 nvim_set_hl

EDIT: Here is an example of a before and after: tiagovla/tokyodark.nvim@e505c2b

I think since 0.7 came out the entire theme can be Lua now:

https://neovim.io/news/

Finally, users can now use the API function nvim_set_hl to modify global highlight groups (the equivalent of using :hi), opening the door to pure-Lua colorschemes.

https://neovim.io/doc/user/api.html

nvim_set_hl({ns_id}, {name}, {*val})                           *nvim_set_hl()*
                Sets a highlight group.

                Note:
                    Unlike the `:highlight` command which can update a
                    highlight group, this function completely replaces the
                    definition. For example: `nvim_set_hl(0, '[Visual](https://neovim.io/doc/user/visual.html#Visual)', {})`
                    will clear the highlight group '[Visual](https://neovim.io/doc/user/visual.html#Visual)'.

                Note:
                    The fg and bg keys also accept the [string](https://neovim.io/doc/user/eval.html#string) values `"fg"` or
                    `"bg"` which act [as](https://neovim.io/doc/user/motion.html#as) aliases to the corresponding
                    foreground and background values of the [Normal](https://neovim.io/doc/user/intro.html#Normal) group. If
                    the [Normal](https://neovim.io/doc/user/intro.html#Normal) group has not been defined, using these values
                    results in an error.

                Parameters: 
                    {ns_id}  Namespace id for this highlight
                             |[nvim_create_namespace()](https://neovim.io/doc/user/api.html#nvim_create_namespace())|. Use 0 to set a
                             highlight group globally |[:highlight](https://neovim.io/doc/user/syntax.html#:highlight)|.
                    {name}   Highlight group name, e.g. "ErrorMsg"
                    {val}    Highlight definition map, accepts the following
                             keys:
                             • fg (or foreground): color name or "#RRGGBB",
                               see note.
                             • bg (or background): color name or "#RRGGBB",
                               see note.
                             • sp (or special): color name or "#RRGGBB"
                             • blend: integer between 0 and 100
                             • [bold](https://neovim.io/doc/user/syntax.html#bold): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [standout](https://neovim.io/doc/user/syntax.html#standout): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [underline](https://neovim.io/doc/user/syntax.html#underline): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [underlineline](https://neovim.io/doc/user/syntax.html#underlineline): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [undercurl](https://neovim.io/doc/user/syntax.html#undercurl): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [underdot](https://neovim.io/doc/user/syntax.html#underdot): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [underdash](https://neovim.io/doc/user/syntax.html#underdash): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [strikethrough](https://neovim.io/doc/user/syntax.html#strikethrough): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [italic](https://neovim.io/doc/user/syntax.html#italic): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • reverse: [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • [nocombine](https://neovim.io/doc/user/syntax.html#nocombine): [boolean](https://neovim.io/doc/user/options.html#boolean)
                             • link: name of another highlight group to link
                               to, see |[:hi-link](https://neovim.io/doc/user/syntax.html#:hi-link)|. Additionally, the following
                               keys are recognized:
                             • default: Don't override existing definition
                               |[:hi-default](https://neovim.io/doc/user/syntax.html#:hi-default)|
                             • ctermfg: Sets foreground of cterm color
                               |[highlight-ctermfg](https://neovim.io/doc/user/syntax.html#highlight-ctermfg)|
                             • ctermbg: Sets background of cterm color
                               |[highlight-ctermbg](https://neovim.io/doc/user/syntax.html#highlight-ctermbg)|
                             • cterm: cterm attribute map, like
                               |[highlight-args](https://neovim.io/doc/user/syntax.html#highlight-args)|. If not set, cterm attributes
                               will match those from the attribute map
                               documented above.

C# colors don't match

This image is from VSCode:
image

This image is from Mofiqul/vscode.nvim:
image

As you can see, most of the pink colors in the plugin are blue in VSCode. Is it posible to fix it?

Semantic Token support

There appears to be some kind of issue with sematic tokens when using vscode.nvim.
This is how code is highlighted when just using Treesitter:
image

But when enabling the neovim lsp this is what I end up with
image

The semantic tokens in the lsp are only supposed to make minor corrections to highlighting based on information that only the lsp has access to, and so everything becoming the dark blue highlight color is not desirable.

Markdown Headings should be blue + Html Headings should not be bold

In a markdown buffer the following highlight groups are loaded

-- command mode
:filter /markdown/ hi

-- output:
markdownHeadingDelimiter xxx guifg=#569cd6

markdownH1     xxx links to htmlH1
markdownH2     xxx links to htmlH2
markdownH3     xxx links to htmlH3
markdownH4     xxx links to htmlH4
markdownH5     xxx links to htmlH5
markdownH6     xxx links to htmlH6

markdownHeadingRule xxx links to markdownRule
markdownH1Delimiter xxx links to markdownHeadingDelimiter
markdownH2Delimiter xxx links to markdownHeadingDelimiter
markdownH3Delimiter xxx links to markdownHeadingDelimiter
markdownH4Delimiter xxx links to markdownHeadingDelimiter
markdownH5Delimiter xxx links to markdownHeadingDelimiter
markdownH6Delimiter xxx links to markdownHeadingDelimiter
markdownHighlight_html xxx cleared
markdownHighlight_python xxx cleared
markdownHighlight_vim xxx cleared
markdownHighlight_cpp xxx cleared
markdownHighlight_c xxx cleared
markdownHighlight_sh xxx cleared

Highlight links starting from markdownH1:

markdownH1 -> htmlH1 -> Title (white and bold)

In VSCode, the headings (markdown) are blue, but in the colorscheme they are white. So markdownH1, markdownH2, ... should be blue. Further, html headings in VSCode are white and regular, but they are (white) bold (inheriting from Title) in the colorscheme. So, I propose add something similar to the following to the theme.lua

...

    -- Markdown
    ...
    hl(0, 'markdownH1', { fg = isDark and c.vscBlue, bold = true })
    hl(0, 'markdownH2', { fg = isDark and c.vscBlue, bold = true })
    hl(0, 'markdownH3', { fg = isDark and c.vscBlue, bold = true })
    hl(0, 'markdownH4', { fg = isDark and c.vscBlue, bold = true })
    hl(0, 'markdownH5', { fg = isDark and c.vscBlue, bold = true })
    hl(0, 'markdownH6', { fg = isDark and c.vscBlue, bold = true })

...

    -- HTML
    hl(0, 'htmlH1', { bold = false })
    hl(0, 'htmlH2', { bold = false })
    hl(0, 'htmlH3', { bold = false })
    hl(0, 'htmlH4', { bold = false })
    hl(0, 'htmlH5', { bold = false })
    hl(0, 'htmlH6', { bold = false })

...

  • I'm using the latest version of this theme
  • I'm not using treesitter

Correct diagnostics keys for Neovim's devel version (0.6.x)

Diagnostics keys have changed from 0.5.1 to the current devel version of Neovim (0.6.0), and now, LspDiagnosticsDefaultError has become DiagnosticError; LspDiagnosticsDefaultWarning has become DiasnoticWarn; LspDiagnosticsUnderlineError has become DiagnosticUnderlineError; and so forth.

Without that support colors for diagnostics look like vanilla Neovim in devel version.

Specifying a group_override dependent on a color_override doesn't work

For example,

local c = require('vscode.colors')
require('vscode').setup({
    color_overrides = {
        vscGray = '#ff0000'
    },
    group_overrides = {
        StatusLine = { fg = c.vscGray, bg = c.vscGray }
    }
}

This will display the status line as grey, not red.

This makes sense as we're accessing the old version of c.vscGray in the group_overrides table, but also it seems sensible to provide a way to add group overrides after adding colour overrides, to avoid this issue.

P.S. I really appreciate this new setup system! Very pleased to be moving my modifications over to the setup function over manually hacking at the files and hackily symlinking my new versions into the cloned repo...

python system libs are not highlighted?

Followed this issue #85

I applied these changes (override thing), but system libs from python are still not highlighed correctly, although I've installed treesitter. Do I need to overwrite smth else too?

my current init.vim settings


set nocompatible
filetype off
"set rtp+=~/.vim/bundle/Vundle.vim
"call vundle#begin()
"Plugin 'VundleVim/Vundle.vim'
"Plugin 'Valloric/YouCompleteMe'
"Plugin 'scrooloose/nerdtree'
"Plugin 'majutsushi/tagbar'
"Plugin 'jiangmiao/auto-pairs'
"Plugin 'vim-syntastic/syntastic'
"Plugin 'vim-airline/vim-airline'
"Plugin 'morhetz/gruvbox'
"call vundle#end()

call plug#begin(stdpath('data') . '/plugged')
 "If you want to have icons in your statusline choose one of these
  Plug 'kyazdani42/nvim-web-devicons'
  Plug 'Mofiqul/vscode.nvim'
  Plug 'nvim-lualine/lualine.nvim'
  Plug 'akinsho/bufferline.nvim', { 'tag': 'v3.*' }
  Plug 'preservim/nerdtree'
  Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
  Plug 'neovim/nvim-lspconfig'
call plug#end()

filetype plugin indent on
set expandtab
set smarttab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set number
set foldcolumn=2
syntax on
set mouse=a
set ignorecase
set smartcase
set hlsearch
set incsearch
set encoding=utf8
nmap <F6> :NERDTreeToggle<CR>
inoremap <C-v> <ESC>"+pa
vnoremap <C-c> "+y
vnoremap <C-d> "+d
nnoremap <C-Z> u
nnoremap <C-Y> <C-R>
set ffs=unix,dos,mac

set termguicolors
lua << EOF
-- Lua:
-- For dark theme (neovim's default)
vim.o.background = 'dark'
-- For light theme
vim.o.background = 'light'

local c = require('vscode.colors').get_colors()
require('vscode').setup({
    -- Alternatively set style in setup
    -- style = 'light'

    -- Enable transparent background
    transparent = true,

    -- Enable italic comment
    italic_comments = true,

    -- Disable nvim-tree background color
    disable_nvimtree_bg = true,

    -- Override colors (see ./lua/vscode/colors.lua)
    color_overrides = {
        vscLineNumber = '#FFFFFF',
    },

    -- Override highlight groups (see ./lua/vscode/theme.lua)
    group_overrides = {
        -- this supports the same val table as vim.api.nvim_set_hl
        -- use colors from this colorscheme by requiring vscode.colors!
        Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true },
    }
})
require('vscode').load()

require("bufferline").setup({
    options = {
        buffer_close_icon = "",
        close_command = "Bdelete %d",
        close_icon = "",
        indicator = {
          style = "icon",
          icon = " ",
        },
        left_trunc_marker = "",
        modified_icon = "●",
        offsets = { { filetype = "NvimTree", text = "EXPLORER", text_align = "center" } },
        right_mouse_command = "Bdelete! %d",
        right_trunc_marker = "",
        show_close_icon = false,
        show_tab_indicators = true,
    },
    highlights = {
        fill = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLineNC" },
        },
        background = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLine" },
        },
        buffer_visible = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        buffer_selected = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        separator = {
            fg = { attribute = "bg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLine" },
        },
        separator_selected = {
            fg = { attribute = "fg", highlight = "Special" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        separator_visible = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLineNC" },
        },
        close_button = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "StatusLine" },
        },
        close_button_selected = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
        close_button_visible = {
            fg = { attribute = "fg", highlight = "Normal" },
            bg = { attribute = "bg", highlight = "Normal" },
        },
    },
})
require('lualine').setup({
    options = {
        -- ...
        theme = 'vscode',
        -- ...
    },
})
if "vscode" == vim.g.colors_name then
    require("vscode").setup({
        group_overrides = {
            TSConstant = { fg = "#4fc1ff" },
        },
    })

require('vscode').load('dark')

end
EOF
lua require'nvim-treesitter.install'.prefer_git = true
lua require'nvim-treesitter.configs'.setup{highlight={enable=true}} 

image

python colors for constants and modules are not unique, and dont match VSCode's real colors

The color of imported modules in python is identical to the color of regular local variables.
Also, the color for CONSTANTS is identical to the color of regular functions

example - left is neovim, right is VSCode
image image

This issue isnt about being 100% identical to VSCode, but about having unique colors for constants and modules which is nice.
I do have treesitter installed.

Background transparency setting broken

Until 2 days ago I used to have the following working settings:
init.vim:

let g:vscode_style = 'dark'
let g:vscode_transparent = v:true

silent! colorscheme vscode

but, as I only wanted background transparency on terminals and not on other UIs, I also had:
ginit.vim:

if exists('g:colors_name') && g:colors_name == 'vscode'
	let g:vscode_transparent = v:false
	syntax reset
endif

all working like a charm. Transparent background on terminals default VSCode-like background otherwise.

After a recent merge, both settings stopped working. The documentation about them is gone, and there is no indication on how to keep having the settings in vim-script as it used to.

Cursor is pitch black when used with LazyVim

Don't know if LazyVim is the problem here. The cursor is close to invisible:
image

Me config (LazyVim does some magic setup stuff):

return {
  { "Mofiqul/vscode.nvim" },
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "vscode",
    },
  },
}

Setup not working

I try it's not working.

color_overrides = {
        vscLineNumber = '#FF0000',
    },

I fork this repository.
Add these code in line 25.

-- /lua/vscode/init.lua.
if next(user_opts) then
    print(user_opts.color_overrides.vscLineNumber)
else
    print(nil)
end

Result is #FF0000 and nil ,so I think setup will be called twice(First with my configuration).

I comment out /colors/vscode.vim ,result will be #FF0000 only and works as expected.

vscode

I want to know what's wrong with my configuration.

[Regression] Vimscript options broken

At commit 7d3899b (@daephx) the colorscheme got broken, later on, at commit 2c68d2a (@hewenjin) the error tried to be fixed; and between both commits options being passed in vimscript fashion stopped to work.

I have the following vimscript configuration:

let g:vscode_transparent = v:true
let g:vscode_italic_comment = v:true

that was working before the first of the commits, and didn't work anymore after de latter.

Invalid character group name

Hello Team,

I am getting an error when trying to use the plugin, I am a novice at nvim but I isolated the problem as much as possible this is what's in my config.

vim.o.background = 'dark'
require('vscode').setup{}

this was stripped from the documentation

I am using packer to install the plugin
this is the error message
Screen Shot 2022-10-17 at 10 23 57 AM

The odd part is I am getting the theme to work but I continue to get this error every time I open nvim

[Bug] Lualine does not respect transparency

My vscode.nvim lua configuration:

require('vscode').setup {
    transparent = true,
}

My lualine configuration:

require('lualine').setup {
    options = {
        theme = 'vscode'
    }
}

With this configuration, one would expect that lualine's colors.bg variable would be transparent - but that is not the case.

Setting colors.bg = '#00000000' in vscode.nvim/lua/lualine/themes/vscode.lua (in my nvim data directory) successfully opaques lualine's background, but it would be nice for this "feature" to be added in this repository.

I am not very familiar with the source code of vscode.nvim nor lualine, but with a little bit of guidance, I would be happy to implement this feature and test it, before submitting a pull request.

Before I do so, how would it be possible to check if vscode.nvim's transparency setting is set to true in vscode.nvim/lua/lualine/themes/vscode.lua? I have noticed that there is a vim.g.vscode_transparent option in vscode.nvim/lua/vscode/init.lua, but further guidance is needed.

Looking forward on collaborating and contributing!

Please add syntax support for C/C++

The coloursheme for C/C++ doesn't seem quite right - I attached a screen-shot. The colors.lua file doesn't seem to have the bright green and yellow colours which are causing the issue. So I am guessing we need to add a C++ theme in theme.lua?

Screenshot from 2021-08-16 19-37-26

Help configuration

I copied the code examples from the documentation and now when I start neovim I get a bunch of errors, help me with the configuration, I don't understand what I'm doing at all...
Using gui, guifg, guibg, guisp` is deprecated please, convert these as follows:

  • guifg -> fg
  • guibg -> bg
  • guisp -> sp
  • gui -> underline = true, undercurl = true, italic = true
    see :help bufferline-highlights for more details on how to update your highlights
    Please fix:
  • buffer_visible
  • buffer_selected packer.nvim: Error running config for vscode.nvim: /home/mitai/.config/nvim/lua/plugins/vscode.lua:
    9: module 'colors' not found:
    ^Ino field package.preload['colors']
    ^Ino file '/home/linuxbrew/.linuxbrew/share/lua/5.1/colors.lua'
    ^Ino file '/home/linuxbrew/.linuxbrew/share/lua/5.1/colors/init.lua'
    ^Ino file '/home/mitai/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/colors.lua'
    ^Ino file '/home/mitai/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/colors/init.lua'
    ^Ino file '/home/mitai/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/colors.lua'
    ^Ino file '/home/mitai/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/colors/init.
    lua'
    ^Ino file './colors.so'
    ^Ino file '/usr/local/lib/lua/5.1/colors.so'
    ^Ino file '/home/linuxbrew/.linuxbrew/lib/lua/5.1/colors.so'
    ^Ino file '/usr/local/lib/lua/5.1/loadall.so'`
    my files
    bufferline.txt
    colors.txt
    vscode.txt

bug: error detected

Error log

Error detected while processing /root/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /root/.config/nvim/init.lua:145: Vim(lua):E5108: Error executing lua /root/.c
onfig/nvim/plugged/vscode.nvim/lua/vscode/theme.lua:545: invalid key: 1
stack traceback:
        [C]: in function 'hl'
        /root/.config/nvim/plugged/vscode.nvim/lua/vscode/theme.lua:545: in function 'load_syntax'
        /root/.config/nvim/plugged/vscode.nvim/lua/vscode/utils.lua:14: in function 'load'
        /root/.config/nvim/plugged/vscode.nvim/lua/vscode/init.lua:9: in function 'set'
        [string ":lua"]:2: in main chunk
        [C]: in function 'cmd'
        /root/.config/nvim/init.lua:145: in main chunk
stack traceback:
        [C]: in function 'cmd'
        /root/.config/nvim/init.lua:145: in main chunk

Config

-- init.lua
vim.o.background = "light"
vim.g.vscode_transparent = 1
vim.cmd [[colorscheme vscode]]

Environment

nvim -v:

NVIM v0.7.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/neovim/build/config -I/neovim/src -I/neovim/.deps/usr/include -I/usr/include -I/neovim/build/src/nvim/auto -I/neovim/build/include
Compiled by root@6b760a75b4d6

Offending commit

After git bisect, I found the offending commit to be d3802df.

Selection is ignoring customized ":listchars"

The issue reported on tomasiser/vim-code-dark#92:

This plugin is experiencing the same problems.

Steps to reproduce

  1. :set listchars=eol:¶,tab:→\ ,trail:▷,nbsp:•,space:␣,precedes:«,extends:»
  2. Try selecting the following text:
# Where does it come from?

Contrary to popular belief, Lorem Ipsum is not simply random text.

It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.

Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.

Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.

This book is a treatise on the theory of ethics, very popular during the Renaissance.

The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.

Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H.

Rackham.

The fix from tomasiser/vim-code-dark#96 has been merged.

Before

image

After

image

Search and IncSearch highlights aren't correct

If I search for "append" and select some of the text, this is the result:
image
It's difficult to know what I've selected.

This is how it looks in VSCode:
image

Seems like the IncSearch color isn't entirely correct either.

Nvim:
image

Vscode:
image

Add LSP diagnostics for Bufferline

After an afternoon of operations, I'm sure it's fine:

require("bufferline").setup(
    {
        options = {
            -- The number of lines to show in the buffer.
            numbers = "ordinal",
            -- diagnostics source
            diagnostics = "nvim_lsp",
            -- built-in icons
            indicator_icon = " ",
            buffer_close_icon = "",
            modified_icon = "●",
            close_icon = "",
            left_trunc_marker = "",
            right_trunc_marker = "",
            -- split style:"slant" | "thick" | "thin"
            -- separator_style = "thin",
            -- show diagnostics icons
            ---@diagnostic disable-next-line: unused-local
            diagnostics_indicator = function(count, level, diagnostics_dict, context)
                local c = ""
                if diagnostics_dict.error then
                    c = c .. diagnostics_dict.error
                elseif diagnostics_dict.warning then
                    c = c .. diagnostics_dict.warning
                elseif diagnostics_dict.info then
                    c = c .. diagnostics_dict.info
                elseif diagnostics_dict.hint then
                    c = c .. diagnostics_dict.hint
                end
                return c
            end,
            -- The left side yields the position of the NvimTree
            offsets = {
                {
                    filetype = "NvimTree",
                    text = "File Explorer",
                    highlight = "Directory",
                    text_align = "left"
                },
                {
                    filetype = "undotree",
                    text = "History Explorer",
                    highlight = "Directory",
                    text_align = "left"
                },
                {
                    filetype = "dbui",
                    text = "Database Explorer",
                    highlight = "Directory",
                    text_align = "left"
                },
                {
                    filetype = "spectre_panel",
                    text = "Project Blurry Search",
                    highlight = "Directory",
                    text_align = "left"
                },
                {
                    filetype = "aerial",
                    text = "Outline Explorer",
                    highlight = "Directory",
                    text_align = "center"
                }
            }
        },
        highlights = {
            fill = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLineNC"}
            },
            background = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLine"}
            },
            buffer_visible = {
                gui = "",
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "Normal"}
            },
            buffer_selected = {
                gui = "",
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "Normal"}
            },
            separator = {
                guifg = {attribute = "bg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLine"}
            },
            separator_selected = {
                guifg = {attribute = "fg", highlight = "Special"},
                guibg = {attribute = "bg", highlight = "Normal"}
            },
            separator_visible = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLineNC"}
            },
            close_button = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLine"}
            },
            close_button_selected = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "Normal"}
            },
            close_button_visible = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "Normal"}
            },
            --
            diagnostic = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLine"}
            },
            diagnostic_visible = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLine"}
            },
            diagnostic_selected = {
                guifg = {attribute = "fg", highlight = "Normal"},
                guibg = {attribute = "bg", highlight = "StatusLine"}
            },
            -- hint
            hint = {
                guifg = {attribute = "fg", highlight = "DiagnosticHint"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            hint_diagnostic = {
                guifg = {attribute = "fg", highlight = "DiagnosticHint"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            hint_selected = {
                gui = "NONE"
            },
            hint_diagnostic_selected = {
                gui = "NONE"
            },
            -- info
            info = {
                guifg = {attribute = "fg", highlight = "DiagnosticInfo"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            info_diagnostic = {
                guifg = {attribute = "fg", highlight = "DiagnosticInfo"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            info_selected = {
                gui = "NONE"
            },
            info_diagnostic_selected = {
                gui = "NONE"
            },
            -- warning
            warning = {
                guifg = {attribute = "fg", highlight = "DiagnosticWarn"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            warning_diagnostic = {
                guifg = {attribute = "fg", highlight = "DiagnosticWarn"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            warning_selected = {
                gui = "NONE"
            },
            warning_diagnostic_selected = {
                gui = "NONE"
            },
            -- error
            error = {
                guifg = {attribute = "fg", highlight = "DiagnosticError"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            error_diagnostic = {
                guifg = {attribute = "fg", highlight = "DiagnosticError"},
                guibg = {attribute = "bg", highlight = "StatusLine"},
                guisp = {attribute = "bg", highlight = "StatusLine"}
            },
            error_selected = {
                gui = "NONE"
            },
            error_diagnostic_selected = {
                gui = "NONE"
            }
        }
    }
)

Suggestion: rename to vscode-light.nvim

Problem

Currently this repository is almost unsearchable from Google and DuckDuckGo. Even in Github, it is not apparent.

image

image

image

Suggestion

Rename to something like vscode-light.nvim or vim-code-light (contrary to vim code dark).

Highlighting in light version is unreadable, while in dark it works

Hello!

I have been using the dark version of the theme and it has been really nice!

Today I switched to the light version and everything seems to work but the highlighting for LSP seems off. I wasn't able to read anything with it.

VScode_theme_light_highlighting_issue

(I think in VScode the light theme uses a blue highlight)

Need info

Hey Mofiqul, how can I use galaxyline config in extra directory?

Cannot switch style to light / dark

The theme doesn't completely update when running lua require('vscode').change_style('dark') after initialization. The only thing that seems to update is my lualine and a few other highlights.

This is what it looks like when starting with dark style and applying the light style:
image

Bufferline is outdated: Readme is incorrect

The configuration of the readme is outdated regarding bufferline package. Please use a specific version of bufferline and/or update the Readme.

Using `gui`, `guifg`, `guibg`, `guisp` is deprecated please, convert these as follows:
- guifg -> fg
- guibg -> bg
- guisp -> sp
- gui -> underline = true, undercurl = true, italic = true
 see :help bufferline-highlights for more details on how to update your highlights
Please fix:
- buffer_visible

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.