mirror of
https://github.com/Ascyii/typstar.git
synced 2026-03-02 01:22:43 +01:00
style: format nix code
This commit is contained in:
129
flake.nix
129
flake.nix
@@ -6,74 +6,79 @@
|
|||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {
|
outputs =
|
||||||
self,
|
inputs@{
|
||||||
nixpkgs,
|
self,
|
||||||
flake-parts,
|
nixpkgs,
|
||||||
...
|
flake-parts,
|
||||||
}:
|
...
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
}:
|
||||||
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
systems = [
|
systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem = {system, ...}: let
|
perSystem =
|
||||||
pkgs = import nixpkgs {inherit system;};
|
{ system, ... }:
|
||||||
typstar = pkgs.vimUtils.buildVimPlugin {
|
let
|
||||||
name = "typstar";
|
pkgs = import nixpkgs { inherit system; };
|
||||||
src = self;
|
typstar = pkgs.vimUtils.buildVimPlugin {
|
||||||
buildInputs = [
|
name = "typstar";
|
||||||
pkgs.vimPlugins.luasnip
|
src = self;
|
||||||
pkgs.vimPlugins.nvim-treesitter-parsers.typst
|
buildInputs = [
|
||||||
];
|
pkgs.vimPlugins.luasnip
|
||||||
|
pkgs.vimPlugins.nvim-treesitter-parsers.typst
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = {
|
||||||
|
default = typstar;
|
||||||
|
nvim =
|
||||||
|
let
|
||||||
|
config = pkgs.neovimUtils.makeNeovimConfig {
|
||||||
|
customRC = ''
|
||||||
|
lua << EOF
|
||||||
|
print("Welcome to Typstar! This is just a demo.")
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
highlight = { enable = true },
|
||||||
|
}
|
||||||
|
|
||||||
|
local ls = require('luasnip')
|
||||||
|
ls.config.set_config({
|
||||||
|
enable_autosnippets = true,
|
||||||
|
store_selection_keys = "<Tab>",
|
||||||
|
})
|
||||||
|
|
||||||
|
local typstar = require('typstar')
|
||||||
|
typstar.setup({})
|
||||||
|
|
||||||
|
vim.keymap.set({'n', 'i'}, '<M-t>', '<Cmd>TypstarToggleSnippets<CR>', { silent = true, noremap = true })
|
||||||
|
vim.keymap.set({'s', 'i'}, '<M-j>', '<Cmd>TypstarSmartJump<CR>', { silent = true, noremap = true })
|
||||||
|
vim.keymap.set({'s', 'i'}, '<M-k>', '<Cmd>TypstarSmartJumpBack<CR>', { silent = true, noremap = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>e', '<Cmd>TypstarInsertExcalidraw<CR>', { silent = true, noremap = true })
|
||||||
|
vim.keymap.set('n', '<leader>r', '<Cmd>TypstarInsertRnote<CR>', { silent = true, noremap = true })
|
||||||
|
vim.keymap.set('n', '<leader>o', '<Cmd>TypstarOpenDrawing<CR>', { silent = true, noremap = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>a', '<Cmd>TypstarAnkiScan<CR>', { silent = true, noremap = true })
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
plugins = [
|
||||||
|
typstar
|
||||||
|
pkgs.vimPlugins.luasnip
|
||||||
|
pkgs.vimPlugins.nvim-treesitter
|
||||||
|
pkgs.vimPlugins.nvim-treesitter-parsers.typst
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped config;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in {
|
|
||||||
packages = {
|
|
||||||
default = typstar;
|
|
||||||
nvim = let
|
|
||||||
config = pkgs.neovimUtils.makeNeovimConfig {
|
|
||||||
customRC = ''
|
|
||||||
lua << EOF
|
|
||||||
print("Welcome to Typstar! This is just a demo.")
|
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
highlight = { enable = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
local ls = require('luasnip')
|
|
||||||
ls.config.set_config({
|
|
||||||
enable_autosnippets = true,
|
|
||||||
store_selection_keys = "<Tab>",
|
|
||||||
})
|
|
||||||
|
|
||||||
local typstar = require('typstar')
|
|
||||||
typstar.setup({})
|
|
||||||
|
|
||||||
vim.keymap.set({'n', 'i'}, '<M-t>', '<Cmd>TypstarToggleSnippets<CR>', { silent = true, noremap = true })
|
|
||||||
vim.keymap.set({'s', 'i'}, '<M-j>', '<Cmd>TypstarSmartJump<CR>', { silent = true, noremap = true })
|
|
||||||
vim.keymap.set({'s', 'i'}, '<M-k>', '<Cmd>TypstarSmartJumpBack<CR>', { silent = true, noremap = true })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>e', '<Cmd>TypstarInsertExcalidraw<CR>', { silent = true, noremap = true })
|
|
||||||
vim.keymap.set('n', '<leader>r', '<Cmd>TypstarInsertRnote<CR>', { silent = true, noremap = true })
|
|
||||||
vim.keymap.set('n', '<leader>o', '<Cmd>TypstarOpenDrawing<CR>', { silent = true, noremap = true })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>a', '<Cmd>TypstarAnkiScan<CR>', { silent = true, noremap = true })
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
plugins = [
|
|
||||||
typstar
|
|
||||||
pkgs.vimPlugins.luasnip
|
|
||||||
pkgs.vimPlugins.nvim-treesitter
|
|
||||||
pkgs.vimPlugins.nvim-treesitter-parsers.typst
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user