nix profile install github:3fxcf9/figure_manageror declare this repository as a flake input with
inputs.figure_manager = {
url = "github:3fxcf9/figure_manager";
};and install it in your configuration, for example in home-manager with
{
pkgs,
inputs,
...
}: {
home.packages = [
inputs.figure_manager.packages.${pkgs.system}.figure_manager
];
}After installing the dependencies (inkscape, tofi, scour, and inotify-tools providing inotifywait), you can build this project by running
v -prod .Then, place the generated binary (figure_manager) somewhere in your $PATH.
-
Put your
template.svgfile in$XDG_CONFIG_HOME/course-manager/figures. -
Create a file named
include_codein the same directory ($XDG_CONFIG_HOME/course-manager/figures) containing the code used to include a figure in a document. For example, with my custom note syntax, it would look like this:%fig <FIGURE_NAME> @[<FIGURE_PATH>] %
This script is designed to be used with (neo)vim. Here are some suggested key mappings:
-
To create a new figure (
<C-f>in insert mode, after typing the figure name)inoremap <C-f> <Esc>:silent exec '.!figure_manager create "'.expand('%:h').'/figures/" "'.getline('.').'"'<CR><CR>:w<CR>
-
To choose and edit a specific figure (
<C-f>in normal mode)nnoremap <C-f> :silent exec '!figure_manager edit "'.expand('%:h').'/figures/" > /dev/null 2>&1 &'<CR><CR>:redraw!<CR>