在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):norcalli/nvim-base16.lua开源软件地址(OpenSource Url):https://github.com/norcalli/nvim-base16.lua开源编程语言(OpenSource Language):Lua 100.0%开源软件介绍(OpenSource Introduction):base16.luaProgrammatic lua library for setting base16 themes in Neovim. Demolocal theme_names = base16.theme_names()
base16_position = 1
function cycle_theme()
base16_position = (base16_position % #theme_names) + 1
base16(base16.themes[theme_names[base16_position]], true)
end UsageInstall via your plugin manager. e.g. Plug "norcalli/nvim-base16.lua" Basic usagelua << EOF
local base16 = require 'base16'
base16(base16.themes.brewer, true)
EOF This is how I use it. Uses lua << EOF
nvim = require 'nvim'
local base16 = require 'base16'
base16(base16.themes[nvim.env.BASE16_THEME or "3024"], true)
EOF You can define your own themes and use them with the APIbase16.apply_theme(theme_definition: dict, use_256_colorspace: bool)base16(theme_definition: dict, use_256_colorspace: bool)Alias for Example: base16(base16.themes["brewer"], true) base16.theme_names() -> stringReturn a list of all available theme names. Shortcut for fetching the keys from Example: print(vim.inspect(base16.theme_names())) base16.theme_from_array(theme_definition: array) -> dictFormats an array of 16 hex color strings into a dictionary suitable for use
with Example: local theme = base16.theme_from_array {
"383838"; "404040"; "606060"; "6f6f6f";
"808080"; "dcdccc"; "c0c0c0"; "ffffff";
"dca3a3"; "dfaf8f"; "e0cf9f"; "5f7f5f";
"93e0e3"; "7cb8bb"; "dc8cc3"; "000000";
}
base16(theme, true) Variablesbase16.themesDictionary of definitions to be used by Example: base16.themes["zenburn"] == {
base00 = "383838"; base01 = "404040"; base02 = "606060"; base03 = "6f6f6f";
base04 = "808080"; base05 = "dcdccc"; base06 = "c0c0c0"; base07 = "ffffff";
base08 = "dca3a3"; base09 = "dfaf8f"; base0A = "e0cf9f"; base0B = "5f7f5f";
base0C = "93e0e3"; base0D = "7cb8bb"; base0E = "dc8cc3"; base0F = "000000";
} NotesBecause this includes a copy of
Plug "norcalli/nvim.lua"
Plug "norcalli/nvim-base16.lua" CreditsChris Kempson and Base16 and base16-vim |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论