2023-07-09 02:12:51 +02:00
|
|
|
{ pkgs, config, ... }:
|
2023-08-30 03:00:47 +02:00
|
|
|
|
2023-06-11 15:33:54 +02:00
|
|
|
let
|
2024-04-06 20:25:10 +02:00
|
|
|
inherit (pkgs) fetchFromGitHub vimPlugins;
|
2024-04-05 19:28:23 +02:00
|
|
|
inherit (pkgs.vimUtils) buildVimPlugin;
|
|
|
|
inherit (config.lib.stylix.scheme) slug;
|
2024-04-06 20:25:10 +02:00
|
|
|
inherit (config.xdg.userDirs) documents;
|
2024-01-18 03:08:02 +01:00
|
|
|
|
2024-04-05 19:28:23 +02:00
|
|
|
vim-nix-rummik = buildVimPlugin {
|
|
|
|
pname = "vim-nix-rummik";
|
|
|
|
version = "2022-11-16";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-18 03:08:02 +01:00
|
|
|
owner = "rummik";
|
|
|
|
repo = "vim-nix";
|
|
|
|
rev = "0def8020f152a51c011a707680780dac61a8989a";
|
|
|
|
hash = "sha256-Q+Jx6/MgeE2hsd/a6FqfXpAOaRcNymZW6t75hYCcH4E=";
|
|
|
|
};
|
|
|
|
};
|
2023-06-11 15:33:54 +02:00
|
|
|
in
|
|
|
|
{
|
2023-06-16 14:19:22 +02:00
|
|
|
programs.bat.enable = true;
|
2023-05-17 14:43:54 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
home.packages = with pkgs; [
|
2023-06-19 18:10:59 +02:00
|
|
|
gcc
|
|
|
|
clang-tools
|
2023-06-21 09:37:06 +02:00
|
|
|
pkg-config
|
2023-06-22 20:39:53 +02:00
|
|
|
gnumake
|
|
|
|
cmake
|
2023-06-19 18:10:59 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
nil
|
|
|
|
nixpkgs-fmt
|
2024-03-09 02:00:13 +01:00
|
|
|
nixfmt-rfc-style
|
2023-06-19 18:10:59 +02:00
|
|
|
|
2023-06-20 14:27:38 +02:00
|
|
|
crystal
|
2024-04-06 17:35:34 +02:00
|
|
|
crystalline
|
2023-06-19 18:10:59 +02:00
|
|
|
shards
|
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
nodejs
|
2023-06-19 22:19:24 +02:00
|
|
|
nodePackages.npm
|
2023-06-16 14:19:22 +02:00
|
|
|
yarn
|
|
|
|
deno
|
2023-09-12 22:59:51 +02:00
|
|
|
bun
|
2023-09-30 16:54:06 +02:00
|
|
|
biome
|
2023-07-19 17:26:16 +02:00
|
|
|
nodePackages.typescript-language-server
|
2023-07-19 19:20:48 +02:00
|
|
|
nodePackages."@astrojs/language-server"
|
2023-12-03 22:16:47 +01:00
|
|
|
nodePackages."@prisma/language-server"
|
2023-08-01 22:26:14 +02:00
|
|
|
nodePackages.pnpm
|
2024-04-06 17:35:34 +02:00
|
|
|
nodePackages.prisma
|
|
|
|
openssl
|
|
|
|
pnpm-shell-completion
|
2023-12-03 22:27:32 +01:00
|
|
|
tailwindcss-language-server
|
2023-12-29 23:33:05 +01:00
|
|
|
vscode-langservers-extracted
|
2023-06-19 18:10:59 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
rustc
|
|
|
|
rustfmt
|
|
|
|
cargo
|
2023-08-01 18:31:49 +02:00
|
|
|
cargo-info
|
2023-08-06 22:53:42 +02:00
|
|
|
cargo-license
|
2023-10-29 20:24:32 +01:00
|
|
|
cargo-feature
|
2023-12-21 20:01:50 +01:00
|
|
|
cargo-tarpaulin
|
2024-01-06 03:44:11 +01:00
|
|
|
cargo-edit
|
2023-06-16 14:19:22 +02:00
|
|
|
rust-analyzer
|
|
|
|
bacon
|
2023-07-22 19:22:27 +02:00
|
|
|
clippy
|
2023-06-19 18:10:59 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
marksman
|
2023-06-19 18:10:59 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
lua-language-server
|
2023-06-19 18:10:59 +02:00
|
|
|
|
2023-08-20 04:16:15 +02:00
|
|
|
texlive.combined.scheme-full
|
2023-06-16 14:19:22 +02:00
|
|
|
texlab
|
2024-04-06 17:35:34 +02:00
|
|
|
tectonic
|
2023-10-25 19:31:00 +02:00
|
|
|
typst
|
|
|
|
typstfmt
|
2024-01-12 13:21:12 +01:00
|
|
|
typst-lsp
|
2023-10-25 19:31:00 +02:00
|
|
|
typst-live
|
2023-12-02 19:33:26 +01:00
|
|
|
|
|
|
|
universal-ctags
|
2023-12-04 20:34:28 +01:00
|
|
|
|
|
|
|
emmet-language-server
|
2023-12-29 23:54:54 +01:00
|
|
|
|
|
|
|
sqlite
|
2024-04-06 17:35:34 +02:00
|
|
|
sqlcipher
|
|
|
|
litecli
|
2023-06-16 14:19:22 +02:00
|
|
|
];
|
2023-06-12 22:54:09 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
editorconfig = {
|
|
|
|
enable = true;
|
2023-06-13 00:34:41 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
settings = {
|
|
|
|
"*" = {
|
|
|
|
charset = "utf-8";
|
|
|
|
end_of_line = "lf";
|
|
|
|
insert_final_newline = true;
|
|
|
|
indent_size = 2;
|
|
|
|
indent_style = "space";
|
2023-07-27 00:24:13 +02:00
|
|
|
trim_trailing_whitespace = false;
|
2023-06-16 14:19:22 +02:00
|
|
|
};
|
2023-06-13 00:34:41 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
"Makefile" = {
|
|
|
|
indent_style = "tab";
|
|
|
|
indent_size = 4;
|
|
|
|
};
|
2023-06-13 00:34:41 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
"*.html" = {
|
|
|
|
indent_style = "tab";
|
|
|
|
indent_size = 4;
|
|
|
|
};
|
2023-06-13 00:34:41 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
"*.rs" = {
|
|
|
|
indent_style = "space";
|
|
|
|
indent_size = 4;
|
2023-06-13 00:34:41 +02:00
|
|
|
};
|
2023-06-16 14:19:22 +02:00
|
|
|
};
|
|
|
|
};
|
2023-06-13 00:34:41 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = /* vim */ ''
|
|
|
|
filetype plugin indent on
|
|
|
|
set undofile
|
|
|
|
set spell
|
|
|
|
set number
|
|
|
|
set linebreak
|
|
|
|
set clipboard=unnamedplus
|
|
|
|
set fileencoding=utf-8 " Ensure that we always save files as utf-8
|
|
|
|
set fileencodings=utf-8,sjis " Automatically open shiftjis files with their proper encoding
|
|
|
|
set spelllang=en_us,cjk " Don't show errors for CJK characters
|
|
|
|
set noshowmode " Disable the --MODE-- text (enable if not using the status line)
|
|
|
|
set mouse=a
|
|
|
|
set ignorecase " By default use case-insensitive search (combine with smartcase)
|
|
|
|
set smartcase " Make search case-sensitive when using capital letters
|
|
|
|
set scrolloff=1 " The minimal number of rows to show when scrolling up/down
|
|
|
|
set sidescrolloff=5 " The minimal number of columns to show when scrolling left/right
|
|
|
|
set tabstop=4 " Show a tab character as 4 spaces
|
|
|
|
set softtabstop=0 " Edit soft tabs as if they're regular spaces
|
|
|
|
set shiftwidth=4 " Make autoindent appear as 4 spaces
|
2023-05-17 01:10:15 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
set foldmethod=indent
|
|
|
|
set foldlevelstart=99
|
2023-05-17 01:10:15 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
map <MiddleMouse> <Nop>
|
|
|
|
imap <MiddleMouse> <Nop>
|
|
|
|
map <2-MiddleMouse> <Nop>
|
|
|
|
imap <2-MiddleMouse> <Nop>
|
|
|
|
map <3-MiddleMouse> <Nop>
|
|
|
|
imap <3-MiddleMouse> <Nop>
|
|
|
|
map <4-MiddleMouse> <Nop>
|
|
|
|
imap <4-MiddleMouse> <Nop>
|
2023-05-17 01:10:15 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
highlight Search ctermbg=240 ctermfg=255
|
|
|
|
highlight IncSearch ctermbg=255 ctermfg=240
|
2023-05-17 01:10:15 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
let mapleader = ' '
|
|
|
|
nnoremap <silent> <leader>e :set nu!<CR>
|
|
|
|
nnoremap <silent> <leader>t :OverCommandLine<CR>%s/
|
2023-08-01 18:14:22 +02:00
|
|
|
nnoremap <silent> <leader>o :GitBlameToggle<CR>
|
2023-12-21 00:16:16 +01:00
|
|
|
nnoremap <silent> <leader>a :NvimTreeFocus<CR>
|
2023-06-16 14:19:22 +02:00
|
|
|
nnoremap <silent> <leader>d :Bdelete<CR>
|
|
|
|
nnoremap <silent> <leader>f :Files<CR>
|
|
|
|
nnoremap <silent> <leader>g :set hlsearch!<CR>
|
|
|
|
nnoremap <silent> <leader>j :Buffers<CR>
|
|
|
|
nnoremap <silent> <leader>l :Rg<CR>
|
|
|
|
nnoremap <silent> <leader>; :NvimTreeToggle<CR>
|
2023-07-11 03:58:02 +02:00
|
|
|
nnoremap <silent> <leader>z :ZenMode<CR>
|
2024-03-09 17:45:33 +01:00
|
|
|
nnoremap <silent> <leader>b :Vista!!<CR>
|
2023-06-16 14:19:22 +02:00
|
|
|
vnoremap <C-s> y:silent !notify-send -t 4000 "成果" "$(tango '<C-r>0')"<CR>:<Esc>
|
2023-05-17 01:10:15 +02:00
|
|
|
|
2024-03-09 23:48:18 +01:00
|
|
|
autocmd BufNewFile,BufRead *.ecr setlocal syntax=html
|
2023-06-16 14:19:22 +02:00
|
|
|
autocmd BufWritePre,FileWritePre * silent! call mkdir(expand('<afile>:p:h'), 'p')
|
|
|
|
autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel`
|
2023-06-09 15:55:28 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
tnoremap <C-space> <C-\><C-n>
|
2023-07-26 15:59:44 +02:00
|
|
|
|
|
|
|
autocmd BufNewFile,BufRead *.mdx set filetype=markdown
|
2023-06-16 14:19:22 +02:00
|
|
|
'';
|
2023-06-27 00:35:00 +02:00
|
|
|
|
2024-04-06 20:25:10 +02:00
|
|
|
plugins = with vimPlugins; [
|
2023-06-16 14:19:22 +02:00
|
|
|
{
|
|
|
|
plugin = nvim-tree-lua;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
2023-06-16 20:18:55 +02:00
|
|
|
require("nvim-tree").setup()
|
2023-06-06 13:18:59 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
vim.api.nvim_create_autocmd({"QuitPre"}, {
|
2024-03-09 23:48:18 +01:00
|
|
|
callback = function()
|
|
|
|
vim.cmd("NvimTreeClose")
|
|
|
|
end
|
2023-06-16 14:19:22 +02:00
|
|
|
})
|
2023-06-06 13:27:04 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
local function open_nvim_tree(data)
|
|
|
|
local real_file = vim.fn.filereadable(data.file) == 1
|
|
|
|
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
2023-06-06 13:27:04 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
if not real_file and not no_name then
|
|
|
|
return
|
|
|
|
end
|
2023-06-06 13:27:04 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
|
|
|
|
end
|
2023-06-06 13:27:04 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = indent-blankline-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
2023-10-11 00:20:29 +02:00
|
|
|
require("ibl").setup()
|
2023-06-16 14:19:22 +02:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = gitsigns-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require('gitsigns').setup()
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = nvim-web-devicons;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = nvim-scrollbar;
|
|
|
|
type = "lua";
|
2024-04-06 20:25:10 +02:00
|
|
|
config = /* lua */ ''
|
|
|
|
require("scrollbar").setup()
|
|
|
|
'';
|
2023-06-16 14:19:22 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = nvim-lspconfig;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
local lspconfig = require('lspconfig')
|
2023-12-05 20:38:07 +01:00
|
|
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-09-30 17:07:39 +02:00
|
|
|
lspconfig.denols.setup {
|
2023-12-05 20:38:07 +01:00
|
|
|
capabilities = capabilities,
|
2023-09-30 17:07:39 +02:00
|
|
|
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
|
|
|
|
}
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-09-30 17:07:39 +02:00
|
|
|
lspconfig.tsserver.setup {
|
2023-12-05 20:38:07 +01:00
|
|
|
capabilities = capabilities,
|
2023-09-30 17:07:39 +02:00
|
|
|
root_dir = lspconfig.util.root_pattern("package.json"),
|
|
|
|
single_file_support = false
|
|
|
|
}
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-10-25 19:31:00 +02:00
|
|
|
lspconfig.typst_lsp.setup {
|
2023-12-05 20:38:07 +01:00
|
|
|
capabilities = capabilities,
|
2023-10-25 19:31:00 +02:00
|
|
|
settings = {
|
|
|
|
exportPdf = "onSave"
|
|
|
|
}
|
|
|
|
}
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-12-29 23:33:05 +01:00
|
|
|
lspconfig.eslint.setup {
|
2023-12-29 23:56:21 +01:00
|
|
|
capabilities = capabilities,
|
2023-12-29 23:33:05 +01:00
|
|
|
on_attach = function(client, bufnr)
|
|
|
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
|
|
buffer = bufnr,
|
|
|
|
command = "EslintFixAll",
|
|
|
|
})
|
|
|
|
end
|
|
|
|
}
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-12-30 01:44:28 +01:00
|
|
|
lspconfig.tailwindcss.setup {
|
|
|
|
capabilities = capabilities,
|
|
|
|
on_attach = function(client, bufnr)
|
|
|
|
require("tailwindcss-colors").buf_attach(bufnr)
|
|
|
|
end
|
|
|
|
}
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
|
|
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
|
|
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
|
|
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
vim.api.nvim_create_autocmd('LspAttach', {
|
|
|
|
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
callback = function(ev)
|
|
|
|
local opts = { buffer = ev.buf }
|
2024-03-30 16:30:33 +01:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
|
|
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
|
|
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
|
|
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
|
|
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
|
|
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
|
|
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
|
|
|
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
|
|
|
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
|
|
end,
|
|
|
|
})
|
2024-03-30 13:12:22 +01:00
|
|
|
|
|
|
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
|
|
|
vim.lsp.handlers.hover, { border = "single" }
|
|
|
|
)
|
|
|
|
|
|
|
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
|
|
|
vim.lsp.handlers.signature_help, { border = "single" }
|
|
|
|
)
|
|
|
|
|
|
|
|
vim.diagnostic.config {
|
|
|
|
float = { border = "single" }
|
|
|
|
}
|
2023-06-16 14:19:22 +02:00
|
|
|
'';
|
|
|
|
}
|
2023-12-03 13:59:48 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-cmp;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
|
|
local lspconfig = require('lspconfig')
|
|
|
|
|
2023-12-03 22:10:42 +01:00
|
|
|
local servers = {
|
|
|
|
'nil_ls',
|
|
|
|
'rust_analyzer',
|
|
|
|
'marksman',
|
|
|
|
'lua_ls',
|
2024-02-16 05:55:27 +01:00
|
|
|
'html',
|
2023-12-03 22:10:42 +01:00
|
|
|
'clangd',
|
|
|
|
'texlab',
|
|
|
|
'crystalline',
|
2023-12-03 22:16:47 +01:00
|
|
|
'prismals',
|
2024-02-16 05:55:27 +01:00
|
|
|
'jsonls',
|
2023-12-29 23:54:54 +01:00
|
|
|
'sqlls',
|
2023-12-03 22:10:42 +01:00
|
|
|
'emmet_language_server',
|
|
|
|
'astro',
|
2024-02-16 05:55:27 +01:00
|
|
|
'cssls',
|
2023-12-03 22:10:42 +01:00
|
|
|
}
|
|
|
|
|
2023-12-03 13:59:48 +01:00
|
|
|
for _, lsp in ipairs(servers) do
|
|
|
|
lspconfig[lsp].setup {
|
|
|
|
capabilities = capabilities,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2024-02-09 04:51:22 +01:00
|
|
|
local luasnip = require('luasnip')
|
|
|
|
local cmp = require('cmp')
|
2023-12-03 13:59:48 +01:00
|
|
|
|
|
|
|
cmp.setup {
|
|
|
|
snippet = {
|
|
|
|
expand = function(args)
|
|
|
|
luasnip.lsp_expand(args.body)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
mapping = cmp.mapping.preset.insert({
|
2024-02-09 04:51:22 +01:00
|
|
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
2023-12-03 13:59:48 +01:00
|
|
|
['<C-Space>'] = cmp.mapping.complete(),
|
|
|
|
['<CR>'] = cmp.mapping.confirm {
|
|
|
|
behavior = cmp.ConfirmBehavior.Replace,
|
|
|
|
select = true,
|
|
|
|
},
|
|
|
|
['<Tab>'] = cmp.mapping(function(fallback)
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_next_item()
|
|
|
|
elseif luasnip.expand_or_jumpable() then
|
|
|
|
luasnip.expand_or_jump()
|
|
|
|
else
|
|
|
|
fallback()
|
|
|
|
end
|
|
|
|
end, { 'i', 's' }),
|
|
|
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_prev_item()
|
|
|
|
elseif luasnip.jumpable(-1) then
|
|
|
|
luasnip.jump(-1)
|
|
|
|
else
|
|
|
|
fallback()
|
|
|
|
end
|
|
|
|
end, { 'i', 's' }),
|
|
|
|
}),
|
|
|
|
sources = {
|
|
|
|
{ name = 'nvim_lsp' },
|
|
|
|
{ name = 'luasnip' },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
cmp-nvim-lsp
|
|
|
|
cmp_luasnip
|
2023-12-03 21:39:14 +01:00
|
|
|
{
|
|
|
|
plugin = luasnip;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require("luasnip.loaders.from_vscode").lazy_load()
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
friendly-snippets
|
2023-06-16 14:19:22 +02:00
|
|
|
{
|
2024-02-19 14:28:22 +01:00
|
|
|
plugin = base16-nvim;
|
2023-06-16 14:19:22 +02:00
|
|
|
type = "lua";
|
2024-04-05 19:28:23 +02:00
|
|
|
config = "vim.cmd('colorscheme base16-${slug}')";
|
2023-06-16 14:19:22 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = lualine-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
local theme = require("lualine.themes.base16")
|
|
|
|
theme.normal.b.bg = nil
|
|
|
|
theme.normal.c.bg = nil
|
|
|
|
theme.replace.b.bg = nil
|
|
|
|
theme.insert.b.bg = nil
|
|
|
|
theme.visual.b.bg = nil
|
|
|
|
theme.inactive.a.bg = nil
|
|
|
|
theme.inactive.b.bg = nil
|
|
|
|
theme.inactive.c.bg = nil
|
2023-06-09 16:34:42 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
require('lualine').setup {
|
2023-07-11 13:58:33 +02:00
|
|
|
options = {
|
|
|
|
theme = theme,
|
2023-12-02 19:33:26 +01:00
|
|
|
disabled_filetypes = {'NvimTree', 'tagbar'}
|
2023-07-11 13:58:33 +02:00
|
|
|
},
|
2023-06-16 14:19:22 +02:00
|
|
|
sections = { lualine_c = {'%f'} }
|
2023-06-06 02:37:52 +02:00
|
|
|
}
|
2023-06-16 14:19:22 +02:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = git-blame-nvim;
|
|
|
|
type = "lua";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = comment-nvim;
|
|
|
|
type = "lua";
|
2023-12-30 23:36:13 +01:00
|
|
|
config = /* lua */ ''
|
|
|
|
require('Comment').setup {
|
|
|
|
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()
|
|
|
|
}
|
|
|
|
'';
|
2023-06-16 14:19:22 +02:00
|
|
|
}
|
2023-07-11 03:58:02 +02:00
|
|
|
{
|
|
|
|
plugin = zen-mode-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require("zen-mode").setup({
|
|
|
|
window = {
|
|
|
|
backdrop = 1,
|
|
|
|
width = 80,
|
|
|
|
height = 0.9,
|
|
|
|
options = {
|
|
|
|
signcolumn = "no",
|
|
|
|
number = false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
on_open = function(win)
|
|
|
|
vim.cmd("ScrollbarHide")
|
|
|
|
end,
|
|
|
|
on_close = function()
|
|
|
|
vim.cmd("ScrollbarShow")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
}
|
2023-06-16 14:19:22 +02:00
|
|
|
{
|
|
|
|
plugin = plenary-nvim;
|
|
|
|
type = "lua";
|
|
|
|
}
|
2023-07-20 00:19:22 +02:00
|
|
|
{
|
|
|
|
plugin = nvim-autopairs;
|
|
|
|
type = "lua";
|
2024-04-06 20:25:10 +02:00
|
|
|
config = /* lua */ ''
|
|
|
|
require("nvim-autopairs").setup()
|
|
|
|
'';
|
2023-07-26 16:00:42 +02:00
|
|
|
}
|
2023-06-16 14:19:22 +02:00
|
|
|
{
|
|
|
|
plugin = auto-save-nvim;
|
|
|
|
type = "lua";
|
2024-04-06 20:25:10 +02:00
|
|
|
config = /* lua */ ''
|
|
|
|
require("auto-save").setup()
|
|
|
|
'';
|
2023-06-16 14:19:22 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vimtex;
|
|
|
|
config = /* vim */ ''
|
|
|
|
let g:vimtex_mappings_enabled = 0
|
|
|
|
let g:vimtex_imaps_enabled = 0
|
|
|
|
let g:vimtex_view_method = 'zathura'
|
|
|
|
let g:vimtex_compiler_latexmk = {'build_dir': '.tex'}
|
2023-06-13 15:08:28 +02:00
|
|
|
|
2023-06-16 14:19:22 +02:00
|
|
|
nnoremap <localleader>f <plug>(vimtex-view)
|
|
|
|
nnoremap <localleader>g <plug>(vimtex-compile)
|
|
|
|
nnoremap <localleader>d <plug>(vimtex-env-delete)
|
|
|
|
nnoremap <localleader>c <plug>(vimtex-env-change)
|
|
|
|
'';
|
|
|
|
}
|
2023-08-01 18:15:58 +02:00
|
|
|
{
|
|
|
|
plugin = vim-markdown;
|
|
|
|
config = /* vim */ ''
|
|
|
|
let g:vim_markdown_folding_disabled = 1
|
|
|
|
let g:vim_markdown_conceal = 0
|
|
|
|
let g:vim_markdown_frontmatter = 1
|
|
|
|
let g:vim_markdown_toml_frontmatter = 1
|
|
|
|
let g:vim_markdown_json_frontmatter = 1
|
|
|
|
'';
|
|
|
|
}
|
2023-12-03 21:44:56 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-ts-autotag;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require('nvim-ts-autotag').setup()
|
|
|
|
'';
|
|
|
|
}
|
2023-12-21 00:19:10 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-surround;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require('nvim-surround').setup()
|
|
|
|
'';
|
|
|
|
}
|
2023-12-30 01:44:28 +01:00
|
|
|
{
|
|
|
|
plugin = tailwindcss-colors-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require('tailwindcss-colors').setup()
|
|
|
|
'';
|
|
|
|
}
|
2023-12-30 23:36:13 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-ts-context-commentstring;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require('ts_context_commentstring').setup {
|
|
|
|
enable_autocmd = false,
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
2024-01-12 10:26:01 +01:00
|
|
|
{
|
|
|
|
plugin = nvim-treesitter.withAllGrammars;
|
|
|
|
type = "lua";
|
|
|
|
config = /* lua */ ''
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
|
|
highlight = {
|
|
|
|
enable = true,
|
2024-01-31 13:03:16 +01:00
|
|
|
disable = function(lang)
|
2024-04-02 01:44:58 +02:00
|
|
|
if lang ~= "javascript" and lang ~= "tsx" and lang ~= "typescript" and lang ~= "astro" and lang ~= "css" and lang ~= "glsl" then
|
2024-01-31 13:03:16 +01:00
|
|
|
return true
|
|
|
|
end
|
|
|
|
end,
|
2024-01-12 10:26:01 +01:00
|
|
|
additional_vim_regex_highlighting = true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
2024-03-09 17:45:33 +01:00
|
|
|
{
|
|
|
|
plugin = vista-vim;
|
|
|
|
config = /* vim */ ''
|
|
|
|
let g:vista_default_executive = 'nvim_lsp'
|
|
|
|
let g:vista_executive_for = {
|
|
|
|
\ 'rust': 'ctags',
|
|
|
|
\ }
|
|
|
|
|
|
|
|
autocmd QuitPre * silent! :Vista!
|
|
|
|
'';
|
|
|
|
}
|
2023-06-16 14:19:22 +02:00
|
|
|
fzf-vim
|
|
|
|
vim-caddyfile
|
|
|
|
vim-graphql
|
|
|
|
vim-pug
|
|
|
|
vim-prisma
|
|
|
|
vim-javascript
|
|
|
|
vim-jsx-pretty
|
|
|
|
vim-vue
|
|
|
|
vim-over
|
|
|
|
csv-vim
|
|
|
|
rust-vim
|
2023-07-15 18:32:54 +02:00
|
|
|
yuck-vim
|
2023-06-16 14:19:22 +02:00
|
|
|
neoformat
|
|
|
|
bufdelete-nvim
|
|
|
|
vim-crystal
|
2024-01-18 03:08:02 +01:00
|
|
|
vim-nix-rummik
|
2023-07-09 02:12:51 +02:00
|
|
|
fcitx-vim
|
2023-10-25 19:31:00 +02:00
|
|
|
typst-vim
|
2023-12-03 15:03:50 +01:00
|
|
|
emmet-vim
|
2023-12-02 19:33:26 +01:00
|
|
|
tagbar
|
2023-12-21 00:20:10 +01:00
|
|
|
yats-vim
|
2024-04-01 21:03:18 +02:00
|
|
|
rainbow-delimiters-nvim
|
2023-06-16 14:19:22 +02:00
|
|
|
];
|
|
|
|
};
|
2023-05-17 01:10:15 +02:00
|
|
|
}
|