vim使用tokyonight主题
tokyonight 主题是一个漂亮的主题,因为我在 Neovim 中成功配置好了该主题,所以也希望在 vim 上配置好 tokyonight 主题,于是有了这篇文章。由于网络访问的问题,于是决定将 tokyonight 的 README.md 文件放于此处,以供参考。
for more screenshot, check here
About
Originally by enkia
A clean, dark vim theme that celebrates the lights of downtown Tokyo at night based on a VS Code theme with the same name
now come with two variants, night and
storm. The only difference is the background color, where
the storm variant gets a lighter color
this colorscheme works best with vim-polyglot. Please install it first
this colorscheme only support true colors!
Features
- Support for numerous file types and plugin
- Customizable
- Italic support
If you are on Neovim 0.5.x and need support for plugins like Treesitter, native LSP, and other awesome plugins for Neovim, I recommend you to go for folke/tokyonight.nvim
Installation
Using vim-plug
1 | Plug 'ghifarit53/tokyonight-vim' |
add this to your .vimrc
1 | set termguicolors |
if g:tokyonight_style isn't specified, the default
night variant will be used
Available configuration
Note: The configuration options should be placed
before colorscheme tokyonight .
g:tokyonight_style: Customize the style of this color scheme.- Available values:
'night','storm' - Default value:
'night'
- Available values:
g:tokyonight_transparent_background: Set to1to enable transparent background.- Available values:
0,1 - Default value:
0
- Available values:
g:tokyonight_menu_selection_background: Control the background color ofPmenuSelandWildMenu.- Available values:
'green','red','blue' - Default value:
'green'
- Available values:
g:tokyonight_disable_italic_comment: Set to1to disable italic inComment.- Available values:
0,1 - Default value:
0
- Available values:
g:tokyonight_enable_italic: Set to1to italicize keywords. This option is designed to use with fonts that support cursive italic styles, for example Fira Code iCursive Op.- Available values:
0,1 - Default value:
0
- Available values:
g:tokyonight_cursor: Customize the cursor color, only works in GUI clients.- Available values:
'auto','red','green','blue' - Default value:
'auto'
- Available values:
g:tokyonight_current_word: Some plugins can highlight the word under current cursor(for example neoclide/coc-highlight), you can use this option to control their behavior.- Available values:
'bold','underline','italic','grey background' - Default value:
'grey background'when not in transparent mode,'bold'when in transparent mode.
- Available values:
Lightline & Airline
This theme also has support for lightline as well as airline.
To enable lightline support:
1 | let g:lightline = {'colorscheme' : 'tokyonight'} |
To enable airline support:
1 | let g:airline_theme = "tokyonight" |
The lightline and airline styles will both follow the chosen colorscheme style.
Port
.Xresources file available here if you want to
port it
Tell me if you made a port and i'll list them here