• Stars
    star
    419
  • Rank 103,157 (Top 3 %)
  • Language
    Lua
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Remove all background colors to make nvim transparent

transparent.nvim

Remove all background colors to make nvim transparent.

demo


Installation

xiyaowong/transparent.nvim

Same as other normal plugins, use your favourite plugin manager to install.

NOTE:
It is recommended not to lazy load this plugin to avoid some strange phenomena.
The execution of each function in the plugin is very fast and the time consumption can be ignored.

Usage

All available options:

require("transparent").setup({
  groups = { -- table: default groups
    'Normal', 'NormalNC', 'Comment', 'Constant', 'Special', 'Identifier',
    'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function',
    'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText',
    'SignColumn', 'CursorLineNr', 'EndOfBuffer',
  },
  extra_groups = {}, -- table: additional groups that should be cleared
  exclude_groups = {}, -- table: groups you don't want to clear
})

You can also add additional highlight groups by explicitly assigning the variable "g:transparent_groups", which is the more recommended way.

For example, if you want to add group ExtraGroup, you can do it like this:

vim.g.transparent_groups = vim.list_extend(vim.g.transparent_groups or {}, { "ExtraGroup" })
-- vimscript: let g:transparent_groups = extend(get(g:, 'transparent_groups', []), ["ExtraGroup"])

You can execute this statement anywhere and as many times as you want, without worrying about whether the plugin has already been loaded or not.

Here is an example about akinsho/bufferline.nvim. Simply copy it and paste it after initializing bufferline in your configuration.

vim.g.transparent_groups = vim.list_extend(
  vim.g.transparent_groups or {},
  vim.tbl_map(function(v)
    return v.hl_group
  end, vim.tbl_values(require('bufferline.config').highlights))
)

This plugin will provide a global variable: g:transparent_enabled(lua: vim.g.transparent_enabled)

Some plugins or themes support setting transparency, and you can use this variable as a flag.
eg: vim.g.tokyonight_transparent = vim.g.transparent_enabled

NOTE: The plugin will cache and automatically apply transparency settings, so you only need to call the following command.

FAQ

How to enable transparent for plugin panels?

You can try adding this highlight group to the options:

{
  extra_groups = {
    "NormalFloat", -- plugins which have float panel such as Lazy, Mason, LspInfo
    "NvimTreeNormal" -- NvimTree
  },
}

Commands

:TransparentEnable
:TransparentDisable
:TransparentToggle

Migration Guide 2023/3/20

  1. remove enable=true in your config.

  2. start Neovim

  3. Run :TransparentEnable

It's done, the status of enable will cached and the transparent effect is applyed on you neovim, enjoy :)

Aknowledgement

vim-transparent

More Repositories

1

spiders

Python爬虫,返回一定格式的信息,下载,使用flask提供简易api。抖音无水印、皮皮虾、快手、网易云音乐、qq音乐、咪咕音乐、荔枝FM音频、知乎视频、最右语音、视频、微博......
Python
581
star
2

freeFQ

106
star
3

nvim-cursorword

highlight the word under the cursor.
Lua
105
star
4

coc-sumneko-lua

Lua extension using sumneko lua-language-server for coc.nvim
TypeScript
99
star
5

telescope-emoji.nvim

An extension for telescope.nvim that allows you to search emojis😃
Lua
69
star
6

virtcolumn.nvim

Display a line as the colorcolumn
Lua
50
star
7

link-visitor.nvim

Let me help you open the links!
Lua
29
star
8

python--iotbot

IOTBOT/IOTQQ/OPQ 的Python开发助手,同步易于使用,但也不那么低效🐌
Python
28
star
9

coc-symbol-line

Symbols outline for coc.nvim
TypeScript
16
star
10

coc-lightbulb-

Code action 💡 for coc.nvim
TypeScript
15
star
11

accelerated-jk.nvim

A nvim plugin to accelerate up-down moving
Lua
10
star
12

iotbot--mirror

iotqq/iotbot/opqbot的下载镜像
Python
10
star
13

coc-stylua

StyLua extension for coc.nvim.
TypeScript
9
star
14

coc-lightbulb

VSCode 💡 for coc.nvim
Lua
8
star
15

iotbot-plugins

iotbot 插件
Lua
5
star
16

telescope-octo-commands.nvim

This plugin helps you type octo.nvim commands
Lua
4
star
17

tosilk

音频转成silk格式
Go
4
star
18

icourse163_spider

爱课程(中国大学mooc)爬虫
Python
3
star
19

coc-zls

Zls(zig language server) extension for coc.nvim
TypeScript
2
star
20

nvim-whitespace

Lua
2
star
21

iotbot-http-transfer

转发iotbot的web api,方便远程调用
Python
2
star
22

tgbot

telegram机器人
C++
1
star
23

simple-spiders-v2

extract resource and provide api
Python
1
star
24

dingtalk-custom-robot

对钉钉自定义机器人的 API 封装
Python
1
star
25

coc-phpfmt

phpfmt extension for coc.nvim
TypeScript
1
star
26

coc-golines

golines extension for coc.nvim
TypeScript
1
star
27

simple-spiders

一些乱七八糟的简单的爬虫
Python
1
star
28

botoy-example

一些 https://github.com/xiyaowong/botoy 的使用示例,小功能
Python
1
star
29

save-file-to-github

用github API简单的上传并保存文件,方便个人日常使用
Go
1
star
30

nvim-lastplace

Lua
1
star
31

coc-code-action-menu.nvim

Pop-up menu for code actions to show meta-information and diff preview
Lua
1
star
32

coc-csharp-ls

TypeScript
1
star
33

Operator-Fonts

1
star
34

OldfilesStartupScreen.nvim

A minimal startup screen plugin for neovim. Simply display oldfiles.
Lua
1
star
35

pix-3

Python
1
star
36

dotfiles

Shell
1
star