Skip to content

Commit

Permalink
Messing with zen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonbeck committed Nov 21, 2024
1 parent 612577c commit d6df226
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 88 deletions.
2 changes: 1 addition & 1 deletion config/system-theme.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"dark"
"light"
112 changes: 104 additions & 8 deletions system/with/user/with/program/neovim/auto-commands/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,122 @@
}
{
event = [
"FileType"
"BufEnter"
];
pattern = [
"md"
"markdown"
"txt"
"*.markdown"
"*.md"
"*.txt"
"gitcommit"
"markdown"
"md"
];
callback = {
__raw = ''
function()
local zm = require("zen-mode")
local win = vim.api.nvim_get_current_win()
local buffer_id = vim.api.nvim_win_get_buf(win)
-- vim.api.nvim_set_current_buf(buffer_id)
-- -- pcall(zm.close);
-- pcall(zm.toggle, {
-- window = {
-- width = 85,
-- --height = 1,
-- }
-- })
pcall(zm.close, {
window = {
width = 100,
--height = 1,
}
})
vim.api.nvim_set_current_buf(buffer_id)
pcall(zm.open, {
window = {
width = 85,
--height = 1,
}
})
end
'';
};
}
{
event = [
"BufEnter"
];
pattern = [
"*.cs"
"*.html"
"*.js"
"*.lua"
"*.rs"
"*.sh"
"*.ts"
"*.nix"
"lua"
"nix"
];
callback = {
__raw = ''
function()
vim.opt_local.wrap = true
vim.keymap.set({'n', 'v'}, 'j', 'gj', {buffer = true})
vim.keymap.set({'n', 'v'}, 'k', 'gk', {buffer = true})
local zm = require("zen-mode")
local win = vim.api.nvim_get_current_win()
local buffer_id = vim.api.nvim_win_get_buf(win)
-- pcall(zm.close);
-- pcall(zm.toggle, {
-- window = {
-- width = 85,
-- --height = 1,
-- }
-- })
pcall(zm.close, {
window = {
width = 85,
--height = 1,
}
})
vim.api.nvim_set_current_buf(buffer_id)
pcall(zm.open, {
window = {
width = 100,
--height = 1,
}
})
end
'';
};
}
# {
# event = [
# "BufLeave"
# ];
# pattern = [
# "*.cs"
# "*.html"
# "*.js"
# "*.lua"
# "*.markdown"
# "*.md"
# "*.rs"
# "*.sh"
# "*.ts"
# "*.txt"
# "gitcommit"
# "*.nix"
# ];
# callback = {
# __raw = ''
# function()
# local zm = require("zen-mode")
# pcall(zm.close);
# end
# '';
# };
# }
{
event = ["BufRead"];
event = ["BufWinEnter"];
# TODO: Fine a real syntax highlighting solution for haxe
pattern = ["*.hx"];
command = "set filetype=ts";
Expand Down
134 changes: 67 additions & 67 deletions system/with/user/with/program/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,73 +57,73 @@ in {
set statusline=%{repeat('─',winwidth('.'))}
'';
extraConfigLua = ''
require('where-am-i').setup({
features = {
user_commands = {
enable = true;
},
keymaps = {
enable = true;
},
}
})
require('satellite').setup({
current_only = false,
winblend = 0,
zindex = 40,
excluded_filetypes = {},
width = 2,
handlers = {
cursor = {
enable = true,
-- Supports any number of symbols
symbols = { '⎺', '⎻', '⎼', '⎽' }
-- symbols = { '⎻', '⎼' }
-- Highlights:
-- - SatelliteCursor (default links to NonText
},
search = {
enable = true,
-- Highlights:
-- - SatelliteSearch (default links to Search)
-- - SatelliteSearchCurrent (default links to SearchCurrent)
},
diagnostic = {
enable = true,
signs = {'-', '=', '≡'},
min_severity = vim.diagnostic.severity.HINT,
-- Highlights:
-- - SatelliteDiagnosticError (default links to DiagnosticError)
-- - SatelliteDiagnosticWarn (default links to DiagnosticWarn)
-- - SatelliteDiagnosticInfo (default links to DiagnosticInfo)
-- - SatelliteDiagnosticHint (default links to DiagnosticHint)
},
gitsigns = {
enable = true,
signs = { -- can only be a single character (multibyte is okay)
add = "│",
change = "│",
delete = "-",
},
-- Highlights:
-- SatelliteGitSignsAdd (default links to GitSignsAdd)
-- SatelliteGitSignsChange (default links to GitSignsChange)
-- SatelliteGitSignsDelete (default links to GitSignsDelete)
},
marks = {
enable = true,
show_builtins = false, -- shows the builtin marks like [ ] < >
key = 'm'
-- Highlights:
-- SatelliteMark (default links to Normal)
},
quickfix = {
signs = { '-', '=', '≡' },
-- Highlights:
-- SatelliteQuickfix (default links to WarningMsg)
}
},
});
-- require('where-am-i').setup({
-- features = {
-- user_commands = {
-- enable = true;
-- },
-- keymaps = {
-- enable = true;
-- },
-- }
-- })
-- require('satellite').setup({
-- current_only = false,
-- winblend = 0,
-- zindex = 40,
-- excluded_filetypes = {},
-- width = 2,
-- handlers = {
-- cursor = {
-- enable = true,
-- -- Supports any number of symbols
-- symbols = { '⎺', '⎻', '⎼', '⎽' }
-- -- symbols = { '⎻', '⎼' }
-- -- Highlights:
-- -- - SatelliteCursor (default links to NonText
-- },
-- search = {
-- enable = true,
-- -- Highlights:
-- -- - SatelliteSearch (default links to Search)
-- -- - SatelliteSearchCurrent (default links to SearchCurrent)
-- },
-- diagnostic = {
-- enable = true,
-- signs = {'-', '=', '≡'},
-- min_severity = vim.diagnostic.severity.HINT,
-- -- Highlights:
-- -- - SatelliteDiagnosticError (default links to DiagnosticError)
-- -- - SatelliteDiagnosticWarn (default links to DiagnosticWarn)
-- -- - SatelliteDiagnosticInfo (default links to DiagnosticInfo)
-- -- - SatelliteDiagnosticHint (default links to DiagnosticHint)
-- },
-- gitsigns = {
-- enable = true,
-- signs = { -- can only be a single character (multibyte is okay)
-- add = "│",
-- change = "│",
-- delete = "-",
-- },
-- -- Highlights:
-- -- SatelliteGitSignsAdd (default links to GitSignsAdd)
-- -- SatelliteGitSignsChange (default links to GitSignsChange)
-- -- SatelliteGitSignsDelete (default links to GitSignsDelete)
-- },
-- marks = {
-- enable = true,
-- show_builtins = false, -- shows the builtin marks like [ ] < >
-- key = 'm'
-- -- Highlights:
-- -- SatelliteMark (default links to Normal)
-- },
-- quickfix = {
-- signs = { '-', '=', '≡' },
-- -- Highlights:
-- -- SatelliteQuickfix (default links to WarningMsg)
-- }
-- },
-- });
vim.diagnostic.config({
virtual_text = {
prefix = "",
Expand Down
77 changes: 65 additions & 12 deletions system/with/user/with/program/neovim/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
plugins.telescope.settings.defaults.show_all_buffers = true;
plugins.telescope.settings.defaults.cache_picker.num_pickers = 20;
plugins.telescope.settings.defaults.cache_picker.ignore_empty_prompt = true;
plugins.auto-session.enable = true;
plugins.auto-session.enable = false;
plugins.auto-session.settings.auto_create = true;
plugins.auto-session.settings.auto_restore = true;
plugins.auto-session.settings.auto_save = true;
Expand Down Expand Up @@ -124,8 +124,61 @@
plugins.treesitter.settings.incremental_selection.enable = false;
plugins.treesitter.settings.indent.enable = false;

plugins.zen-mode.enable = true;
plugins.twilight.enable = true;
plugins.zen-mode = {
enable = true;
settings = {
window = {
backdrop = 0.95; # shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
# height and width can be:
# * an absolute number of cells when > 1
# * a percentage of the width / height of the editor when <= 1
# * a function that returns the width or the height
# width = 85; # width of the Zen window
# height = 0.9; # height of the Zen window
# by default, no options are changed for the Zen window
# uncomment any of the options below, or add other vim.wo options you want to apply
options = {
signcolumn = "no"; # disable signcolumn
number = false; # disable number column
relativenumber = false; # disable relative numbers
cursorline = false; # disable cursorline
cursorcolumn = false; # disable cursor column
foldcolumn = "0"; # disable fold column
list = false; # disable whitespace characters
};
};
plugins = {
# disable some global vim options (vim.o...)
# comment the lines to not apply the options
options = {
enabled = true;
ruler = false; # disables the ruler text in the cmd line area
showcmd = false; # disables the command in the last line of the screen
# you may turn on/off statusline in zen mode by setting 'laststatus'
# statusline will be shown only if 'laststatus' == 3
laststatus = 0; # turn off the statusline in zen mode
};
twilight = {
enabled = true;
}; # enable to start Twilight when zen mode opens
gitsigns =
{
enabled = false;
}; # disables git signs
tmux = {
enabled = false;
}; # disables the tmux statusline
# this will change the font size on kitty when in zen mode
# to make this work, you need to set the following kitty options:
# - allow_remote_control socket-only
# - listen_on unix:/tmp/kitty
kitty = {
enabled = true;
font = "+4"; # font size increment
};
};
};
};

# I really want to use this, but it seems to always do unexpected stuff.
# Last time I enabled this it made the bottom row of the vim editor
Expand Down Expand Up @@ -186,15 +239,15 @@
# };
# # src = builtins.fetchGit ./${config.home}/bookmarks.nvim;
# })
(pkgs.vimUtils.buildVimPlugin {
name = "satellite";
src = pkgs.fetchFromGitHub {
owner = "lewis6991";
repo = "satellite.nvim";
rev = "ea0a2e92bbb57981043fca334f5b274c0f279238";
hash = "sha256-WVOYouiEFeLkQBe1Ptazw/mIfzxmaQmOuEK8KlfMYoQ=";
};
})
# (pkgs.vimUtils.buildVimPlugin {
# name = "satellite";
# src = pkgs.fetchFromGitHub {
# owner = "lewis6991";
# repo = "satellite.nvim";
# rev = "ea0a2e92bbb57981043fca334f5b274c0f279238";
# hash = "sha256-WVOYouiEFeLkQBe1Ptazw/mIfzxmaQmOuEK8KlfMYoQ=";
# };
# })
inputs.where-am-i-nvim.packages.${pkgs.system}.default
];
}

0 comments on commit d6df226

Please sign in to comment.