aboutsummaryrefslogtreecommitdiff
path: root/store/config
diff options
context:
space:
mode:
Diffstat (limited to 'store/config')
-rw-r--r--store/config/aichat/roles/blogger.md4
-rw-r--r--store/config/aichat/roles/coder.md5
-rw-r--r--store/config/etc/fonts/local.conf60
-rw-r--r--store/config/halloy/config.toml20
-rw-r--r--store/config/home/bash_profile1
-rw-r--r--store/config/home/bashrc13
-rw-r--r--store/config/home/gitconfig11
-rw-r--r--store/config/mihomo/config.yaml101
-rw-r--r--store/config/mihomo/need-rule4
-rw-r--r--store/config/nvim/init.lua28
-rw-r--r--store/config/nvim/lazy-lock.json19
-rw-r--r--store/config/nvim/lua/plugins.lua40
-rw-r--r--store/config/nvim/lua/setup/init.lua45
-rw-r--r--store/config/nvim/lua/setup/lsp.lua126
-rw-r--r--store/config/nvim/lua/setup/plugins/cmp.lua30
-rw-r--r--store/config/nvim/lua/setup/plugins/gitsigns.lua40
-rw-r--r--store/config/nvim/lua/setup/plugins/init.lua24
-rw-r--r--store/config/nvim/lua/setup/plugins/lint.lua94
-rw-r--r--store/config/nvim/lua/setup/plugins/telescope.lua28
-rw-r--r--store/config/nvim/lua/setup/plugins/tree-sitter.lua11
-rw-r--r--store/config/nvim/lua/setup/win.lua15
21 files changed, 719 insertions, 0 deletions
diff --git a/store/config/aichat/roles/blogger.md b/store/config/aichat/roles/blogger.md
new file mode 100644
index 0000000..b2ebb65
--- /dev/null
+++ b/store/config/aichat/roles/blogger.md
@@ -0,0 +1,4 @@
+model: deepseek:deepseek-chat
+
+---
+You are DeepSeek, an AI assistant specialized in English writing. Your task is to refine my writings and explain the changes to help me improve my English writing skills.
diff --git a/store/config/aichat/roles/coder.md b/store/config/aichat/roles/coder.md
new file mode 100644
index 0000000..ae5458b
--- /dev/null
+++ b/store/config/aichat/roles/coder.md
@@ -0,0 +1,5 @@
+model: deepseek:deepseek-chat
+temperature: 0
+
+---
+You are an AI programming assistant. Help users write, debug, and optimize code. Provide clear, well-commented examples, explain concepts simply, and suggest multiple solutions when possible. Prioritize best practices like readability, efficiency, and security. Ask clarifying questions if the request is unclear.
diff --git a/store/config/etc/fonts/local.conf b/store/config/etc/fonts/local.conf
new file mode 100644
index 0000000..a8dbe2b
--- /dev/null
+++ b/store/config/etc/fonts/local.conf
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
+<fontconfig>
+
+ <alias>
+ <family>sans-serif</family>
+ <prefer>
+ <family>MiSans</family>
+ </prefer>
+ </alias>
+
+ <alias>
+ <family>serif</family>
+ <prefer>
+ <family>MiSans</family>
+ </prefer>
+ </alias>
+
+ <alias>
+ <family>monospace</family>
+ <prefer>
+ <family>Maple Mono</family>
+ </prefer>
+ </alias>
+
+ <alias>
+ <family>MiSans</family>
+ <prefer>
+ <family>MiSans</family>
+ <family>Noto Color Emoji</family>
+ </prefer>
+ </alias>
+
+ <alias>
+ <family>Maple Mono</family>
+ <prefer>
+ <family>Maple Mono</family>
+ <family>Maple Mono NF</family>
+ <family>Maple Mono NF CN</family>
+ <family>Noto Color Emoji</family>
+ </prefer>
+ </alias>
+
+ <alias>
+ <family>Noto Sans</family>
+ <prefer>
+ <family>Noto Sans</family>
+ <family>Noto Sans CJK SC</family>
+ </prefer>
+ </alias>
+
+ <alias>
+ <family>Noto Serif</family>
+ <prefer>
+ <family>Noto Serif</family>
+ <family>Noto Serif CJK SC</family>
+ </prefer>
+ </alias>
+
+</fontconfig> \ No newline at end of file
diff --git a/store/config/halloy/config.toml b/store/config/halloy/config.toml
new file mode 100644
index 0000000..5d39f52
--- /dev/null
+++ b/store/config/halloy/config.toml
@@ -0,0 +1,20 @@
+tooltips = true
+
+[notifications]
+direct_message = { sound = "peck", show_toast = true }
+connected = { sound = "ring", show_toast = true }
+disconnected = { sound = "ring", show_toast = true }
+
+[notifications.highlight]
+sound = "dong"
+exclude = [ "NickServ" ]
+
+[servers.liberachat]
+nickname = "crupest"
+server = "irc.libera.chat"
+channels = [ "#hurd" ]
+use_tls = true
+
+[servers.liberachat.sasl.plain]
+username = "crupest"
+password = ...
diff --git a/store/config/home/bash_profile b/store/config/home/bash_profile
new file mode 100644
index 0000000..b65f405
--- /dev/null
+++ b/store/config/home/bash_profile
@@ -0,0 +1 @@
+export PATH="$HOME/.local/bin:$PATH"
diff --git a/store/config/home/bashrc b/store/config/home/bashrc
new file mode 100644
index 0000000..e59b2a4
--- /dev/null
+++ b/store/config/home/bashrc
@@ -0,0 +1,13 @@
+set-proxy() {
+ export http_proxy="http://127.0.0.1:7897"
+ export https_proxy="http://127.0.0.1:7897"
+ export HTTP_PROXY="http://127.0.0.1:7897"
+ export HTTPS_PROXY="http://127.0.0.1:7897"
+}
+
+unset-proxy() {
+ unset http_proxy
+ unset https_proxy
+ unset HTTP_PROXY
+ unset HTTPS_PROXY
+}
diff --git a/store/config/home/gitconfig b/store/config/home/gitconfig
new file mode 100644
index 0000000..4b88c56
--- /dev/null
+++ b/store/config/home/gitconfig
@@ -0,0 +1,11 @@
+[user]
+ name = Yuqian Yang
+ email = crupest@crupest.life
+[core]
+ autocrlf = false
+ editor = vim
+[credential]
+ helper = /usr/lib/git-core/git-credential-libsecret
+[alias]
+ lg = log --decorate --oneline --graph
+ pap = push --all --prune
diff --git a/store/config/mihomo/config.yaml b/store/config/mihomo/config.yaml
new file mode 100644
index 0000000..c455409
--- /dev/null
+++ b/store/config/mihomo/config.yaml
@@ -0,0 +1,101 @@
+mixed-port: 7897
+mode: rule
+log-level: info
+external-controller: 127.0.0.1:9090
+profile:
+ store-selected: true
+
+external-ui: ui/metacubexd
+external-ui-name: metacubexd
+external-ui-url: https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip
+
+geox-url:
+ geoip: https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat
+ geosite: https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat
+ mmdb: https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb
+ asn: https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/GeoLite2-ASN.mmdb
+geo-auto-update: true
+geo-update-interval: 24
+
+ipv6: false
+unified-delay: true
+global-client-fingerprint: edge
+
+dns:
+ enable: true
+ ipv6: true
+ default-nameserver:
+ - 223.5.5.5
+ - 119.29.29.29
+ nameserver:
+# - 9.9.9.11
+# - tls://1.1.1.1
+ - https://doh.pub/dns-query
+ - https://dns.alidns.com/dns-query
+ - 223.5.5.5
+ - 119.29.29.29
+
+sniffer:
+ enable: true
+ sniff:
+ HTTP:
+ ports: [80]
+ TLS:
+ ports: [443]
+ QUIC:
+ ports: [443]
+ skip-domain:
+ - "Mijia Cloud"
+
+rule-providers:
+ cn:
+ type: file
+ path: has-rule
+ behavior: classical
+ format: text
+
+ non-cn:
+ type: file
+ path: not-has-rule
+ behavior: classical
+ format: text
+
+ need:
+ type: file
+ path: need-rule
+ behavior: classical
+ format: text
+
+rules:
+ - RULE-SET,cn,DIRECT
+ - RULE-SET,non-cn,node-select
+ - RULE-SET,need,node-select
+# - NOT,((GEOIP,CN)),node-select
+ - DOMAIN-SUFFIX,gnu.org,node-select
+ - DOMAIN-SUFFIX,nongnu.org,node-select
+ - DOMAIN-SUFFIX,ietf.org,node-select
+ - DOMAIN-SUFFIX,metacubex.one,node-select
+ - DOMAIN-SUFFIX,winehq.org,node-select
+ - DOMAIN-SUFFIX,freedesktop.org,node-select
+ - DOMAIN-SUFFIX,eff.org,node-select
+ - DOMAIN-SUFFIX,typescriptlang.org,node-select
+ - DOMAIN-SUFFIX,arxiv.org,node-select
+# - MATCH,node-select
+ - MATCH,DIRECT
+
+proxy-groups:
+ - name: node-select
+ type: select
+ proxies:
+ - auto-select
+ use:
+ - money
+
+ - name: auto-select
+ type: url-test
+ use:
+ - money
+ interval: 300
+ url: https://www.gstatic.com/generate_204
+ filter: 日本|新加坡|香港|台湾|美国
+ expected-status: 204
diff --git a/store/config/mihomo/need-rule b/store/config/mihomo/need-rule
new file mode 100644
index 0000000..7ffcf49
--- /dev/null
+++ b/store/config/mihomo/need-rule
@@ -0,0 +1,4 @@
+IP-CIDR,185.199.108.153/32
+IP-CIDR,185.199.109.153/32
+IP-CIDR,185.199.110.153/32
+IP-CIDR,185.199.111.153/32 \ No newline at end of file
diff --git a/store/config/nvim/init.lua b/store/config/nvim/init.lua
new file mode 100644
index 0000000..ac6961a
--- /dev/null
+++ b/store/config/nvim/init.lua
@@ -0,0 +1,28 @@
+vim.crupest = {}
+
+local lazy_path = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.uv.fs_stat(lazy_path) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazy_path,
+ })
+end
+vim.opt.rtp:prepend(lazy_path)
+require("lazy").setup {
+ spec = { { import = "plugins" } }
+}
+
+if vim.g.neovide then
+ vim.opt.guifont = "Maple Mono";
+ vim.g.neovide_normal_opacity = 0.95;
+ vim.g.neovide_input_ime = false;
+ vim.g.neovide_cursor_animate_in_insert_mode = false
+ vim.g.neovide_input_macos_option_key_is_meta = 'only_left'
+ vim.cmd("colorscheme catppuccin-macchiato")
+end
+
+require("setup").setup()
diff --git a/store/config/nvim/lazy-lock.json b/store/config/nvim/lazy-lock.json
new file mode 100644
index 0000000..4f6c2b5
--- /dev/null
+++ b/store/config/nvim/lazy-lock.json
@@ -0,0 +1,19 @@
+{
+ "catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" },
+ "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
+ "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
+ "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
+ "gitsigns.nvim": { "branch": "main", "commit": "731b581428ec6c1ccb451b95190ebbc6d7006db7" },
+ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
+ "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
+ "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
+ "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
+ "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
+ "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
+ "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" },
+ "nvim-lspconfig": { "branch": "master", "commit": "7ad4a11cc5742774877c529fcfb2702f7caf75e4" },
+ "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
+ "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
+ "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
+ "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }
+}
diff --git a/store/config/nvim/lua/plugins.lua b/store/config/nvim/lua/plugins.lua
new file mode 100644
index 0000000..85de362
--- /dev/null
+++ b/store/config/nvim/lua/plugins.lua
@@ -0,0 +1,40 @@
+-- spellchecker: disable
+return {
+ {
+ "catppuccin/nvim",
+ name = "catppuccin",
+ priority = 1000
+ },
+ {
+ "neovim/nvim-lspconfig"
+ },
+ {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate"
+ },
+ {
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v3.x",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
+ "MunifTanjim/nui.nvim",
+ -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
+ },
+ },
+ {
+ "nvim-lualine/lualine.nvim",
+ dependencies = { 'nvim-tree/nvim-web-devicons' }
+ },
+ {
+ "nvim-telescope/telescope.nvim",
+ dependencies = { 'nvim-lua/plenary.nvim' }
+ },
+ { "lewis6991/gitsigns.nvim" },
+ { "hrsh7th/nvim-cmp" },
+ { "hrsh7th/cmp-nvim-lsp" },
+ { "hrsh7th/cmp-buffer" },
+ { "hrsh7th/cmp-path" },
+ { "windwp/nvim-autopairs" },
+ { "mfussenegger/nvim-lint" },
+}
diff --git a/store/config/nvim/lua/setup/init.lua b/store/config/nvim/lua/setup/init.lua
new file mode 100644
index 0000000..bbce01c
--- /dev/null
+++ b/store/config/nvim/lua/setup/init.lua
@@ -0,0 +1,45 @@
+local function close_float()
+ local wins = vim.api.nvim_list_wins()
+ for _, v in ipairs(wins) do
+ if vim.api.nvim_win_get_config(v).relative ~= '' then
+ vim.api.nvim_win_close(v, false)
+ end
+ end
+end
+
+local function setup()
+ if vim.fn.has("win32") ~= 0 then
+ require("setup.win").setup()
+ end
+
+ vim.opt.termguicolors = true;
+ vim.opt.fileformats = "unix,dos";
+ vim.opt.number = true;
+
+ vim.g.load_doxygen_syntax = true;
+ vim.g.doxygen_javadoc_autobrief = false;
+
+ vim.keymap.set("n", "<c-tab>", "<cmd>bnext<cr>")
+ vim.keymap.set("n", "<c-s-tab>", "<cmd>bNext<cr>")
+ vim.keymap.set("n", "<esc>", close_float)
+ vim.keymap.set('t', '<A-n>', '<C-\\><C-n>')
+ vim.keymap.set('t', '<A-p>', function()
+ local register = vim.fn.input("Enter register: ")
+ if register == "" then
+ register = '"'
+ end
+ return '<C-\\><C-N>"' .. register .. 'pi'
+ end, { expr = true })
+
+ vim.cmd("autocmd FileType gitcommit,gitrebase,gitconfig set bufhidden=delete")
+
+ vim.diagnostic.config({ virtual_text = true })
+ vim.keymap.set("n", "grl", vim.diagnostic.open_float)
+
+ require("setup.lsp").setup()
+ require("setup.plugins").setup()
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/lsp.lua b/store/config/nvim/lua/setup/lsp.lua
new file mode 100644
index 0000000..4216f1c
--- /dev/null
+++ b/store/config/nvim/lua/setup/lsp.lua
@@ -0,0 +1,126 @@
+vim.lsp.config("*", {
+ capabilities = vim.tbl_extend("force",
+ vim.lsp.protocol.make_client_capabilities(),
+ require("cmp_nvim_lsp").default_capabilities()
+ )
+})
+
+---@param ev vim.api.keyset.create_autocmd.callback_args
+---@param name string
+local function client_name_is(ev, name)
+ local client = vim.lsp.get_client_by_id(ev.data.client_id)
+ return client and client.name == name
+end
+
+local function setup_clangd()
+ local clangd = "clangd"
+ local brew_clangd_path = "/usr/local/opt/llvm/bin/clangd"
+
+ if vim.uv.fs_stat(brew_clangd_path) ~= nil then
+ clangd = brew_clangd_path
+ end
+
+ vim.lsp.config("clangd", { cmd = { clangd } })
+
+ vim.api.nvim_create_autocmd("LspAttach", {
+ callback = function(ev)
+ if client_name_is(ev, "clangd") then
+ vim.keymap.set("n", "grs", "<cmd>ClangdSwitchSourceHeader<cr>", {
+ buffer = ev.buf
+ })
+ end
+ end
+ })
+
+ vim.api.nvim_create_autocmd("LspDetach", {
+ callback = function(ev)
+ if client_name_is(ev, "clangd") then
+ vim.keymap.del("n", "grs", { buffer = ev.buf })
+ end
+ end
+ })
+end
+
+local function setup_lua_ls()
+ vim.lsp.config("lua_ls", {
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT"
+ },
+ diagnostics = {
+ globals = { "vim" },
+ },
+ workspace = {
+ library = {
+ [vim.fn.expand "$VIMRUNTIME/lua"] = true,
+ [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
+ [vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
+ },
+ },
+ },
+ },
+ })
+end
+
+function vim.crupest.no_range_format()
+ print("Lsp doesn't support range formatting. Use gqa to format the whole document.")
+ return 0
+end
+
+local function setup_denols()
+ vim.lsp.config("denols", {
+ root_dir = function(bufnr, on_dir)
+ local deno_configs = vim.fs.find({ "deno.json", "deno.jsonc" }, {
+ path = vim.api.nvim_buf_get_name(bufnr), upward = true, limit = math.huge })
+ if 0 ~= #deno_configs then
+ local deno_config = deno_configs[#deno_configs]
+ on_dir(vim.fs.dirname(deno_config))
+ end
+ end,
+ })
+
+ vim.api.nvim_create_autocmd("LspAttach", {
+ callback = function(ev)
+ if client_name_is(ev, "denols") then
+ vim.api.nvim_set_option_value(
+ "formatexpr",
+ "v:lua.vim.crupest.no_range_format()",
+ { buf = ev.buf }
+ )
+ end
+ end
+ })
+
+ vim.api.nvim_create_autocmd("LspDetach", {
+ callback = function(ev)
+ if client_name_is(ev, "denols") then
+ vim.api.nvim_set_option_value("formatexpr", "", { buf = ev.buf })
+ end
+ end
+ })
+end
+
+
+local function setup()
+ vim.api.nvim_create_autocmd("LspAttach", {
+ callback = function(ev)
+ vim.keymap.set("n", "gqa", vim.lsp.buf.format, { buffer = ev.buf })
+ end
+ })
+
+ vim.api.nvim_create_autocmd("LspDetach", {
+ callback = function(ev)
+ vim.keymap.del("n", "gqa", { buffer = ev.buf })
+ end
+ })
+
+ setup_clangd()
+ setup_lua_ls()
+ setup_denols()
+ vim.lsp.enable({ "clangd", "lua_ls", "denols" })
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/plugins/cmp.lua b/store/config/nvim/lua/setup/plugins/cmp.lua
new file mode 100644
index 0000000..be9f8ea
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/cmp.lua
@@ -0,0 +1,30 @@
+local function setup()
+ local cmp = require("cmp")
+
+ cmp.setup {
+ snippet = {
+ expand = function(args)
+ vim.snippet.expand(args.body)
+ end,
+ },
+ mapping = cmp.mapping.preset.insert({
+ ['<C-b>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+ ['<C-j>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
+ ['<C-k>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
+ ['<C-e>'] = cmp.mapping.abort(),
+ ['<C-y>'] = cmp.mapping.confirm({ select = true }),
+ ['<CR>'] = cmp.mapping.confirm({ select = true }),
+ }),
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ { name = 'path' },
+ }, {
+ { name = 'buffer' },
+ })
+ }
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/plugins/gitsigns.lua b/store/config/nvim/lua/setup/plugins/gitsigns.lua
new file mode 100644
index 0000000..957c661
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/gitsigns.lua
@@ -0,0 +1,40 @@
+local function setup()
+ local gitsigns = require('gitsigns')
+
+ gitsigns.setup {
+ on_attach = function(bufnr)
+ local function map(mode, l, r, opts)
+ opts = opts or {}
+ opts.buffer = bufnr
+ vim.keymap.set(mode, l, r, opts)
+ end
+
+ -- Navigation
+ map('n', ']c', function()
+ if vim.wo.diff then
+ vim.cmd.normal({ ']c', bang = true })
+ else
+ gitsigns.nav_hunk('next')
+ end
+ end)
+
+ map('n', '[c', function()
+ if vim.wo.diff then
+ vim.cmd.normal({ '[c', bang = true })
+ else
+ gitsigns.nav_hunk('prev')
+ end
+ end)
+
+ -- Actions
+ map('n', '<leader>gc', gitsigns.preview_hunk)
+ map('n', '<leader>gt', gitsigns.toggle_deleted)
+ map('n', '<leader>gd', gitsigns.diffthis)
+ map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
+ end
+ }
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/plugins/init.lua b/store/config/nvim/lua/setup/plugins/init.lua
new file mode 100644
index 0000000..8f1346b
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/init.lua
@@ -0,0 +1,24 @@
+local function setup()
+ require('lualine').setup {}
+ require("neo-tree").setup {
+ filesystem = {
+ filtered_items = {
+ hide_dotfiles = false,
+ hide_gitignored = false,
+ hide_hidden = false,
+ }
+ }
+ }
+
+ require("setup.plugins.telescope").setup()
+ require("setup.plugins.gitsigns").setup()
+
+ require("setup.plugins.tree-sitter").setup()
+ require("setup.plugins.lint").setup()
+ require("setup.plugins.cmp").setup()
+ require("nvim-autopairs").setup {}
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/plugins/lint.lua b/store/config/nvim/lua/setup/plugins/lint.lua
new file mode 100644
index 0000000..d03f539
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/lint.lua
@@ -0,0 +1,94 @@
+--- spellchecker: ignore markdownlintrc
+
+---@alias CruLinter { name: string, config_patterns: string[], filetypes: string[] | nil, fast: boolean }
+
+local cspell = {
+ name = "cspell",
+ config_patterns = {
+ ".cspell.json",
+ "cspell.json",
+ ".cSpell.json",
+ "cSpell.json",
+ "cspell.config.js",
+ "cspell.config.cjs",
+ "cspell.config.json",
+ "cspell.config.yaml",
+ "cspell.config.yml",
+ "cspell.yaml",
+ "cspell.yml",
+ },
+ fast = true,
+}
+
+local markdownlint = {
+ name = "markdownlint",
+ config_patterns = {
+ ".markdownlint.jsonc",
+ ".markdownlint.json",
+ ".markdownlint.yaml",
+ ".markdownlint.yml",
+ ".markdownlintrc",
+ },
+ filetypes = { "markdown" },
+ fast = true,
+}
+
+local linters = { cspell = cspell, markdownlint = markdownlint }
+
+---@param linter CruLinter
+---@param buf integer
+---@return string | nil
+local function find_config(linter, buf)
+ local files = vim.fs.find(linter.config_patterns, {
+ path = vim.api.nvim_buf_get_name(buf), upward = true })
+ if #files ~= 0 then
+ return files[1];
+ end
+ return nil
+end
+
+vim.list_extend(require("lint.linters.markdownlint").args, {
+ "--config",
+ function()
+ return find_config(markdownlint, 0);
+ end
+})
+
+---@param linter CruLinter
+---@param buf integer
+function vim.crupest.lint(linter, buf)
+ if linter.filetypes then
+ local filetype = vim.api.nvim_get_option_value("filetype", { buf = buf })
+ if not vim.list_contains(linter.filetypes, filetype) then
+ return
+ end
+ end
+
+ if find_config(linter, buf) then
+ require("lint").try_lint(linter.name)
+ end
+end
+
+function vim.crupest.lint_all(buf, fast)
+ for _, linter in pairs(linters) do
+ if not fast or linter.fast then
+ vim.crupest.lint(linter, buf)
+ end
+ end
+end
+
+local function setup()
+ vim.api.nvim_create_autocmd(
+ { "BufReadPost", "InsertLeave", "TextChanged" },
+ {
+ callback = function(opt)
+ if vim.api.nvim_get_option_value("buftype", { buf = opt.buf }) == "" then
+ vim.crupest.lint_all(opt.buf, true)
+ end
+ end
+ })
+end
+
+return {
+ setup = setup,
+}
diff --git a/store/config/nvim/lua/setup/plugins/telescope.lua b/store/config/nvim/lua/setup/plugins/telescope.lua
new file mode 100644
index 0000000..69a69c0
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/telescope.lua
@@ -0,0 +1,28 @@
+local function setup()
+ local builtin = require('telescope.builtin')
+ vim.keymap.set('n', '<leader>/', builtin.live_grep, {})
+ vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
+ vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
+ vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
+ vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
+ vim.keymap.set('n', '<leader>fr', builtin.registers, {})
+ vim.keymap.set('n', '<leader>fq', builtin.quickfixhistory, {})
+ vim.keymap.set('n', '<leader>fm', builtin.marks, {})
+ vim.keymap.set('n', '<leader>fd', builtin.diagnostics, {})
+ vim.keymap.set('n', '<leader>fs', builtin.lsp_workspace_symbols, {})
+
+ local function all_files(opts)
+ opts = vim.tbl_extend('force', {
+ hidden = true,
+ no_ignore = true,
+ no_ignore_parent = true,
+ }, opts or {})
+ builtin.find_files(opts)
+ end
+
+ vim.keymap.set('n', '<leader>fa', all_files, {})
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/plugins/tree-sitter.lua b/store/config/nvim/lua/setup/plugins/tree-sitter.lua
new file mode 100644
index 0000000..043f425
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/tree-sitter.lua
@@ -0,0 +1,11 @@
+local function setup()
+ require'nvim-treesitter.configs'.setup {
+ highlight = { enable = true },
+ incremental_selection = { enable = true },
+ textobjects = { enable = true },
+ }
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/win.lua b/store/config/nvim/lua/setup/win.lua
new file mode 100644
index 0000000..9aa979d
--- /dev/null
+++ b/store/config/nvim/lua/setup/win.lua
@@ -0,0 +1,15 @@
+-- spellchecker: ignore shellcmdflag shellredir shellpipe shellquote shellxquote
+local function setup()
+ vim.cmd([[
+ let &shell = executable('pwsh') ? 'pwsh' : 'powershell'
+ let &shellcmdflag = '-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues[''Out-File:Encoding'']=''utf8'';Remove-Alias -Force -ErrorAction SilentlyContinue tee;'
+ let &shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode'
+ let &shellpipe = '2>&1 | %%{ "$_" } | tee %s; exit $LastExitCode'
+ set shellquote= shellxquote=
+ ]])
+ vim.opt.completeslash = 'slash'
+end
+
+return {
+ setup = setup
+}