Compare commits

...

4 commits

47 changed files with 1061 additions and 561 deletions

View file

@ -1,8 +0,0 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

View file

@ -1,15 +0,0 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View file

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -1,4 +0,0 @@
# 💤 LazyVim
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.

View file

@ -1,2 +1,5 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.options")
require("config.core")
require("config.lazy")
require("config.autocmds")
require("config.keymaps")

View file

@ -1,54 +1,31 @@
{
"LazyVim": { "branch": "main", "commit": "d0c366e4d861b848bdc710696d5311dca2c6d540" },
"SchemaStore.nvim": { "branch": "main", "commit": "545d8814f624fb5239c4691fa0914549540e6f53" },
"blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" },
"bufferline.nvim": { "branch": "main", "commit": "5726c4e291224181903e960119a11e20ac677a0a" },
"catppuccin": { "branch": "main", "commit": "c9e205fe035d622b3c2d66ee42edf368c0c31fd5" },
"conform.nvim": { "branch": "master", "commit": "339b3e4519ec49312d34fcfa275aa15bfaa67025" },
"blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"crates.nvim": { "branch": "main", "commit": "1c924d5a9ea3496c4e1a02d0d51388ba809f8468" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"fzf-lua": { "branch": "main", "commit": "76e25abc4bbaab243b52fad7f7d4262e76254fd3" },
"fzf-lua": { "branch": "main", "commit": "a534583995c6e521c55793d2cd11e5a4330a5d0a" },
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
"gleam.vim": { "branch": "master", "commit": "6739d8b656adb5d2807675b7652afb6e257b2b1c" },
"grug-far.nvim": { "branch": "main", "commit": "c88435b825a35bfa468b47159709b3221976ecd1" },
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
"jinja.vim": { "branch": "master", "commit": "70c2d09857bc2ff75a91b017271ffaa004201df9" },
"grug-far.nvim": { "branch": "main", "commit": "8e8f3429038d45a6d4144c0642d92f470e5480f3" },
"jinja.vim": { "branch": "master", "commit": "06fcfeeb20c6c76d6fee021b250c8780c38e2925" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"markdown-preview.nvim": { "branch": "master", "commit": "9becceee5740b7db6914da87358a183ad11b2049" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" },
"mini.hipatterns": { "branch": "main", "commit": "fdad87bf545aec5210ca9a2c49fddf6284d72d1e" },
"mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" },
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
"neogit": { "branch": "master", "commit": "43fa47fb61773b0d90a78ebc2521ea8faaeebd86" },
"noice.nvim": { "branch": "main", "commit": "424053c6de606701e5b5129d1a851a87ef249f65" },
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
"nvim-ansible": { "branch": "main", "commit": "44dabdaa8a9193b7f564a8408ed6d7107705030a" },
"nvim-lint": { "branch": "master", "commit": "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55" },
"nvim-lspconfig": { "branch": "master", "commit": "040001d85e9190a904d0e35ef5774633e14d8475" },
"nvim-treesitter": { "branch": "master", "commit": "eb3e850acff4d9f2f2dd8dacd75353043c899753" },
"nvim-treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-lspconfig": { "branch": "master", "commit": "343ac34abc7ab53fae33357f915024aaacb76a3e" },
"nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" },
"nvim-treesitter-context": { "branch": "master", "commit": "bece284c5322ddf6946fa4bdc383a2bc033269d7" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" },
"persistence.nvim": { "branch": "main", "commit": "c45ff862b53ce07a853a753fb0b33e148dbb99d2" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"render-markdown.nvim": { "branch": "main", "commit": "3a08669e9641ba382bc428f1776bff524a2431a1" },
"rustaceanvim": { "branch": "master", "commit": "6db1fe9e3f005b2e0921c7302d2c195eeb90a451" },
"snacks.nvim": { "branch": "main", "commit": "6a837597b3570df88946c69cca7ab810ca7f05f5" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"rustaceanvim": { "branch": "master", "commit": "0a1876b970ab946be3f4d341e9d743a5d62d646a" },
"schemastore.nvim": { "branch": "main", "commit": "b62efcb71077bfeb407dcd05fb0584e422131150" },
"snacks.nvim": { "branch": "main", "commit": "b5f4f27b28f7803509739bfde93dc0b8a953f3f4" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"tokyonight.nvim": { "branch": "main", "commit": "b262293ef481b0d1f7a14c708ea7ca649672e200" },
"treesitter-just": { "branch": "main", "commit": "4f4e566fe47c30b14cfe388a28f70b79009609e5" },
"trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" },
"ts-comments.nvim": { "branch": "main", "commit": "79e4337e4231ff8ca33dab85162b5ee8e78f22ce" },
"venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" },
"treesitter-just": { "branch": "main", "commit": "bb0c898a80644de438e6efe5d88d30bf092935cd" },
"vim-alloy": { "branch": "main", "commit": "0273f88f7199189f9a0f32213a34ab778e226f86" },
"vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" },
"vim-just": { "branch": "main", "commit": "ed67f198e981f555c0f9e9ed5b69b4b06543a9e1" },

View file

@ -1,9 +0,0 @@
{
"extras": [
],
"news": {
"NEWS.md": "10960"
},
"version": 7
}

View file

@ -1,11 +1,126 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
local function augroup(name)
return vim.api.nvim_create_augroup("histanvim_" .. name, { clear = true })
end
--- test blinry's wiki setup
vim.api.nvim_create_autocmd({ "bufnewfile", "bufread" }, {
pattern = os.getenv("HOME") .. "/Documents/wiki/*",
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"),
callback = function()
vim.bo.filetype = "hiswiki"
if vim.o.buftype ~= "nofile" then
vim.cmd("checktime")
end
end,
})
-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("highlight_yank"),
callback = function()
(vim.hl or vim.highlight).on_yank()
end,
})
-- resize splits if window got resized
vim.api.nvim_create_autocmd({ "VimResized" }, {
group = augroup("resize_splits"),
callback = function()
local current_tab = vim.fn.tabpagenr()
vim.cmd("tabdo wincmd =")
vim.cmd("tabnext " .. current_tab)
end,
})
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup("last_loc"),
callback = function(event)
local exclude = { "gitcommit" }
local buf = event.buf
if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then
return
end
vim.b[buf].lazyvim_last_loc = true
local mark = vim.api.nvim_buf_get_mark(buf, '"')
local lcount = vim.api.nvim_buf_line_count(buf)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- close some filetypes with <q>
vim.api.nvim_create_autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
"PlenaryTestPopup",
"checkhealth",
"dbout",
"gitsigns-blame",
"grug-far",
"help",
"lspinfo",
"neotest-output",
"neotest-output-panel",
"neotest-summary",
"notify",
"oil",
"qf",
"spectre_panel",
"startuptime",
"tsplayground",
},
-- TODO: Fix error on trying to delete last buffer
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.schedule(function()
vim.keymap.set("n", "q", function()
vim.cmd("close")
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })
end, {
buffer = event.buf,
silent = true,
desc = "Quit buffer",
})
end)
end,
})
-- make it easier to close man-files when opened inline
vim.api.nvim_create_autocmd("FileType", {
group = augroup("man_unlisted"),
pattern = { "man" },
callback = function(event)
vim.bo[event.buf].buflisted = false
end,
})
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"),
pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Fix conceallevel for json files
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("json_conceal"),
pattern = { "json", "jsonc", "json5" },
callback = function()
vim.opt_local.conceallevel = 0
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),
callback = function(event)
if event.match:match("^%w%w+:[\\/][\\/]") then
return
end
local file = vim.uv.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})

View file

@ -0,0 +1,106 @@
CORE = {
icons = {
misc = {
dots = "󰇘",
},
ft = {
octo = "",
},
dap = {
Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" },
Breakpoint = "",
BreakpointCondition = "",
BreakpointRejected = { "", "DiagnosticError" },
LogPoint = ".>",
},
diagnostics = {
Error = "",
Warn = "",
Hint = "",
Info = "",
},
git = {
added = "",
modified = "",
removed = "",
},
kinds = {
Array = "",
Boolean = "󰨙 ",
Class = "",
Codeium = "󰘦 ",
Color = "",
Control = "",
Collapsed = "",
Constant = "󰏿 ",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "󰊕 ",
Interface = "",
Key = "",
Keyword = "",
Method = "󰊕 ",
Module = "",
Namespace = "󰦮 ",
Null = "",
Number = "󰎠 ",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "󱄽 ",
String = "",
Struct = "󰆼 ",
Supermaven = "",
TabNine = "󰏚 ",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "󰀫 ",
},
},
---@type table<string, string[]|boolean>?
kind_filter = {
default = {
"Class",
"Constructor",
"Enum",
"Field",
"Function",
"Interface",
"Method",
"Module",
"Namespace",
"Package",
"Property",
"Struct",
"Trait",
},
markdown = false,
help = false,
-- you can specify a different filter for each filetype
lua = {
"Class",
"Constructor",
"Enum",
"Field",
"Function",
"Interface",
"Method",
"Module",
"Namespace",
-- "Package", -- remove package since luals uses it for control flow structures
"Property",
"Struct",
"Trait",
},
},
}

View file

@ -1,32 +1,125 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local map = vim.keymap.set
-- copied from LazyVim
local function map(mode, lhs, rhs, opts)
local keys = require("lazy.core.handler").handlers.keys
---@cast keys LazyKeysHandler
-- do not create the keymap if a lazy keys handler exists
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
opts = opts or {}
opts.silent = opts.silent ~= false
if opts.remap and not vim.g.vscode then
opts.remap = nil
end
vim.keymap.set(mode, lhs, rhs, opts)
-- -- better up/down
-- map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
-- map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
-- map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
-- map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
-- Move to window using the <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true })
-- buffers
map("n", "<leader>bd", function()
Snacks.bufdelete()
end, { desc = "Delete Buffer" })
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
-- Clear search and stop snippet on escape
-- map({ "i", "n", "s" }, "<esc>", function()
-- vim.cmd("noh")
-- LazyVim.cmp.actions.snippet_stop()
-- return "<esc>"
-- end, { expr = true, desc = "Escape and Clear hlsearch" })
-- Clear search, diff update and redraw
-- taken from runtime/lua/_editor.lua
map(
"n",
"<leader>ur",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / Clear hlsearch / Diff Update" }
)
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
-- Add undo break-points
map("i", ",", ",<c-g>u")
map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u")
--keywordprg
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
-- better indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
-- commenting
map("n", "gco", "o<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Below" })
map("n", "gcO", "O<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Above" })
-- lazy
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" })
-- diagnostic
local diagnostic_goto = function(next, severity)
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
severity = severity and vim.diagnostic.severity[severity] or nil
return function()
go({ severity = severity })
end
end
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" })
map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" })
map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
-- move when highlighted
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")
-- stylua: ignore start
-- delete to void bindings
map("n", "<leader>d", '"_d', { desc = "delete to void" })
map("v", "<leader>d", '"_d', { desc = "delete to void" })
if vim.lsp.inlay_hint then
Snacks.toggle.inlay_hints():map("<leader>uh")
end
-- yank to system clipboard
map("n", "<leader>y", '"+y')
map("v", "<leader>y", '"+y')
map("n", "<leader>Y", '"+Y')
map("n", "<leader>gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" })
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" })
-- map({ "n", "x" }, "<leader>gY", function()
-- Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false })
-- end, { desc = "Git Browse (copy)" })
-- highlights under cursor
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
-- floating terminal
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
-- map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
-- map("n", "<c-/>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
-- Terminal Mappings
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- windows
map("n", "<leader>w", "<c-w>", { desc = "Windows", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
-- native snippets. only needed on < 0.11, as 0.11 creates these by default
if vim.fn.has("nvim-0.11") == 0 then
map("s", "<Tab>", function()
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
end, { expr = true, desc = "Jump Next" })
map({ "i", "s" }, "<S-Tab>", function()
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
end, { expr = true, desc = "Jump Previous" })
end

View file

@ -1,49 +1,38 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
{ import = "lazyvim.plugins.extras.editor.harpoon2" },
{ import = "lazyvim.plugins.extras.lang.ansible" },
{ import = "lazyvim.plugins.extras.lang.git" },
{ import = "lazyvim.plugins.extras.lang.gleam" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.toml" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.yaml" },
{ import = "lazyvim.plugins.extras.ui.treesitter-context" },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
-- import/override with your plugins
{ import = "plugins" },
{
"folke/tokyonight.nvim",
config = function()
vim.cmd.colorscheme("tokyonight")
end,
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
-- version = false, -- always use the latest git commit
version = "*", -- try installing the latest stable version for plugins that support semver
{ import = "config.plugins" },
},
install = { colorscheme = { "tokyonight" } },
checker = { enabled = false },
defaults = {
lazy = false,
version = "*",
},
performance = {
rtp = {
-- disable some rtp plugins

View file

@ -1,7 +1,3 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
local opt = vim.opt
vim.g.loaded_perl_provider = 0
@ -11,18 +7,28 @@ vim.g.loaded_ruby_provider = 0
vim.g.lazygit_config = false
-- don't use system clipboard by default (this is set in LazyVim's defaults)
opt.clipboard = ""
vim.g.snacks_animate = true
opt.hlsearch = false
opt.incsearch = true
opt.clipboard = ""
opt.cursorline = true
opt.list = true
opt.number = true
opt.relativenumber = true
opt.scrolloff = 8
-- disable mouse support, because i'm using it more accidentally then intentionally
-- TODO figure out how to disable mouse scrolling from terminal
opt.mouse = ""
opt.mousescroll = "ver:0,hor:0"
opt.showmode = false
opt.signcolumn = "yes"
opt.smartcase = true
opt.smartindent = true
opt.spelllang = { "en" } -- "de"??
opt.splitbelow = true
opt.splitright = true
opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]]
opt.termguicolors = true
opt.virtualedit = "block"
opt.wildmode = "longest:full,full"
-- I like 4 space indents
opt.tabstop = 4
@ -34,6 +40,8 @@ opt.swapfile = false
opt.backup = false
opt.undodir = os.getenv("HOME") .. "/.local/state/nvim/undodir"
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200
-- In my current setup 100 characters line length means that i can have 2 windows side-by-side with
-- sway and still see all characters of that line. (110 would be the absolute maximum)
@ -49,19 +57,13 @@ opt.completeopt = { "menu", "menuone", "noselect" }
vim.filetype.add({
extension = {
service = "systemd",
socket = "systemd",
alloy = "alloy",
caddy = "caddyfile",
container = "systemd",
image = "systemd",
network = "systemd",
["container.j2"] = "systemd.jinja",
["service.j2"] = "systemd.jinja",
["socket.j2"] = "systemd.jinja",
["network.j2"] = "systemd.jinja",
["image.j2"] = "systemd.jinja",
["yml.j2"] = "yaml.jinja",
["yaml.j2"] = "yaml.jinja",
["alloy.j2"] = "alloy.jinja",
service = "systemd",
socket = "systemd",
},
pattern = {
[".*/sway/conf%.d/.*"] = "swayconfig",

View file

@ -0,0 +1,29 @@
return {
{
"saghen/blink.cmp",
dependencies = "rafamadriz/friendly-snippets",
opts = {
keymap = {
preset = "default",
['<C-space>'] = { 'accept', 'fallback' },
},
appearance = {
nerd_font_variant = "mono",
},
completion = {
ghost_text = {
enabled = false
},
menu = {
auto_show = true
},
},
signature = { enabled = true },
},
},
}

View file

@ -0,0 +1,47 @@
return {
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
{ "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
{ "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
},
opts = {
options = {
close_command = function(n) Snacks.bufdelete(n) end,
right_mouse_command = function(n) Snacks.bufdelete(n) end,
diagnostics = "nvim_lsp",
always_show_bufferline = false,
diagnostics_indicator = function(_, _, diag)
local icons = CORE.icons.diagnostics
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
.. (diag.warning and icons.Warn .. diag.warning or "")
return vim.trim(ret)
end,
offsets = {
{
highlight = "Directory",
text_align = "left",
},
},
---@param opts bufferline.IconFetcherOpts
get_element_icon = function(opts)
return CORE.icons.ft[opts.filetype]
end,
},
},
config = function(_, opts)
require("bufferline").setup(opts)
-- Fix bufferline when restoring a session
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
})
end,
}

View file

@ -0,0 +1,17 @@
return {
"Saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
opts = {
completion = {
crates = {
enabled = true,
},
},
lsp = {
enabled = true,
actions = true,
completion = true,
hover = true,
},
},
}

View file

@ -0,0 +1,12 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
opts = {},
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}

View file

@ -0,0 +1,21 @@
return {
{
"grafana/vim-alloy",
ft = "alloy",
},
{
"isobit/vim-caddyfile",
ft = "caddyfile",
},
{
"gleam-lang/gleam.vim",
ft = "gleam",
},
{
"HiPhish/jinja.vim",
},
{
"NoahTheDuke/vim-just",
ft = "just",
},
}

View file

@ -0,0 +1,112 @@
return {
"ibhagwan/fzf-lua",
dependencies = { "echasnovski/mini.icons" },
cmd = "FzfLua",
opts = {
fzf_colors = true,
fzf_opts = {
["--no-scrollbar"] = true,
},
defaults = {
formatter = "path.dirname_first",
},
winopts = {
width = 0.8,
height = 0.8,
row = 0.5,
col = 0.5,
preview = {
scrollchars = { "", "" },
},
},
files = {
cwd_prompt = false,
-- actions = {
-- ["alt-i"] = { actions.toggle_ignore },
-- ["alt-h"] = { actions.toggle_hidden },
-- },
},
-- grep = {
-- actions = {
-- ["alt-i"] = { actions.toggle_ignore },
-- ["alt-h"] = { actions.toggle_hidden },
-- },
-- },
lsp = {
symbols = {
symbol_hl = function(s)
return "TroubleIcon" .. s
end,
symbol_fmt = function(s)
return s:lower() .. "\t"
end,
child_prefix = false,
},
code_actions = {
previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil,
},
},
},
keys = {
{ "<c-j>", "<c-j>", ft = "fzf", mode = "t", nowait = true },
{ "<c-k>", "<c-k>", ft = "fzf", mode = "t", nowait = true },
-- goto
{ "gd", "<cmd>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto Definition" },
{ "gr", "<cmd>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<cr>", desc = "References", nowait = true },
{ "gI", "<cmd>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto Implementation" },
{ "gy", "<cmd>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto T[y]pe Definition" },
-- shortcuts
{
"<leader>,",
"<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>",
desc = "Switch Buffer",
},
{ "<leader>:", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
{ "<leader><leader>", "<cmd>FzfLua files<cr>", desc = "Find Files" },
-- find files
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
-- { "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
{ "<leader>ff", "<cmd>FzfLua files<cr>", desc = "Find Files" },
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
-- git
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
-- search
{ '<leader>s"', "<cmd>FzfLua registers<cr>", desc = "Registers" },
{ "<leader>sa", "<cmd>FzfLua autocmds<cr>", desc = "Auto Commands" },
{ "<leader>sb", "<cmd>FzfLua grep_curbuf<cr>", desc = "Buffer" },
{ "<leader>sc", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
{ "<leader>sC", "<cmd>FzfLua commands<cr>", desc = "Commands" },
{ "<leader>sd", "<cmd>FzfLua diagnostics_document<cr>", desc = "Document Diagnostics" },
{ "<leader>sD", "<cmd>FzfLua diagnostics_workspace<cr>", desc = "Workspace Diagnostics" },
{ "<leader>sg", "<cmd>FzfLua live_grep<cr>", desc = "Grep (Root Dir)" },
{ "<leader>sG", "<cmd>FzfLua live_grep root=false<cr>", desc = "Grep (cwd)" },
{ "<leader>sh", "<cmd>FzfLua help_tags<cr>", desc = "Help Pages" },
{ "<leader>sH", "<cmd>FzfLua highlights<cr>", desc = "Search Highlight Groups" },
{ "<leader>sj", "<cmd>FzfLua jumps<cr>", desc = "Jumplist" },
{ "<leader>sk", "<cmd>FzfLua keymaps<cr>", desc = "Key Maps" },
{ "<leader>sl", "<cmd>FzfLua loclist<cr>", desc = "Location List" },
{ "<leader>sM", "<cmd>FzfLua man_pages<cr>", desc = "Man Pages" },
{ "<leader>sm", "<cmd>FzfLua marks<cr>", desc = "Jump to Mark" },
{ "<leader>sR", "<cmd>FzfLua resume<cr>", desc = "Resume" },
{ "<leader>sq", "<cmd>FzfLua quickfix<cr>", desc = "Quickfix List" },
-- {
-- "<leader>ss",
-- function()
-- require("fzf-lua").lsp_document_symbols({
-- regex_filter = symbols_filter,
-- })
-- end,
-- desc = "Goto Symbol",
-- },
-- {
-- "<leader>sS",
-- function()
-- require("fzf-lua").lsp_live_workspace_symbols({
-- regex_filter = symbols_filter,
-- })
-- end,
-- desc = "Goto Symbol (Workspace)",
-- },
},
}

View file

@ -0,0 +1,22 @@
return {
"MagicDuck/grug-far.nvim",
opts = { headerMaxWidth = 80 },
cmd = "GrugFar",
keys = {
{
"<leader>sr",
function()
local grug = require("grug-far")
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
grug.open({
transient = true,
prefills = {
filesFilter = ext and ext ~= "" and "*." .. ext or nil,
},
})
end,
mode = { "n", "v" },
desc = "Search and Replace",
},
},
}

View file

@ -0,0 +1,70 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
{ "saghen/blink.cmp" },
{ "b0o/schemastore.nvim" },
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
},
opts = {
inlay_hints = { enabled = false },
servers = {
ansiblels = {},
dockerls = {},
lua_ls = {},
ruff = {},
jsonls = {
settings = {
json = {
validate = { enable = true },
},
},
},
yamlls = {
settings = {
yaml = {
schemaStore = {
enable = false,
url = "",
},
},
},
},
},
},
config = function(_, opts)
local lspconfig = require("lspconfig")
for server, config in pairs(opts.servers) do
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
if server == "yamlls" then
config.settings.yaml.schemas = require('schemastore').yaml.schemas()
end
if server == "jsonls" then
config.settings.json.schemas = require('schemastore').json.schemas()
end
lspconfig[server].setup(config)
end
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then return end
if client.supports_method('textDocument/formatting') then
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = args.buf,
callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = client.id })
end,
})
end
end,
})
end,
}

View file

@ -0,0 +1,44 @@
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
init = function()
vim.g.lualine_laststatus = vim.o.laststatus
if vim.fn.argc(-1) > 0 then
-- set an empty statusline till lualine loads
vim.o.statusline = " "
else
-- hide the statusline on the starter page
vim.o.laststatus = 0
end
end,
opts = function()
-- PERF: we don't need this lualine require madness 🤷
local lualine_require = require("lualine_require")
lualine_require.require = require
vim.o.laststatus = vim.g.lualine_laststatus
local opts = {
options = {
theme = "auto",
globalstatus = vim.o.laststatus == 3,
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter", "snacks_dashboard" } },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
},
lualine_y = {
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {
function()
return "" .. os.date("%R")
end,
},
}
end,
}

View file

@ -0,0 +1,35 @@
return {
"echasnovski/mini.ai",
event = "VeryLazy",
opts = function()
local ai = require("mini.ai")
return {
n_lines = 500,
custom_textobjects = {
o = ai.gen_spec.treesitter({ -- code block
a = { "@block.outer", "@conditional.outer", "@loop.outer" },
i = { "@block.inner", "@conditional.inner", "@loop.inner" },
}),
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
d = { "%f[%d]%d+" }, -- digits
e = { -- Word with case
{ "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
"^().*()$",
},
-- g = LazyVim.mini.ai_buffer, -- buffer
u = ai.gen_spec.function_call(), -- u for "Usage"
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
},
}
end,
-- config = function(_, opts)
-- require("mini.ai").setup(opts)
-- LazyVim.on_load("which-key.nvim", function()
-- vim.schedule(function()
-- LazyVim.mini.ai_whichkey(opts)
-- end)
-- end)
-- end,
}

View file

@ -0,0 +1,19 @@
return {
"echasnovski/mini.icons",
lazy = true,
opts = {
file = {
[".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" },
["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" },
},
filetype = {
dotenv = { glyph = "", hl = "MiniIconsYellow" },
},
},
init = function()
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
}

View file

@ -0,0 +1,52 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
bottom_search = false,
command_palette = true,
long_message_to_split = true,
},
},
-- stylua: ignore
keys = {
{ "<leader>sn", "", desc = "+noice"},
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
{ "<leader>snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" },
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} },
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}},
},
config = function(_, opts)
-- HACK: noice shows messages from before it was enabled,
-- but this is not ideal when Lazy is installing plugins,
-- so clear the messages in this case.
if vim.o.filetype == "lazy" then
vim.cmd([[messages clear]])
end
require("noice").setup(opts)
end,
}

View file

@ -1,6 +1,6 @@
return {
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
dependencies = { "echasnovski/mini.icons" },
config = function()
require("oil").setup({
columns = { "icon" },
@ -8,7 +8,6 @@ return {
show_hidden = true,
},
})
-- vim.keymap.set("n", "<leader>e", "<CMD>Oil<CR>", { desc = "Open parent directory" })
vim.keymap.set(
"n",
"<leader>e",

View file

@ -0,0 +1,5 @@
return {
'mrcjkb/rustaceanvim',
version = '^5',
lazy = false,
}

View file

@ -0,0 +1,54 @@
return {
"folke/snacks.nvim",
dependencies = { "echasnovski/mini.icons", "nvim-tree/nvim-web-devicons" },
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
indent = { enabled = true },
input = { enabled = true },
lazygit = { enabled = false },
notifier = { enabled = true },
scope = { enabled = true },
scroll = { enabled = true },
statuscolumn = { enabled = false },
words = { enabled = true },
dashboard = {
preset = {
header = [[
]],
-- stylua: ignore
keys = {
{ icon = "", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
{ icon = "", key = "n", desc = "New File", action = ":ene | startinsert" },
{ icon = "", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
{ icon = "", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
{ icon = "", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
{ icon = "", key = "s", desc = "Restore Session", section = "session" },
{ icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" },
{ icon = "", key = "q", desc = "Quit", action = ":qa" },
},
},
},
},
-- stylua: ignore
keys = {
{ "<leader>n", function() Snacks.notifier.show_history() end, desc = "Notification History" },
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
},
}

View file

@ -0,0 +1,24 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
keys = {
{ "<leader>tf", "<cmd>TodoTelescope<cr>", desc = "Find Todos" },
{ "<leader>tq", "<cmd>TodoQuickFix<cr>", desc = "Quickfix Todos" },
{ "<leader>tl", "<cmd>TodoLocList<cr>", desc = "Loclist Todos" },
{
"]t",
function()
require("todo-comments").jump_next()
end,
desc = "Next todo comment"
},
{
"[t",
function()
require("todo-comments").jump_prev()
end,
desc = "Prev todo comment"
},
}
}

View file

@ -0,0 +1,3 @@
return {
"nvim-treesitter/nvim-treesitter-context",
}

View file

@ -0,0 +1,4 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate"
}

View file

@ -0,0 +1,54 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts_extend = { "spec" },
opts = {
preset = "helix",
defaults = {},
spec = {
{
mode = { "n", "v" },
{ "<leader><tab>", group = "tabs" },
{ "<leader>c", group = "code" },
{ "<leader>d", group = "debug" },
{ "<leader>dp", group = "profiler" },
{ "<leader>f", group = "file/find" },
{ "<leader>g", group = "git" },
{ "<leader>gh", group = "hunks" },
{ "<leader>q", group = "quit/session" },
{ "<leader>s", group = "search" },
{ "<leader>u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } },
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } },
{ "[", group = "prev" },
{ "]", group = "next" },
{ "g", group = "goto" },
{ "gs", group = "surround" },
{ "z", group = "fold" },
{
"<leader>b",
group = "buffer",
expand = function()
return require("which-key.extras").expand.buf()
end,
},
{
"<leader>w",
group = "windows",
proxy = "<c-w>",
expand = function()
return require("which-key.extras").expand.win()
end,
},
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
-- better descriptions
{ "gx", desc = "Open with system app" },
},
},
},
}

View file

@ -1,4 +0,0 @@
return {
"grafana/vim-alloy",
ft = "alloy",
}

View file

@ -1,22 +0,0 @@
return {
{
"saghen/blink.cmp",
dependencies = "rafamadriz/friendly-snippets",
version = "v0.*",
opts = {
keymap = { preset = "default" },
appearance = {
-- Sets the fallback highlight groups to nvim-cmp's highlight groups
-- Useful for when your theme doesn't support blink.cmp
-- will be removed in a future release
use_nvim_cmp_as_default = true,
nerd_font_variant = "mono",
},
signature = { enabled = true },
},
},
}

View file

@ -1,4 +0,0 @@
return {
"isobit/vim-caddyfile",
ft = "caddyfile",
}

View file

@ -1,13 +0,0 @@
return {
--- Disable completely
{ "nvim-neo-tree/neo-tree.nvim", enabled = false, keys = false },
{ "echasnovski/mini.pairs", enabled = false, keys = false },
{ "kdheepak/lazygit.nvim", enabled = false, keys = false },
--- Disable Mason as it is a pain in the ass to configure as i want it
{ "williamboman/mason-lspconfig.nvim", enabled = false },
{ "williamboman/mason.nvim", enabled = false },
--- Disable keys only
{ "mfussenegger/nvim-ansible", keys = false },
}

View file

@ -1,4 +0,0 @@
return {
"gleam-lang/gleam.vim",
ft = "gleam",
}

View file

@ -1,4 +0,0 @@
return {
"HiPhish/jinja.vim",
ft = "jinja",
}

View file

@ -1,20 +0,0 @@
return {
"neovim/nvim-lspconfig",
dependencies = { "saghen/blink.cmp" },
opts = {
inlay_hints = { enabled = false },
servers = {
lua_ls = {},
pyright = {
autostart = false,
},
},
},
config = function(_, opts)
local lspconfig = require("lspconfig")
for server, config in pairs(opts.servers) do
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end
end,
}

View file

@ -1,9 +0,0 @@
return {
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"nvim-telescope/telescope.nvim",
},
config = true,
}

View file

@ -1,53 +0,0 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
-- changed from default
bottom_search = false,
command_palette = true,
long_message_to_split = false,
},
},
-- stylua: ignore
keys = {
{ "<leader>sn", "", desc = "+noice"},
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
{ "<leader>snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" },
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} },
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}},
},
config = function(_, opts)
-- HACK: noice shows messages from before it was enabled,
-- but this is not ideal when Lazy is installing plugins,
-- so clear the messages in this case.
if vim.o.filetype == "lazy" then
vim.cmd([[messages clear]])
end
require("noice").setup(opts)
end,
}

View file

@ -1,18 +0,0 @@
return {
"nvim-telescope/telescope.nvim",
keys = {
{ "<leader><leader>", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
-- add a keymap to browse plugin files
{
"<leader>fp",
function()
require("telescope.builtin").find_files({
cwd = require("lazy.core.config").options.root,
})
end,
desc = "Find Plugin File",
},
},
}

View file

@ -1,5 +0,0 @@
return {
"NoahTheDuke/vim-just",
name = "vim-just",
ft = "just",
}

View file

@ -1,3 +0,0 @@
indent_type = "Spaces"
indent_width = 4
column_width = 100

View file

@ -1,13 +0,0 @@
-- Link the 'hiswikiLink' highlight group to the existing 'Underlined' group.
vim.api.nvim_set_hl(0, "hiswikiLink", { link = "Underlined" })
-- Remove all existing hiswikiLink syntax matches.
vim.cmd("syntax clear hiswikiLink")
-- Find the directory of the current file.
local base_dir = vim.fn.expand("%:h")
-- Loop through all files in the directory, and add a syntax match for each one.
for _, file in ipairs(vim.fn.readdir(base_dir)) do
vim.cmd("syntax match hiswikiLink /\\c\\V\\<" .. vim.fn.escape(file, "/\\") .. "/")
end

View file

@ -6,7 +6,7 @@ icon-theme=breeze-dark
icons-enabled=no
fields=name,generic
# password-character=*
fuzzy=yes
match-mode=fzf
show-actions=no
terminal=foot -e
# launch-prefix=<not set>
@ -20,6 +20,7 @@ line-height=20
letter-spacing=0
layer=overlay
exit-on-keyboard-focus-loss=no
cache=/dev/null
[colors]
background=282a36fa