refactor: move sioyek out of common config
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-06-08 21:30:44 -04:00
parent bfc7e894bf
commit 14081936af
2 changed files with 39 additions and 40 deletions

View file

@ -16,26 +16,6 @@
in in
lib.mkIf neovimIde { lib.mkIf neovimIde {
programs = { programs = {
# TODO: add syntax highlighting for markdown
sioyek = {
enable = true;
config = let
# TODO: put this with the rest of the themes
dracula-theme = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "sioyek";
rev = "b832ab04d880fbe243c0fe9043612be61226426e";
hash = "sha256-+HzxZA8Bb+cGogK+w4JES4ZFG+ueXEAuLu+0T18fvbc=";
};
in {
startup_commands = "toggle_custom_color";
ui_font = "JetBrainsMono Nerd Font Mono Regular";
font_size = "24";
source = "${dracula-theme}/dracula.config";
};
};
neovim = { neovim = {
extraPackages = [ extraPackages = [
pkgs.pandoc pkgs.pandoc
@ -94,26 +74,30 @@ in
command = 'setlocal ts=4 sw=4 sts=0 expandtab', command = 'setlocal ts=4 sw=4 sts=0 expandtab',
}); });
local gknapsettings = { vim.g.knap_settings = {
-- HTML -- HTML
htmloutputext = "html", htmloutputext = 'html',
htmltohtml = "none", htmltohtml = 'none',
htmltohtmlviewerlaunch = "", htmltohtmlviewerlaunch = "",
htmltohtmlviewerrefresh = "none", htmltohtmlviewerrefresh = 'none',
-- Markdown -- Markdown
mdoutputext = 'pdf', mdoutputext = 'html',
markdownoutputext = 'pdf', markdownoutputext = 'html',
-- Markdown to PDF
mdtopdf = 'pandoc %docroot% -o /tmp/%outputfile%', mdtopdf = 'pandoc %docroot% -o /tmp/%outputfile%',
markdowntopdf = "pandoc %docroot% -o /tmp/%outputfile%", markdowntopdf = 'pandoc %docroot% -o /tmp/%outputfile%',
mdtopdfviewerlaunch = 'sioyek /tmp/%outputfile%', mdtopdfviewerlaunch = 'sioyek /tmp/%outputfile%',
markdowntopdfviewerlaunch = "sioyek /tmp/%outputfile%", markdowntopdfviewerlaunch = 'sioyek /tmp/%outputfile%',
mdtopdfviewerrefresh = 'none', mdtopdfviewerrefresh = 'none',
markdowntopdfviewerrefresh = "none", markdowntopdfviewerrefresh = "none",
mdtohtml = "",
markdowntohtml = "", -- Markdown to HTML
mdtohtmlviewerlaunch = "", mdtohtml = 'pandoc --standalone %docroot% -o /tmp/%outputfile%',
markdowntohtmlviewerlaunch = "", markdowntohtml = 'pandoc --standalone %docroot% -o /tmp/%outputfile%',
mdtohtmlviewerlaunch = 'firefox -new-window /tmp/%outputfile%',
markdowntohtmlviewerlaunch = 'firefox -new-window /tmp/%outputfile%',
mdtohtmlviewerrefresh = 'none', mdtohtmlviewerrefresh = 'none',
markdowntohtmlviewerrefresh = 'none', markdowntohtmlviewerrefresh = 'none',
@ -121,29 +105,25 @@ in
-- TODO: stop from polluting workspace -- TODO: stop from polluting workspace
}; };
vim.g.knap_settings = gknapsettings;
local kmap = vim.keymap.set
-- F4 processes the document once, and refreshes the view -- F4 processes the document once, and refreshes the view
kmap({ 'n', 'v', 'i' }, '<F4>', function() vim.keymap.set({ 'n', 'v', 'i' }, '<F4>', function()
require('knap').process_once(); require('knap').process_once();
end); end);
-- F5 closes the viewer application, and -- F5 closes the viewer application, and
-- allows settings to be reset -- allows settings to be reset
kmap({ 'n', 'v', 'i' }, '<F5>', function() vim.keymap.set({ 'n', 'v', 'i' }, '<F5>', function()
require('knap').close_viewer(); require('knap').close_viewer();
end); end);
-- F6 toggles the auto-processing on and off -- F6 toggles the auto-processing on and off
kmap({ 'n', 'v', 'i' }, '<F6>', function() vim.keymap.set({ 'n', 'v', 'i' }, '<F6>', function()
require('knap').toggle_autopreviewing(); require('knap').toggle_autopreviewing();
end); end);
-- F7 invokes a SyncTeX forward search, or similar, -- F7 invokes a SyncTeX forward search, or similar,
-- where appropriate -- where appropriate
kmap({ 'n', 'v', 'i' }, '<F7>', function() vim.keymap.set({ 'n', 'v', 'i' }, '<F7>', function()
require('knap').forward_jump(); require('knap').forward_jump();
end); end);
''; '';

View file

@ -48,6 +48,25 @@ in {
}) })
]; ];
programs.sioyek = {
enable = true;
config = let
# TODO: put this with the rest of the themes
dracula-theme = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "sioyek";
rev = "b832ab04d880fbe243c0fe9043612be61226426e";
hash = "sha256-+HzxZA8Bb+cGogK+w4JES4ZFG+ueXEAuLu+0T18fvbc=";
};
in {
startup_commands = "toggle_custom_color";
ui_font = "JetBrainsMono Nerd Font Mono Regular";
font_size = "24";
source = "${dracula-theme}/dracula.config";
};
};
home.packages = home.packages =
(with pkgs; [ (with pkgs; [
# School # School