Tema Neovim gelap dan terang yang ditulis dalam Lua porting dari tema Visual Studio Code TokyoNight. Termasuk tema tambahan untuk Kitty, Alacritty, iTerm dan Fish.
Bulan | Badai |
---|---|
Malam | Hari |
Pengaya | Sumber |
---|---|
aerial.nvim | aerial |
bir putih | ale |
alpha-nvim | alpha |
barbar.nvim | barbar |
berkedip.cmp | blink |
bufferline.nvim | bufferline |
nvim-cmp | cmp |
codeium.nvim | codeium |
kopilot.lua | copilot |
nvim-dap | dap |
dasbor-nvim | dashboard |
flash.nvim | flash |
fzf-lua | fzf |
vim-gitgutter | gitgutter |
gitsigns.nvim | gitsigns |
mesin terbang-palette.vim | glyph-palette |
grug-far.nvim | grug-far |
headline.nvim | headlines |
hop.nvim | hop |
vim-menerangi | illuminate |
indent-blankline.nvim | indent-blankline |
indentmini.nvim | indentmini |
malas.nvim | lazy |
lompatan.nvim | leap |
lspsaga.nvim | lspsaga |
mini.animate | mini_animate |
mini.petunjuk | mini_clue |
mini.penyelesaian | mini_completion |
mini.kata kursor | mini_cursorword |
mini.deps | mini_deps |
mini.diff | mini_diff |
mini.files | mini_files |
mini.hipatterns | mini_hipatterns |
mini.ikon | mini_icons |
mini.indentscope | mini_indentscope |
mini.lompat | mini_jump |
mini.peta | mini_map |
mini.notify | mini_notify |
mini.operator | mini_operators |
mini.pilih | mini_pick |
mini.starter | mini_starter |
mini.statusline | mini_statusline |
mini.surround | mini_surround |
mini.tabline | mini_tabline |
mini.test | mini_test |
mini.trailspace | mini_trailspace |
nvim-navic | navic |
neo-tree.nvim | neo-tree |
neogit | neogit |
paling baru | neotest |
noice.nvim | noice |
nvim-beritahu | notify |
nvim-tree.lua | nvim-tree |
okto.nvim | octo |
pelangi-pembatas.nvim | rainbow |
render-penurunan harga.nvim | render-markdown |
nvim-scrollbar | scrollbar |
makanan ringan.nvim | snacks |
vim-menyelinap | sneak |
supermaven-nvim | supermaven |
teleskop.nvim | telescope |
nvim-pengasuh pohon-konteks | treesitter-context |
masalah.nvim | trouble |
vimwiki | vimwiki |
kunci mana.nvim | which-key |
yanky.nvim | yanky |
Alat | Tambahan |
---|---|
udara | ekstra/aerc |
Sigap | ekstra / kesigapan |
Delta | ekstra/delta |
bodoh | ekstra/kesalahan |
Ikan | tambahan/ikan |
Tema Ikan | ekstra/fish_themes |
Kaki | ekstra/kaki |
bulu halus | ekstra/bulu halus |
Fzf | ekstra/fzf |
Hantu | ekstra/hantu |
GitUI | ekstra/gitui |
Terminal GNOME | ekstra/gnome_terminal |
Spiral | ekstra/heliks |
iTerm | tambahan/iterm |
kucing | ekstra/kucing |
pemalas | ekstra/malasgit |
Tabel Lua untuk pengujian | ekstra/lua |
Prisma | ekstra/prisma |
proses-menulis | ekstra/proses_komposisi |
Kendur | ekstra/kendur |
Pemutar Spotify | ekstra/spotify_player |
Teks Luhur | ekstra/luhur |
Terminator | ekstra/terminator |
Termux | ekstra/termux |
Tilix | ekstra/tilix |
Tmux | ekstra/tmux |
Vim | ekstra/vim |
Vimium | ekstra/vimium |
WezTerm | ekstra/wezterm |
Terminal Windows | ekstra/windows_terminal |
Terminal Xfce | ekstra/xfceterm |
Sumber Daya X | ekstra/sumber daya x |
Yazi | ekstra/yazi |
Zathura | ekstra/zathura |
Zellij | ekstra/zellij |
Instal tema dengan manajer paket pilihan Anda, seperti folke/lazy.nvim:
{
" folke/tokyonight.nvim " ,
lazy = false ,
priority = 1000 ,
opts = {},
}
vim . cmd [[ colorscheme tokyonight ]]
colorscheme tokyonight
" There are also colorschemes for the different styles.
colorscheme tokyonight - night
colorscheme tokyonight - storm
colorscheme tokyonight - day
colorscheme tokyonight - moon
Beberapa plugin memerlukan konfigurasi tambahan untuk bekerja dengan TokyoNight .
-- Lua
require ( ' barbecue ' ). setup {
-- ... your barbecue config
theme = ' tokyonight ' ,
-- ... your barbecue config
}
-- Lua
require ( ' lualine ' ). setup {
options = {
-- ... your lualine config
theme = ' tokyonight '
-- ... your lualine config
}
}
" Vim Script
let g: lightline = { ' colorscheme ' : ' tokyonight ' }
Penting
Atur konfigurasi SEBELUM memuat skema warna dengan colorscheme tokyonight
.
Tema ini menawarkan empat gaya: badai, bulan, malam, dan siang.
Gaya hari digunakan ketika { style = "day" }
diteruskan ke setup(options)
atau ketika vim.o.background = "light"
.
TokyoNight menggunakan opsi default, kecuali setup
dipanggil secara eksplisit.
--- @class tokyonight.Config
--- @field on_colors fun ( colors : ColorScheme )
--- @field on_highlights fun ( highlights : tokyonight.Highlights , colors : ColorScheme )
M . defaults = {
style = " moon " , -- The theme comes in three styles, `storm`, a darker variant `night` and `day`
light_style = " day " , -- The theme is used when the background is set to light
transparent = false , -- Enable this to disable setting the background color
terminal_colors = true , -- Configure the colors used when opening a `:terminal` in Neovim
styles = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
-- Background styles. Can be "dark", "transparent" or "normal"
sidebars = " dark " , -- style for sidebars, see below
floats = " dark " , -- style for floating windows
},
day_brightness = 0.3 , -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
dim_inactive = false , -- dims inactive windows
lualine_bold = false , -- When `true`, section headers in the lualine theme will be bold
--- You can override specific color groups to use other groups or a hex color
--- function will be called with a ColorScheme table
--- @param colors ColorScheme
on_colors = function ( colors ) end ,
--- You can override specific highlights to use other groups or a hex color
--- function will be called with a Highlights and ColorScheme table
--- @param highlights tokyonight.Highlights
--- @param colors ColorScheme
on_highlights = function ( highlights , colors ) end ,
cache = true , -- When set to true, the theme will be cached for better performance
--- @type table<string , boolean |{ enabled : boolean } >
plugins = {
-- enable all plugins when not using lazy.nvim
-- set to false to manually enable/disable plugins
all = package.loaded . lazy == nil ,
-- uses your plugin manager to automatically enable needed plugins
-- currently only lazy.nvim is supported
auto = true ,
-- add any plugins here that you want to enable
-- for all possible plugins, see:
-- * https://github.com/folke/tokyonight.nvim/tree/main/lua/tokyonight/groups
-- telescope = true,
},
}
Cara penghitungan grup sorotan:
colors
ditentukan berdasarkan konfigurasi Anda, dengan kemampuan untuk menggantinya menggunakan config.on_colors(colors)
.colors
ini digunakan untuk menghasilkan kelompok highlight.config.on_highlights(highlights, colors)
dapat digunakan untuk mengganti grup highlight. Untuk nilai default colors
dan highlights
, lihat tema badai, bulan, malam, dan siang.
require ( " tokyonight " ). setup ({
-- use the night style
style = " night " ,
-- disable italic for functions
styles = {
functions = {}
},
-- Change the "hint" color to the "orange" color, and make the "error" color bright red
on_colors = function ( colors )
colors . hint = colors . orange
colors . error = " #ff0000 "
end
})
require ( " tokyonight " ). setup ({
on_highlights = function ( hl , c )
local prompt = " #2d3149 "
hl . TelescopeNormal = {
bg = c . bg_dark ,
fg = c . fg_dark ,
}
hl . TelescopeBorder = {
bg = c . bg_dark ,
fg = c . bg_dark ,
}
hl . TelescopePromptNormal = {
bg = prompt ,
}
hl . TelescopePromptBorder = {
bg = prompt ,
fg = prompt ,
}
hl . TelescopePromptTitle = {
bg = prompt ,
fg = prompt ,
}
hl . TelescopePreviewTitle = {
bg = c . bg_dark ,
fg = c . bg_dark ,
}
hl . TelescopeResultsTitle = {
bg = c . bg_dark ,
fg = c . bg_dark ,
}
end ,
})
undercurls
di TmuxAgar undercurl muncul dan berwarna, tambahkan yang berikut ini ke file konfigurasi Tmux Anda:
# Undercurl
set -g default-terminal " ${TERM} "
set -as terminal-overrides ' ,*:Smulx=E[4::%p1%dm ' # undercurl support
set -as terminal-overrides ' ,*:Setulc=E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m ' # underscore colours - needs tmux-3.0
Konfigurasi warna tambahan untuk Kitty, Alacritty, Fish, WezTerm, iTerm, dan foot dapat ditemukan di tambahan. Untuk menggunakannya, lihat dokumentasinya masing-masing.
Anda dapat dengan mudah menggunakan palet warna untuk plugin lain di dalam konfigurasi Neovim Anda:
local colors = require ( " tokyonight.colors " ). setup () -- pass in any of the config options as explained above
local util = require ( " tokyonight.util " )
aplugin . background = colors . bg_dark
aplugin . my_error = util . lighten ( colors . red1 , 0.3 ) -- number between 0 and 1. 0 results in white, 1 results in red1
Permintaan tarik dipersilakan.
Sebagai tambahan, kami menggunakan sistem templat sederhana yang dapat digunakan untuk menghasilkan tema untuk berbagai gaya.
Cara menambahkan template tambahan baru:
Buat file seperti lua/tokyonight/extra/cool-app.lua
.
Tambahkan nama dan ekstensi file output ke tabel extras
di lua/tokyonight/extra/init.lua
.
Jalankan perintah berikut untuk menghasilkan tema tambahan baru dari direktori plugin tokyonight:
./scripts/build
Periksa tema yang baru dibuat di direktori extra/
. Harap JANGAN mengkomitnya, karena sudah dibuat secara otomatis oleh CI.