Skip to content

Commit 19bf2c6

Browse files
committed
add zen-mode
1 parent d03a8d1 commit 19bf2c6

File tree

4 files changed

+73
-5
lines changed

4 files changed

+73
-5
lines changed

lua/plugin-config/indent-blankline.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ indent_blankline.setup({
3636
"lsp-installer",
3737
"lspinfo",
3838
"toggleterm",
39+
"text",
3940
},
4041
-- 竖线样式
4142
-- char = '¦'

lua/plugin-config/zen-mode.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
local uConfig = require("uConfig")
2+
local uZen = uConfig.zen
3+
4+
if uZen == nil or not uZen.enable then
5+
return
6+
end
7+
8+
local status, zen = pcall(require, "zen-mode")
9+
if not status then
10+
vim.notify("没有找到 zen-mode")
11+
return
12+
end
13+
14+
zen.setup({
15+
window = {
16+
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
17+
-- height and width can be:
18+
-- * an absolute number of cells when > 1
19+
-- * a percentage of the width / height of the editor when <= 1
20+
-- * a function that returns the width or the height
21+
width = 0.8, -- width of the Zen window
22+
height = 0.8, -- height of the Zen window
23+
-- by default, no options are changed for the Zen window
24+
-- uncomment any of the options below, or add other vim.wo options you want to apply
25+
options = {
26+
signcolumn = "no", -- disable signcolumn
27+
number = false, -- disable number column
28+
relativenumber = false, -- disable relative numbers
29+
cursorline = false, -- disable cursorline
30+
cursorcolumn = false, -- disable cursor column
31+
foldcolumn = "0", -- disable fold column
32+
list = false, -- disable whitespace characters
33+
},
34+
},
35+
plugins = {
36+
-- disable some global vim options (vim.o...)
37+
-- comment the lines to not apply the options
38+
options = {
39+
enabled = true,
40+
ruler = false, -- disables the ruler text in the cmd line area
41+
showcmd = false, -- disables the command in the last line of the screen
42+
},
43+
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
44+
gitsigns = { enabled = false }, -- disables git signs
45+
tmux = { enabled = false }, -- disables the tmux statusline
46+
},
47+
-- callback where you can add custom code when the Zen window opens
48+
on_open = function(win) end,
49+
-- callback where you can add custom code when the Zen window closes
50+
on_close = function() end,
51+
})
52+
53+
keymap("n", uZen.toggle, ":ZenMode<CR>")

lua/plugins.lua

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,22 @@ packer.startup({
188188
end,
189189
})
190190

191+
-- venn 画图
191192
use({
192193
"jbyuki/venn.nvim",
193194
config = function()
194195
require("plugin-config.venn")
195196
end,
196197
})
197198

199+
-- zen mode
200+
use({
201+
"folke/zen-mode.nvim",
202+
config = function()
203+
require("plugin-config.zen-mode")
204+
end,
205+
})
206+
198207
--------------------- LSP --------------------
199208
use({ "williamboman/nvim-lsp-installer" })
200209
-- Lspconfig
@@ -232,13 +241,13 @@ packer.startup({
232241
use({ "folke/tokyonight.nvim" })
233242

234243
-- OceanicNext
235-
use({ "mhartington/oceanic-next", event = "VimEnter" })
244+
-- use({ "mhartington/oceanic-next", event = "VimEnter" })
236245

237246
-- gruvbox
238-
use({
239-
"ellisonleao/gruvbox.nvim",
240-
requires = { "rktjmp/lush.nvim" },
241-
})
247+
-- use({
248+
-- "ellisonleao/gruvbox.nvim",
249+
-- requires = { "rktjmp/lush.nvim" },
250+
-- })
242251

243252
-- zephyr
244253
-- use("glepnir/zephyr-nvim")

lua/uConfig.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ local M = {
203203
draw_box = "f",
204204
},
205205

206+
zen = {
207+
enable = true,
208+
toggle = "<leader>z",
209+
},
210+
206211
lsp = {
207212
rename = "<leader>rn",
208213
code_action = "<leader>ca",

0 commit comments

Comments
 (0)