Init zenmode

This commit is contained in:
Hadi 2024-10-10 22:41:39 +02:00
parent 6adc0d7c3c
commit 53703c0db0
5 changed files with 54 additions and 1 deletions

View File

@ -16,6 +16,7 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Markdown tab size 2
- [ ] neotest golang
- [ ] nvim dap
- [ ] Zen mode: linebreak, word wrapping
- [ ] Find a good md2pdf

View File

@ -10,6 +10,7 @@
./plugins/utils.nix
./plugins/dap.nix
./plugins/telescope.nix
./plugins/zenmode.nix
./options.nix
./keymaps.nix

View File

@ -107,6 +107,11 @@
}
# UI
{
key = "<leader>uz";
action = "<cmd>ZenMode<cr>";
options.desc = "Toggle ZenMode";
}
{
key = "<leader>uw";
action = "<cmd>set wrap!<cr>";

View File

@ -0,0 +1,46 @@
{
programs.nixvim.plugins = {
zen-mode = {
enable = true;
settings = {
on_close = ''
function()
require("gitsigns.actions").toggle_current_line_blame()
vim.cmd('IBLEnable')
vim.opt.signcolumn = "yes:2"
vim.wo.wrap = false
vim.wo.linebreak = false
require("gitsigns.actions").refresh()
end
'';
on_open = ''
function()
require("gitsigns.actions").toggle_current_line_blame()
vim.cmd('IBLDisable')
vim.opt.relativenumber = false
vim.opt.signcolumn = "no"
vim.wo.wrap = true
vim.wo.linebreak = true
require("gitsigns.actions").refresh()
end
'';
window = {
backdrop = 1;
height = 1;
options = {
signcolumn = "no";
number = false;
relativenumber = false;
cursorline = false;
cursorcolumn = false;
foldcolumn = "0";
list = false;
};
width = 0.8;
};
};
};
};
}

View File

@ -66,7 +66,7 @@ in {
wireguard-import = "nmcli connection import type wireguard file";
notes =
"cd ~/nextcloud/Notes && nvim -c ':Telescope find_files' index.md";
"nvim ~/nextcloud/Notes/index.md --cmd 'cd ~/nextcloud/Notes' -c ':Telescope find_files'";
note = "notes";
# git