Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gamunu/vscode.nvim
A `neovim` theme that highly restores `vscode`, so that your friends will no longer be surprised that you use `neovim`, because they will think you are using `vscode` ..
https://github.com/gamunu/vscode.nvim
Last synced: 25 days ago
JSON representation
A `neovim` theme that highly restores `vscode`, so that your friends will no longer be surprised that you use `neovim`, because they will think you are using `vscode` ..
- Host: GitHub
- URL: https://github.com/gamunu/vscode.nvim
- Owner: gamunu
- License: mpl-2.0
- Created: 2023-10-26T14:28:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-26T14:52:44.000Z (about 1 year ago)
- Last Synced: 2024-12-15T23:48:56.782Z (29 days ago)
- Size: 2.13 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
Neovim Vscode Theme
A `neovim` theme based on `visual studio code`, written in `Lua`.
It tries to get all the colors in `developer mode` of `vscode`, so the simulation is very high.
## Install and use
Install via `Lazy`:
```lua
-- lazy
{
"gamunu/vscode.nvim",
priority = 100,
config = function()
vim.cmd([[colorscheme vscode]])
end,
},
```Install via `Packer`:
```lua
-- packer
{
"gamunu/vscode.nvim",
config = function()
vim.cmd([[colorscheme vscode]])
end,
}
```## Default configuration
Default config, modify any option via `setup()`:
```lua
require("vscode").setup({
-- `dark` or `light`
mode = "dark",
-- Whether to load all color schemes
preset = true,
-- Whether to enable background transparency
transparent = false,
-- Whether to apply the adapted plugin
expands = {
hop = true,
dbui = true,
lazy = true,
aerial = true,
fidget = true,
null_ls = true,
nvim_cmp = true,
gitsigns = true,
which_key = true,
nvim_tree = true,
lspconfig = true,
telescope = true,
bufferline = true,
nvim_navic = true,
nvim_notify = true,
vim_illuminate = true,
nvim_treesitter = true,
nvim_ts_rainbow = true,
nvim_scrollview = true,
nvim_ts_rainbow2 = true,
indent_blankline = true,
vim_visual_multi = true,
},
hooks = {
before = function(conf, colors, utils) end,
after = function(conf, colors, utils) end,
},
})
```## Related functions
The plugin provides some utility functions:
```lua
require("vscode")
- get_config() -- current configuration table
- get_colors() -- current color highlight table
- get_lualine_sections() -- lualine sections table
- get_bufferline_right() -- bufferline custom right arearequire("vscode.utils")
- hl.set(name, options)
- hl.link(src, dst)
- hl.get(name, option)
- hl.bulk_set(groups)
```Example:
```lua
require("vscode.utils").hl.set("Normal", { fg = "#000000", bg = "#1E1E2E"})require("vscode.utils").hl.link("NormalFloat", "Normal")
require("vscode.utils").hl.get("Normal", "fg") -- #000000
require("vscode.utils").hl.bulk_set({
Normal = { fg = "#000000", bg = "#1E1E2E"},
NormalFloat = { link = "Normal" },
Cursor = { bg = "#0FE1EE", bold = true }
})
```## Hooks function
The plugin provides 2 hook functions, which are automatically executed before and after the color is applied:
```lua
hooks = {
before = function(conf, colors, utils) end,
after = function(conf, colors, utils) end,
}
```## Additional considerations
Regarding the `bufferline`, you need to make sure it has the `themable` option turned on:
```lua
require("bufferline").setup({
options = {
themable = true,
...
}
})
```If you need to use the `vim_visual_multi` plugin adaptation, please add the following code to your `init.lua` file:
```lua
vim.g.VM_Extend_hl = "VM_Extend_hl"
vim.g.VM_Cursor_hl = "VM_Cursor_hl"
vim.g.VM_Mono_hl = "VM_Mono_hl"
vim.g.VM_Insert_hl = "VM_Insert_hl"
```If you don't use `tmux`, try running `:set cmdheight=0`.
If some `nvim-web-devicons` icons do not display well in `light` mode, please tell me the name of the icon, and I will adapt it.
## Lualine integrated
To quickly get a `vscode` style statusline, you need to use `lualine`:
```lua
require("lualine").setup({
options = {
theme = "vscode",
icons_enabled = true,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {},
globalstatus = true,
refresh = {
statusline = 100,
},
},
sections = require("vscode").get_lualine_sections(),
})
```## Bufferline integrated
要快速获取 `vscode` 右上角的几个按钮,你可以向下面这样设置 `bufferline`:
```lua
require("bufferline").setup({
options = {
themable = true,
close_icon = "",
...
custom_areas = {
right = require("vscode").get_bufferline_right(),
},
}
})
```## Extension
Extended plugin colors are in the `expands` directory.
[lua/vscode/core/expands/](./lua/vscode/core/expands/)
Also, any new `PR`s are welcome, as I'm not enthusiastic about plugin adaptation, so may need everyone's help to make it better..
## Screenshot