feat: replace nvim with nvf
This commit is contained in:
parent
7db16b1462
commit
9ed1af62e4
32 changed files with 978 additions and 1299 deletions
106
flake.lock
generated
106
flake.lock
generated
|
|
@ -396,6 +396,22 @@
|
|||
}
|
||||
},
|
||||
"flake-compat_8": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1751685974,
|
||||
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
|
||||
"revCount": 92,
|
||||
"type": "git",
|
||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||
}
|
||||
},
|
||||
"flake-compat_9": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
|
|
@ -475,6 +491,27 @@
|
|||
}
|
||||
},
|
||||
"flake-parts_4": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nvf",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756770412,
|
||||
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "4524271976b625a4a605beefd893f270620fd751",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_5": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"stylix",
|
||||
|
|
@ -601,7 +638,7 @@
|
|||
},
|
||||
"flake-utils_6": {
|
||||
"inputs": {
|
||||
"systems": "systems_11"
|
||||
"systems": "systems_12"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
|
|
@ -1390,6 +1427,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1756659871,
|
||||
"narHash": "sha256-v6Rh4aQ6RKjM2N02kK9Usn0Ix7+OY66vNpeklc1MnGE=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "ed6cc3e48557ba18266e598a5ebb6602499ada16",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"neovim-nightly-overlay": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_5",
|
||||
|
|
@ -1740,6 +1792,30 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvf": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_8",
|
||||
"flake-parts": "flake-parts_4",
|
||||
"mnw": "mnw",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems_10"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756870502,
|
||||
"narHash": "sha256-0diPvHFwQbKvKkz0bmEVEoFIzL4rdD80CaApHaj6hzs=",
|
||||
"owner": "NotAShelf",
|
||||
"repo": "nvf",
|
||||
"rev": "7b009c945d2f0213409aa0bae07c79d28b92d625",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NotAShelf",
|
||||
"repo": "nvf",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
|
|
@ -1833,6 +1909,7 @@
|
|||
"nix-minecraft": "nix-minecraft",
|
||||
"nix-tmodloader": "nix-tmodloader",
|
||||
"nixpkgs": "nixpkgs_7",
|
||||
"nvf": "nvf",
|
||||
"sops-nix": "sops-nix",
|
||||
"stylix": "stylix",
|
||||
"swww": "swww",
|
||||
|
|
@ -1965,13 +2042,13 @@
|
|||
"base16-helix": "base16-helix",
|
||||
"base16-vim": "base16-vim",
|
||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||
"flake-parts": "flake-parts_4",
|
||||
"flake-parts": "flake-parts_5",
|
||||
"gnome-shell": "gnome-shell",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nur": "nur",
|
||||
"systems": "systems_10",
|
||||
"systems": "systems_11",
|
||||
"tinted-foot": "tinted-foot",
|
||||
"tinted-kitty": "tinted-kitty",
|
||||
"tinted-schemes": "tinted-schemes",
|
||||
|
|
@ -1994,7 +2071,7 @@
|
|||
},
|
||||
"swww": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_8",
|
||||
"flake-compat": "flake-compat_9",
|
||||
"nixpkgs": "nixpkgs_9",
|
||||
"rust-overlay": "rust-overlay_3"
|
||||
},
|
||||
|
|
@ -2057,6 +2134,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_12": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
|
|
@ -2345,11 +2437,11 @@
|
|||
"nixpkgs": "nixpkgs_11"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755788000,
|
||||
"narHash": "sha256-wREYvAtnBT8OD6NI/TO1M6Nc9Q9uV23Sem5EjW/lFw0=",
|
||||
"lastModified": 1756537342,
|
||||
"narHash": "sha256-2WMNWyuGE6RCjHFg0KD4lQV9eRpJkgyQBuZR3Nih2rk=",
|
||||
"owner": "dachxy",
|
||||
"repo": "zen-browser-flake",
|
||||
"rev": "99cc11ef1338b4bbba84308cdd07b0fd9d2dbbc4",
|
||||
"rev": "7a385cf911db37e18b337d488bba7e10084cd8d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -112,6 +112,11 @@
|
|||
url = "github:nix-community/stylix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nvf = {
|
||||
url = "github:NotAShelf/nvf";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
@ -281,6 +286,7 @@
|
|||
inputs.hyprland.homeManagerModules.default
|
||||
inputs.caelestia-shell.homeManagerModules.default
|
||||
inputs.zen-browser.homeManagerModules.${system}.default
|
||||
inputs.nvf.homeManagerModules.default
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/${username}";
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
-- 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
|
||||
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
desc = "Auto select virtualenv Nvim open",
|
||||
pattern = "*.py",
|
||||
callback = function()
|
||||
local venv = vim.fn.findfile("pyproject.toml", vim.fn.getcwd() .. ";")
|
||||
if venv ~= "" then
|
||||
require("venv-selector").retrieve_from_cache()
|
||||
end
|
||||
end,
|
||||
once = true,
|
||||
})
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
-- 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
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
-- 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
|
||||
|
||||
function GetAvailableWindowsShell()
|
||||
local shellList = { "nu", "pwsh-preview", "pwsh", "powershell", "cmd" }
|
||||
local length = #shellList
|
||||
for i = 1, length do
|
||||
local commandToCheck = "where " .. shellList[i]
|
||||
local exitCode = os.execute(commandToCheck)
|
||||
if exitCode == 0 then
|
||||
return shellList[i]
|
||||
end
|
||||
end
|
||||
|
||||
return shellList[length - 1]
|
||||
end
|
||||
|
||||
if package.config:sub(1, 1) == "\\" then
|
||||
vim.o.shell = GetAvailableWindowsShell()
|
||||
end
|
||||
|
||||
vim.g.lazyvim_python_lsp = "pyright"
|
||||
vim.g.lazyvim_python_ruff = "ruff"
|
||||
vim.g.lazyvim_eslint_auto_format = true
|
||||
vim.o.background = "dark"
|
||||
|
||||
-- Tab settings
|
||||
vim.g.expandtab = true
|
||||
vim.g.softtabstop = 2
|
||||
vim.g.shiftwidth = 2
|
||||
|
||||
-- Markdown preview
|
||||
vim.g.mkdp_auto_close = 0
|
||||
vim.g.mkdp_combine_preview = 1
|
||||
vim.g.mkdp_echo_preview_url = 1
|
||||
vim.g.mkdp_open_to_the_world = 1
|
||||
vim.g.mkdp_port = "20088"
|
||||
|
||||
-- Use osc52 as clipboard provider
|
||||
local function paste()
|
||||
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
|
||||
end
|
||||
vim.g.clipboard = {
|
||||
name = "OSC 52",
|
||||
copy = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
},
|
||||
paste = {
|
||||
["+"] = paste,
|
||||
["*"] = paste,
|
||||
},
|
||||
}
|
||||
-- To ALWAYS use the clipboard for ALL operations
|
||||
-- (instead of interacting with the "+" and/or "*" registers explicitly):
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
vim.opt.spelllang = { "en", "cjk" }
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
---@module "blink.cmp"
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
snippets = {
|
||||
expand = function(snippet, _)
|
||||
return LazyVim.cmp.expand(snippet)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
border = "rounded",
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 200,
|
||||
window = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
opts = {
|
||||
flavour = "macchiato",
|
||||
background = {
|
||||
light = "latte",
|
||||
dark = "macchiato",
|
||||
},
|
||||
transparent_background = true,
|
||||
integrations = {
|
||||
aerial = true,
|
||||
alpha = true,
|
||||
cmp = true,
|
||||
dashboard = true,
|
||||
flash = true,
|
||||
gitsigns = true,
|
||||
headlines = true,
|
||||
illuminate = true,
|
||||
indent_blankline = { enabled = true },
|
||||
leap = true,
|
||||
lsp_trouble = true,
|
||||
mason = true,
|
||||
markdown = true,
|
||||
mini = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
underlines = {
|
||||
errors = { "undercurl" },
|
||||
hints = { "undercurl" },
|
||||
warnings = { "undercurl" },
|
||||
information = { "undercurl" },
|
||||
},
|
||||
},
|
||||
navic = { enabled = true, custom_bg = "lualine" },
|
||||
neotest = true,
|
||||
neotree = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
semantic_tokens = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
name = "tokyonight",
|
||||
},
|
||||
{
|
||||
"embark-theme/vim",
|
||||
name = "embark",
|
||||
opts = {
|
||||
transparent_background = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
name = "gruvbox",
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"luisiacc/gruvbox-baby",
|
||||
name = "gruvbox-baby",
|
||||
},
|
||||
{
|
||||
"sainnhe/gruvbox-material",
|
||||
name = "gruvbox-material",
|
||||
},
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
json = { "prettierd", "prettier", stop_after_first = true },
|
||||
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
||||
verilog = { "verible" },
|
||||
},
|
||||
formatters = {
|
||||
verible = {
|
||||
command = "verible-verilog-format",
|
||||
args = { "-" },
|
||||
range_args = function(self, ctx)
|
||||
return { "--lines", ctx.range.start[1] .. "-" .. ctx.range["end"][1] }
|
||||
end,
|
||||
stdin = true,
|
||||
cwd = require("conform.util").root_file({ ".git" }),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"3rd/image.nvim",
|
||||
opts = {
|
||||
backend = "kitty",
|
||||
processor = "magick_cli",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
floating_windows = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = false,
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"brianhuster/live-preview.nvim",
|
||||
dependencies = {
|
||||
-- You can choose one of the following pickers
|
||||
"ibhagwan/fzf-lua",
|
||||
},
|
||||
cmd = "LivePreview",
|
||||
keys = { { "<leader>cp", "<cmd>LivePreview close<cr><cmd>LivePreview start<cr>", desc = "Live Preview" } },
|
||||
opts = true,
|
||||
enabled = true,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
local util = require("lspconfig.util")
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
on_init = function(client)
|
||||
local path = client.workspace_folders[1].name
|
||||
if vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc") then
|
||||
return
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
"${3rd}/luv/library",
|
||||
-- "${3rd}/busted/library",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
ui = {
|
||||
windows = {
|
||||
default_options = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
},
|
||||
servers = {
|
||||
-- biome = {
|
||||
-- root_dir = function(fname)
|
||||
-- return util.root_pattern("biome.json", "biome.jsonc")(fname)
|
||||
-- or util.find_package_json_ancestor(fname)
|
||||
-- or vim.fs.find("node_modules", { path = fname, upward = true })[1]
|
||||
-- or util.find_node_modules_ancestor(fname)
|
||||
-- or util.find_git_ancestor(fname)
|
||||
-- end,
|
||||
-- },
|
||||
nil_ls = false,
|
||||
nginx_language_server = {
|
||||
cmd = { "nginx-language-server" },
|
||||
filetypes = { "nginx" },
|
||||
rootPatterns = { "biome.json", "biome.jsonc" },
|
||||
},
|
||||
volar = {
|
||||
init_options = {
|
||||
vue = {
|
||||
hybridMode = true,
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
enumMemberValues = {
|
||||
enabled = true,
|
||||
},
|
||||
functionLikeReturnTypes = {
|
||||
enabled = true,
|
||||
},
|
||||
propertyDeclarationTypes = {
|
||||
enabled = true,
|
||||
},
|
||||
parameterTypes = {
|
||||
enabled = true,
|
||||
suppressWhenArgumentMatchesName = true,
|
||||
},
|
||||
variableTypes = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
vtsls = {},
|
||||
stylelint_lsp = {
|
||||
filetypes = { "css", "scss", "vue" },
|
||||
root_dir = util.root_pattern("packages.json", ".git"),
|
||||
debounce = 100,
|
||||
settings = {
|
||||
stylelintplus = {
|
||||
autoFixOnFormat = true,
|
||||
autoFixOnSave = true,
|
||||
},
|
||||
},
|
||||
on_attach = function(client)
|
||||
client.server_capabilities.document_formatting = false
|
||||
end,
|
||||
},
|
||||
svls = {
|
||||
root_dir = function(fname)
|
||||
return vim.fs.dirname(vim.fs.find(".git", { path = fname, upward = true })[1])
|
||||
end,
|
||||
cmd = { "verible-verilog-ls", "--rules_config_search" },
|
||||
filetypes = { "verilog", "systemverilog" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
opts = {
|
||||
presets = {
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
lsp = {
|
||||
override = {
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
views = {
|
||||
hover = {
|
||||
border = {
|
||||
style = "rounded",
|
||||
},
|
||||
},
|
||||
confirm = {
|
||||
border = {
|
||||
style = "rounded",
|
||||
},
|
||||
},
|
||||
popup = {
|
||||
border = {
|
||||
style = "rounded",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
opts = {
|
||||
stages = "slide",
|
||||
render = "wrapped-compact",
|
||||
timeout = 2000,
|
||||
top_down = false,
|
||||
fps = 40,
|
||||
background_colour = "#000000",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
local pattern = "[^:]+:(%d+):(%d+):(%w+):(.+)"
|
||||
local groups = { "lnum", "col", "code", "message" }
|
||||
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
-- verilog = { "verible" },
|
||||
},
|
||||
linters = {
|
||||
verible = {
|
||||
cmd = "verible-verilog-lint",
|
||||
stdin = false,
|
||||
args = { "--rules_config_search" },
|
||||
stream = nil,
|
||||
ignore_exitcode = false,
|
||||
env = nil,
|
||||
parser = require("lint.parser").from_pattern(pattern, groups),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
local handler = function(virtText, lnum, endLnum, width, truncate)
|
||||
local newVirtText = {}
|
||||
local suffix = (" %d "):format(endLnum - lnum)
|
||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||
local targetWidth = width - sufWidth
|
||||
local curWidth = 0
|
||||
for _, chunk in ipairs(virtText) do
|
||||
local chunkText = chunk[1]
|
||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if targetWidth > curWidth + chunkWidth then
|
||||
table.insert(newVirtText, chunk)
|
||||
else
|
||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, { chunkText, hlGroup })
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
break
|
||||
end
|
||||
curWidth = curWidth + chunkWidth
|
||||
end
|
||||
table.insert(newVirtText, { suffix, "MoreMsg" })
|
||||
return newVirtText
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
opts = {
|
||||
provider_selector = function()
|
||||
return { "lsp", "indent" }
|
||||
end,
|
||||
fold_virt_text_handler = handler,
|
||||
filetype_exclude = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("local_detach_ufo", { clear = true }),
|
||||
pattern = opts.filetype_exclude,
|
||||
callback = function()
|
||||
require("ufo").detach()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.o.foldcolumn = "1"
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
require("ufo").setup(opts)
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"zR",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("ufo").openAllFolds()
|
||||
end,
|
||||
{ desc = "Open all folds" },
|
||||
},
|
||||
{
|
||||
"zM",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("ufo").closeAllFolds()
|
||||
end,
|
||||
{ desc = "Close all folds" },
|
||||
},
|
||||
{
|
||||
"zK",
|
||||
function()
|
||||
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
||||
if not winid then
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end,
|
||||
{ desc = "Peek Fold" },
|
||||
},
|
||||
{
|
||||
"zr",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("ufo").openFoldsExceptKinds()
|
||||
end,
|
||||
{ desc = "Open fold" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
explorer = {
|
||||
enabled = true,
|
||||
},
|
||||
image = {
|
||||
enabled = true,
|
||||
math = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
picker = {
|
||||
enabled = true,
|
||||
sources = {
|
||||
explorer = {
|
||||
layout = { layout = { position = "right" } },
|
||||
},
|
||||
files = {
|
||||
ignored = true,
|
||||
},
|
||||
git_files = {
|
||||
untracked = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
notifier = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
width = 60,
|
||||
row = nil,
|
||||
col = nil,
|
||||
preset = {
|
||||
header = [[
|
||||
██████████ █████████ █████████ █████ █████ █████ █████ █████ █████
|
||||
░░███░░░░███ ███░░░░░███ ███░░░░░███░░███ ░░███ ░░███ ░░███ ░░███ ░░███
|
||||
░███ ░░███ ░███ ░███ ███ ░░░ ░███ ░███ ░░███ ███ ░░███ ███
|
||||
░███ ░███ ░███████████ ░███ ░███████████ ░░█████ ░░█████
|
||||
░███ ░███ ░███░░░░░███ ░███ ░███░░░░░███ ███░███ ░░███
|
||||
░███ ███ ░███ ░███ ░░███ ███ ░███ ░███ ███ ░░███ ░███
|
||||
██████████ █████ █████ ░░█████████ █████ █████ █████ █████ █████
|
||||
░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░]],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"lambdalisue/vim-suda",
|
||||
cmd = { "SudaWrite", "SudaRead" },
|
||||
keys = { { "<leader>bs", "<cmd>SudaWrite<cr>", desc = "Save Buffer as Root" } },
|
||||
},
|
||||
}
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
},
|
||||
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- correctly setup lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
-- make sure mason installs the server
|
||||
servers = {
|
||||
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
||||
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
||||
tsserver = {
|
||||
enabled = false,
|
||||
},
|
||||
ts_ls = {
|
||||
enabled = false,
|
||||
},
|
||||
vtsls = {
|
||||
-- explicitly add default filetypes, so that we can extend
|
||||
-- them in related extras
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
},
|
||||
settings = {
|
||||
complete_function_calls = true,
|
||||
vtsls = {
|
||||
enableMoveToFileCodeAction = true,
|
||||
autoUseWorkspaceTsdk = true,
|
||||
experimental = {
|
||||
maxInlayHintLength = 30,
|
||||
completion = {
|
||||
enableServerSideFuzzyMatch = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
suggest = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
inlayHints = {
|
||||
enumMemberValues = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
parameterNames = { enabled = "literals" },
|
||||
parameterTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
variableTypes = { enabled = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"gD",
|
||||
function()
|
||||
local params = vim.lsp.util.make_position_params()
|
||||
LazyVim.lsp.execute({
|
||||
command = "typescript.goToSourceDefinition",
|
||||
arguments = { params.textDocument.uri, params.position },
|
||||
open = true,
|
||||
})
|
||||
end,
|
||||
desc = "Goto Source Definition",
|
||||
},
|
||||
{
|
||||
"gR",
|
||||
function()
|
||||
LazyVim.lsp.execute({
|
||||
command = "typescript.findAllFileReferences",
|
||||
arguments = { vim.uri_from_bufnr(0) },
|
||||
open = true,
|
||||
})
|
||||
end,
|
||||
desc = "File References",
|
||||
},
|
||||
{
|
||||
"<leader>co",
|
||||
LazyVim.lsp.action["source.organizeImports"],
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
{
|
||||
"<leader>cM",
|
||||
LazyVim.lsp.action["source.addMissingImports.ts"],
|
||||
desc = "Add missing imports",
|
||||
},
|
||||
{
|
||||
"<leader>cu",
|
||||
LazyVim.lsp.action["source.removeUnused.ts"],
|
||||
desc = "Remove unused imports",
|
||||
},
|
||||
{
|
||||
"<leader>cD",
|
||||
LazyVim.lsp.action["source.fixAll.ts"],
|
||||
desc = "Fix all diagnostics",
|
||||
},
|
||||
{
|
||||
"<leader>cV",
|
||||
function()
|
||||
LazyVim.lsp.execute({ command = "typescript.selectTypeScriptVersion" })
|
||||
end,
|
||||
desc = "Select TS workspace version",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
||||
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
||||
tsserver = function()
|
||||
-- disable tsserver
|
||||
return true
|
||||
end,
|
||||
ts_ls = function()
|
||||
-- disable tsserver
|
||||
return true
|
||||
end,
|
||||
vtsls = function(_, opts)
|
||||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
||||
---@type string, string, lsp.Range
|
||||
local action, uri, range = unpack(command.arguments)
|
||||
|
||||
local function move(newf)
|
||||
client.request("workspace/executeCommand", {
|
||||
command = command.command,
|
||||
arguments = { action, uri, range, newf },
|
||||
})
|
||||
end
|
||||
|
||||
local fname = vim.uri_to_fname(uri)
|
||||
client.request("workspace/executeCommand", {
|
||||
command = "typescript.tsserverRequest",
|
||||
arguments = {
|
||||
"getMoveToRefactoringFileSuggestions",
|
||||
{
|
||||
file = fname,
|
||||
startLine = range.start.line + 1,
|
||||
startOffset = range.start.character + 1,
|
||||
endLine = range["end"].line + 1,
|
||||
endOffset = range["end"].character + 1,
|
||||
},
|
||||
},
|
||||
}, function(_, result)
|
||||
---@type string[]
|
||||
local files = result.body.files
|
||||
table.insert(files, 1, "Enter new path...")
|
||||
vim.ui.select(files, {
|
||||
prompt = "Select move destination:",
|
||||
format_item = function(f)
|
||||
return vim.fn.fnamemodify(f, ":~:.")
|
||||
end,
|
||||
}, function(f)
|
||||
if f and f:find("^Enter new path") then
|
||||
vim.ui.input({
|
||||
prompt = "Enter move destination:",
|
||||
default = vim.fn.fnamemodify(fname, ":h") .. "/",
|
||||
completion = "file",
|
||||
}, function(newf)
|
||||
return newf and move(newf)
|
||||
end)
|
||||
elseif f then
|
||||
move(f)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end, "vtsls")
|
||||
-- copy typescript settings to javascript
|
||||
opts.settings.javascript =
|
||||
vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {})
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
if not dap.adapters["pwa-node"] then
|
||||
require("dap").adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "js-debug",
|
||||
args = {
|
||||
"${port}",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
if not dap.adapters["node"] then
|
||||
dap.adapters["node"] = function(cb, config)
|
||||
if config.type == "node" then
|
||||
config.type = "pwa-node"
|
||||
end
|
||||
local nativeAdapter = dap.adapters["pwa-node"]
|
||||
if type(nativeAdapter) == "function" then
|
||||
nativeAdapter(cb, config)
|
||||
else
|
||||
cb(nativeAdapter)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" }
|
||||
|
||||
local vscode = require("dap.ext.vscode")
|
||||
vscode.type_to_filetypes["node"] = js_filetypes
|
||||
vscode.type_to_filetypes["pwa-node"] = js_filetypes
|
||||
|
||||
for _, language in ipairs(js_filetypes) do
|
||||
if not dap.configurations[language] then
|
||||
dap.configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Filetype icons
|
||||
{
|
||||
"echasnovski/mini.icons",
|
||||
opts = {
|
||||
file = {
|
||||
[".eslintrc.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
||||
[".node-version"] = { glyph = "", hl = "MiniIconsGreen" },
|
||||
[".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" },
|
||||
[".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||
["eslint.config.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
||||
["package.json"] = { glyph = "", hl = "MiniIconsGreen" },
|
||||
["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
||||
["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
||||
["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function() end,
|
||||
},
|
||||
{
|
||||
"linux-cultist/venv-selector.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"mfussenegger/nvim-dap",
|
||||
"mfussenegger/nvim-dap-python", --optional
|
||||
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
|
||||
},
|
||||
lazy = false,
|
||||
branch = "regexp", -- This is the regexp branch, use this for the new version
|
||||
config = function()
|
||||
require("venv-selector").setup()
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>cv", "<cmd>VenvSelect<cr>" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"elkowar/yuck.vim",
|
||||
},
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
||||
|
|
@ -8,7 +8,6 @@
|
|||
../user/environment.nix
|
||||
../user/gtk.nix
|
||||
../user/wlogout.nix
|
||||
../user/nvim.nix
|
||||
../user/packages.nix
|
||||
../user/zen-browser.nix
|
||||
../user/shell.nix
|
||||
|
|
@ -17,5 +16,6 @@
|
|||
../user/vscode.nix
|
||||
../user/yazi.nix
|
||||
../user/zellij.nix
|
||||
../user/nvf.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
66
home/scripts/memeSelector.nix
Normal file
66
home/scripts/memeSelector.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ pkgs, ... }:
|
||||
pkgs.writers.writePython3Bin "memeSelector" { libraries = with pkgs.python3Packages; [ requests ]; }
|
||||
''
|
||||
import requests
|
||||
import xml.etree.ElementTree as ET
|
||||
import urllib.parse
|
||||
import sys
|
||||
import os
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
BASE_URL = "https://nextcloud.net.dn/public.php/dav/files/pygHoPB5LxDZbeY/"
|
||||
headers = {"Depth": "1"}
|
||||
resp = requests.request(
|
||||
"PROPFIND",
|
||||
BASE_URL,
|
||||
headers=headers,
|
||||
verify="${"" + ../../system/extra/ca.crt}"
|
||||
)
|
||||
|
||||
if resp.status_code not in (200, 207):
|
||||
print(f"Error: Http {resp.status_code}")
|
||||
sys.exit(1)
|
||||
|
||||
root = ET.fromstring(resp.text)
|
||||
ns = {"d": "DAV:"}
|
||||
|
||||
files = []
|
||||
for href in root.findall(".//d:href", ns):
|
||||
path = href.text
|
||||
if not path:
|
||||
continue
|
||||
filename = urllib.parse.unquote(path.split("/")[-1])
|
||||
|
||||
if filename and not filename.endswith("/"):
|
||||
files.append(filename)
|
||||
|
||||
if not files:
|
||||
print("No files found")
|
||||
sys.exit(0)
|
||||
|
||||
rofi = subprocess.run(
|
||||
["rofi", "-dmenu", "-p", "Meme"],
|
||||
input="\n".join(files).encode(),
|
||||
stdout=subprocess.PIPE
|
||||
)
|
||||
|
||||
selected = rofi.stdout.decode().strip()
|
||||
if not selected:
|
||||
sys.exit(0)
|
||||
|
||||
url = BASE_URL + urllib.parse.quote(selected)
|
||||
tmpfile = os.path.join(tempfile.gettempdir(), selected)
|
||||
|
||||
subprocess.run(["wget", "-q", "-O", tmpfile, url], check=True)
|
||||
|
||||
with open(tmpfile, "rb") as f:
|
||||
subprocess.run("wl-copy", stdin=f)
|
||||
|
||||
subprocess.run([
|
||||
"notify-send",
|
||||
"-i", tmpfile,
|
||||
"Meme Copied: ",
|
||||
f"{selected}"
|
||||
])
|
||||
''
|
||||
|
|
@ -59,6 +59,7 @@ in
|
|||
);
|
||||
|
||||
settings = {
|
||||
"$mainMod" = mainMod;
|
||||
debug = {
|
||||
disable_logs = true;
|
||||
};
|
||||
|
|
|
|||
763
home/user/nvf.nix
Normal file
763
home/user/nvf.nix
Normal file
|
|
@ -0,0 +1,763 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
suda-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "vim-suda";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lambdalisue";
|
||||
repo = "vim-suda";
|
||||
rev = "9adda7d195222d4e2854efb2a88005a120296c47";
|
||||
hash = "sha256-46sy3rAdOCULVt1RkIoGdweoV3MqQaB33Et9MrxI6Lk=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
vim = {
|
||||
enableLuaLoader = true;
|
||||
clipboard = {
|
||||
enable = true;
|
||||
providers = {
|
||||
wl-copy.enable = true;
|
||||
};
|
||||
registers = "unnamedplus";
|
||||
};
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; {
|
||||
transparent = {
|
||||
package = transparent-nvim;
|
||||
setup =
|
||||
# lua
|
||||
''
|
||||
require("transparent").setup({
|
||||
extra_groups = {
|
||||
"NormalFloat",
|
||||
"NvimTreeNormal",
|
||||
"TreesitterContext",
|
||||
"FloatBorder",
|
||||
"FoldColumn",
|
||||
"Folded",
|
||||
"BlinkCmpMenu",
|
||||
"BlinkCmpBorder",
|
||||
"BlinkCmpKind",
|
||||
"WarningMsg",
|
||||
"ErrorMsg",
|
||||
"BlinkCmpMenuBorder",
|
||||
"FzfLuaBackdrop",
|
||||
"VertSplit",
|
||||
"Pmenu",
|
||||
"PmenuSbar",
|
||||
"DiffText",
|
||||
"DiffViewNormal",
|
||||
"CursorColumn",
|
||||
"ColorColumn",
|
||||
"QuickFixLine",
|
||||
"Error",
|
||||
"NoiceScrollbar"
|
||||
},
|
||||
})
|
||||
require("transparent").clear_prefix("NeoTree")
|
||||
require("transparent").clear_prefix("GitGutter")
|
||||
'';
|
||||
};
|
||||
suda = {
|
||||
package = suda-nvim;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
# === Files === #
|
||||
# Explorer
|
||||
{
|
||||
key = "<leader>e";
|
||||
mode = ["n"];
|
||||
action = ":Neotree toggle<CR>";
|
||||
silent = true;
|
||||
desc = "Toggle file explorer";
|
||||
}
|
||||
# Fzf lua
|
||||
{
|
||||
key = "<Leader><Space>";
|
||||
silent = true;
|
||||
mode = ["n"];
|
||||
action = ":FzfLua files<CR>";
|
||||
nowait = true;
|
||||
unique = true;
|
||||
desc = "Find file";
|
||||
}
|
||||
{
|
||||
key = "<Leader>/";
|
||||
mode = ["n"];
|
||||
action = ":FzfLua live_grep<CR>";
|
||||
nowait = true;
|
||||
unique = true;
|
||||
desc = "Live grep";
|
||||
}
|
||||
# Lsp symbol document
|
||||
{
|
||||
key = "<Leader>ss";
|
||||
silent = true;
|
||||
mode = ["n"];
|
||||
action = ":FzfLua lsp_document_symbols<CR>";
|
||||
nowait = true;
|
||||
unique = true;
|
||||
desc = "Find symbols (document)";
|
||||
}
|
||||
# Lsp symbol workspace
|
||||
{
|
||||
key = "<Leader>sS";
|
||||
silent = true;
|
||||
mode = ["n"];
|
||||
action = ":FzfLua lsp_workspace_symbols<CR>";
|
||||
unique = true;
|
||||
nowait = true;
|
||||
desc = "Find symbols (workspace)";
|
||||
}
|
||||
|
||||
# === Buffer === #
|
||||
{
|
||||
key = "<Leader>bo";
|
||||
mode = ["n"];
|
||||
action = ":BufferLineCloseOther<CR>";
|
||||
desc = "Close other buffer";
|
||||
}
|
||||
{
|
||||
key = "<Leader>bS";
|
||||
mode = ["n"];
|
||||
action = ":SudaWrite<CR>";
|
||||
desc = "Save file as root";
|
||||
}
|
||||
|
||||
# === General Control === #
|
||||
# Save file
|
||||
{
|
||||
key = "<C-s>";
|
||||
mode = [
|
||||
"n"
|
||||
"i"
|
||||
"v"
|
||||
];
|
||||
action = "<C-\\><C-n>:w<CR>";
|
||||
desc = "Save file";
|
||||
}
|
||||
{
|
||||
key = "<S-Tab>";
|
||||
mode = ["i"];
|
||||
action = "<C-d>";
|
||||
desc = "Shift left";
|
||||
}
|
||||
{
|
||||
key = "gd";
|
||||
mode = ["n"];
|
||||
action = ":FzfLua lsp_definitions<CR>";
|
||||
nowait = true;
|
||||
desc = "Go to definition";
|
||||
}
|
||||
{
|
||||
key = "gD";
|
||||
mode = ["n"];
|
||||
action = ":FzfLua lsp_declarations<CR>";
|
||||
nowait = true;
|
||||
desc = "Go to declaration";
|
||||
}
|
||||
{
|
||||
key = "gi";
|
||||
mode = ["n"];
|
||||
action = ":FzfLua lsp_implementations<CR>";
|
||||
nowait = true;
|
||||
desc = "Go to implementation";
|
||||
}
|
||||
{
|
||||
key = "gr";
|
||||
mode = ["n"];
|
||||
action = ":FzfLua lsp_references<CR>";
|
||||
nowait = true;
|
||||
desc = "List references";
|
||||
}
|
||||
{
|
||||
key = "<Leader>n";
|
||||
mode = ["n"];
|
||||
action = ":NoiceAll<CR>";
|
||||
nowait = true;
|
||||
desc = "Notifications";
|
||||
}
|
||||
|
||||
# === Tab === #
|
||||
{
|
||||
key = ">";
|
||||
mode = ["v"];
|
||||
action = ">gv";
|
||||
silent = true;
|
||||
desc = "Shift right";
|
||||
}
|
||||
{
|
||||
key = "<";
|
||||
mode = ["v"];
|
||||
action = "<gv";
|
||||
silent = true;
|
||||
desc = "Shift left";
|
||||
}
|
||||
|
||||
# === Terminal === #
|
||||
{
|
||||
key = "<C-/>";
|
||||
mode = ["t"];
|
||||
action = "<C-\\><C-n>:ToggleTerm<CR>";
|
||||
}
|
||||
{
|
||||
key = "<ESC><ESC>";
|
||||
mode = ["t"];
|
||||
action = "<C-\\><C-n>";
|
||||
}
|
||||
{
|
||||
key = "<C-j>";
|
||||
mode = ["n" "t"];
|
||||
action = "<C-\\><C-n><C-w>j";
|
||||
nowait = true;
|
||||
}
|
||||
{
|
||||
key = "<C-k>";
|
||||
mode = ["n" "t"];
|
||||
action = "<C-\\><C-n><C-w>k";
|
||||
nowait = true;
|
||||
}
|
||||
{
|
||||
key = "<C-l>";
|
||||
mode = ["n" "t"];
|
||||
action = "<C-\\><C-n><C-w>l";
|
||||
nowait = true;
|
||||
}
|
||||
{
|
||||
key = "<C-h>";
|
||||
mode = ["n" "t"];
|
||||
action = "<C-\\><C-n><C-w>h";
|
||||
nowait = true;
|
||||
}
|
||||
# New Term
|
||||
{
|
||||
key = "<Leader>tn";
|
||||
mode = ["n"];
|
||||
action = ":TermNew<CR>";
|
||||
nowait = true;
|
||||
desc = "Spawn new terminal";
|
||||
}
|
||||
# Select Term
|
||||
{
|
||||
key = "<Leader>tt";
|
||||
mode = ["n"];
|
||||
action = ":TermSelect<CR>";
|
||||
nowait = true;
|
||||
desc = "Select terminal";
|
||||
}
|
||||
# Send current selection to Term
|
||||
{
|
||||
key = "<Leader>ts";
|
||||
mode = ["v"];
|
||||
action = ":ToggleTermSendVisualSelection<CR>";
|
||||
nowait = true;
|
||||
desc = "Send current selection to terminal";
|
||||
}
|
||||
|
||||
# === Fold (nvim-ufo) === #
|
||||
{
|
||||
key = "zR";
|
||||
mode = ["n"];
|
||||
action = ''
|
||||
require("ufo").openAllFolds
|
||||
'';
|
||||
lua = true;
|
||||
}
|
||||
{
|
||||
key = "zM";
|
||||
mode = ["n"];
|
||||
action = ''
|
||||
require("ufo").closeAllFolds
|
||||
'';
|
||||
lua = true;
|
||||
}
|
||||
];
|
||||
|
||||
autocmds = [
|
||||
{
|
||||
event = ["TextYankPost"];
|
||||
callback =
|
||||
mkLuaInline
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 150 })
|
||||
end
|
||||
'';
|
||||
desc = "Highlight yanked";
|
||||
}
|
||||
];
|
||||
|
||||
globals = {
|
||||
transparent_enabled = true;
|
||||
};
|
||||
|
||||
vimAlias = true;
|
||||
|
||||
options = {
|
||||
foldcolumn = "0";
|
||||
foldlevel = 99;
|
||||
foldlevelstart = 99;
|
||||
foldenable = true;
|
||||
spelllang = "en,cjk";
|
||||
expandtab = true;
|
||||
tabstop = 2;
|
||||
softtabstop = 2;
|
||||
shiftwidth = 2;
|
||||
autoindent = true;
|
||||
smartindent = true;
|
||||
fillchars = "eob: ";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
formatOnSave = true;
|
||||
otter-nvim.enable = true;
|
||||
nvim-docs-view.enable = true;
|
||||
lspkind.enable = true;
|
||||
trouble = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
documentDiagnostics = "<Leader>xx";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
debugger = {
|
||||
nvim-dap = {
|
||||
enable = true;
|
||||
ui.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
diagnostics = {
|
||||
enable = true;
|
||||
config = {
|
||||
float = {
|
||||
border = "rounded";
|
||||
};
|
||||
virtual_text.format =
|
||||
mkLuaInline
|
||||
# lua
|
||||
''
|
||||
function(diagnostic)
|
||||
return string.format("%s (%s)", diagnostic.message, diagnostic.source)
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
enableFormat = true;
|
||||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
bash.enable = true;
|
||||
css.enable = true;
|
||||
rust.enable = true;
|
||||
nix = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
sql.enable = true;
|
||||
clang.enable = true;
|
||||
ts.enable = true;
|
||||
python.enable = true;
|
||||
markdown.enable = true;
|
||||
html.enable = true;
|
||||
lua.enable = true;
|
||||
};
|
||||
|
||||
visuals = {
|
||||
nvim-web-devicons.enable = true;
|
||||
nvim-cursorline.enable = true;
|
||||
cinnamon-nvim = {
|
||||
enable = true;
|
||||
setupOpts.keymaps = {
|
||||
basic = true;
|
||||
};
|
||||
};
|
||||
fidget-nvim = {
|
||||
enable = true;
|
||||
setupOpts.notification = {
|
||||
window = {
|
||||
border = "none";
|
||||
winblend = 100;
|
||||
};
|
||||
};
|
||||
};
|
||||
highlight-undo.enable = true;
|
||||
indent-blankline.enable = true;
|
||||
};
|
||||
|
||||
statusline = {
|
||||
lualine = {
|
||||
enable = true;
|
||||
activeSection = {
|
||||
a = lib.mkForce [
|
||||
''
|
||||
{
|
||||
"mode",
|
||||
icons_enabled = true,
|
||||
separator = {
|
||||
left = "",
|
||||
right = ""
|
||||
},
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
];
|
||||
b = lib.mkForce [
|
||||
''
|
||||
{
|
||||
"filetype",
|
||||
colored = true,
|
||||
icon_only = true,
|
||||
icon = { align = 'left' }
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"filename",
|
||||
symbols = {modified = ' ', readonly = ' '},
|
||||
separator = { left = '', right = ''}
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
];
|
||||
c = lib.mkForce [
|
||||
''
|
||||
{
|
||||
"diff",
|
||||
colored = false,
|
||||
diff_color = {
|
||||
-- Same color values as the general color option can be used here.
|
||||
added = 'DiffAdd', -- Changes the diff's added color
|
||||
modified = 'DiffChange', -- Changes the diff's modified color
|
||||
removed = 'DiffDelete', -- Changes the diff's removed color you
|
||||
},
|
||||
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols
|
||||
separator = {right = ''}
|
||||
}
|
||||
''
|
||||
];
|
||||
x = lib.mkForce [
|
||||
''
|
||||
{
|
||||
-- Lsp server name
|
||||
function()
|
||||
local buf_ft = vim.bo.filetype
|
||||
local excluded_buf_ft = { toggleterm = true, NvimTree = true, ["neo-tree"] = true, TelescopePrompt = true }
|
||||
|
||||
if excluded_buf_ft[buf_ft] then
|
||||
return ""
|
||||
end
|
||||
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||
|
||||
if vim.tbl_isempty(clients) then
|
||||
return "No Active LSP"
|
||||
end
|
||||
|
||||
local active_clients = {}
|
||||
for _, client in ipairs(clients) do
|
||||
table.insert(active_clients, client.name)
|
||||
end
|
||||
|
||||
return table.concat(active_clients, ", ")
|
||||
end,
|
||||
icon = ' ',
|
||||
separator = {left = ''},
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"diagnostics",
|
||||
sources = {'nvim_lsp', 'nvim_diagnostic', 'nvim_diagnostic', 'vim_lsp', 'coc'},
|
||||
symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
diagnostics_color = {
|
||||
color_error = { fg = 'red' },
|
||||
color_warn = { fg = 'yellow' },
|
||||
color_info = { fg = 'cyan' },
|
||||
},
|
||||
}
|
||||
''
|
||||
];
|
||||
y = lib.mkForce [
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
'searchcount',
|
||||
maxcount = 999,
|
||||
timeout = 120,
|
||||
separator = {left = ''}
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"branch",
|
||||
icon = ' •',
|
||||
separator = {left = ''}
|
||||
}
|
||||
''
|
||||
];
|
||||
z = lib.mkForce [
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"progress",
|
||||
separator = {left = ''}
|
||||
}
|
||||
''
|
||||
''
|
||||
{"location"}
|
||||
''
|
||||
''
|
||||
{
|
||||
"fileformat",
|
||||
color = {fg='black'},
|
||||
symbols = {
|
||||
unix = '', -- e843
|
||||
dos = '', -- e70f
|
||||
mac = '', -- e711
|
||||
}
|
||||
}
|
||||
''
|
||||
];
|
||||
};
|
||||
componentSeparator = {
|
||||
left = "";
|
||||
right = "";
|
||||
};
|
||||
sectionSeparator = {
|
||||
left = "";
|
||||
right = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
autopairs.nvim-autopairs.enable = true;
|
||||
|
||||
autocomplete = {
|
||||
blink-cmp.enable = true;
|
||||
};
|
||||
|
||||
snippets.luasnip = {
|
||||
enable = true;
|
||||
providers = ["blink-cmp"];
|
||||
setupOpts.enable_autosnippets = true;
|
||||
};
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
filetree = {
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
window = {
|
||||
position = "right";
|
||||
mappings = {
|
||||
"l" = "open";
|
||||
"h" = "close_node";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
tabline = {
|
||||
nvimBufferline = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
options = {
|
||||
show_close_icon = false;
|
||||
separator_style = "slope";
|
||||
numbers = "none";
|
||||
indicator = {
|
||||
style = "none";
|
||||
};
|
||||
diagnostic = "nvim_lsp";
|
||||
};
|
||||
};
|
||||
mappings = {
|
||||
closeCurrent = "<Leader>bd";
|
||||
cycleNext = "L";
|
||||
cyclePrevious = "H";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
binds = {
|
||||
whichKey.enable = true;
|
||||
};
|
||||
|
||||
fzf-lua.enable = true;
|
||||
|
||||
dashboard = {
|
||||
alpha.enable = true;
|
||||
};
|
||||
|
||||
notify = {
|
||||
nvim-notify = {
|
||||
enable = true;
|
||||
setupOpts.background_colour = "#020202";
|
||||
};
|
||||
};
|
||||
|
||||
projects = {
|
||||
project-nvim.enable = true;
|
||||
};
|
||||
|
||||
utility = {
|
||||
diffview-nvim.enable = true;
|
||||
icon-picker.enable = true;
|
||||
surround.enable = true;
|
||||
multicursors.enable = true;
|
||||
undotree.enable = true;
|
||||
|
||||
images = {
|
||||
img-clip.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
notes = {
|
||||
todo-comments.enable = true;
|
||||
};
|
||||
|
||||
terminal = {
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
lazygit.enable = true;
|
||||
mappings = {
|
||||
open = "<C-/>";
|
||||
};
|
||||
setupOpts.winbar.name_formatter =
|
||||
mkLuaInline
|
||||
# lua
|
||||
''
|
||||
function(term)
|
||||
return " " .. term.id
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
ui = {
|
||||
noice = {
|
||||
enable = true;
|
||||
setupOpts.routes = [
|
||||
# Hide neo-tree notification
|
||||
{
|
||||
filter = {
|
||||
event = "notify";
|
||||
kind = "info";
|
||||
any = [
|
||||
{find = "hidden";}
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
colorizer.enable = true;
|
||||
fastaction.enable = true;
|
||||
nvim-ufo = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
fold_virt_text_handler =
|
||||
mkLuaInline
|
||||
# lua
|
||||
''
|
||||
function(virtText, lnum, endLnum, width, truncate)
|
||||
local newVirtText = {}
|
||||
local suffix = (' %d '):format(endLnum - lnum)
|
||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||
local targetWidth = width - sufWidth
|
||||
local curWidth = 0
|
||||
for _, chunk in ipairs(virtText) do
|
||||
local chunkText = chunk[1]
|
||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if targetWidth > curWidth + chunkWidth then
|
||||
table.insert(newVirtText, chunk)
|
||||
else
|
||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, {chunkText, hlGroup})
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
break
|
||||
end
|
||||
curWidth = curWidth + chunkWidth
|
||||
end
|
||||
table.insert(newVirtText, {suffix, 'MoreMsg'})
|
||||
return newVirtText
|
||||
end
|
||||
'';
|
||||
|
||||
provider_selector =
|
||||
mkLuaInline
|
||||
# lua
|
||||
''
|
||||
function(bufnr, filetype, buftype)
|
||||
return {'treesitter', 'indent'}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
borders = {
|
||||
enable = true;
|
||||
plugins = {
|
||||
lspsaga.enable = true;
|
||||
fastaction.enable = true;
|
||||
lsp-signature.enable = true;
|
||||
which-key.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,393 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gh
|
||||
ripgrep
|
||||
fd
|
||||
lua-language-server
|
||||
nodejs_22
|
||||
nixfmt-rfc-style
|
||||
markdownlint-cli2
|
||||
shfmt
|
||||
nixd
|
||||
marksman
|
||||
nginx-language-server
|
||||
bash-language-server
|
||||
tailwindcss-language-server
|
||||
vscode-langservers-extracted
|
||||
gopls
|
||||
pyright
|
||||
yaml-language-server
|
||||
marksman
|
||||
lazygit
|
||||
|
||||
# formatter
|
||||
prettierd
|
||||
black
|
||||
|
||||
# SystemVerilog
|
||||
verible
|
||||
];
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default;
|
||||
withPython3 = true;
|
||||
extraPython3Packages = (
|
||||
ps: with ps; [
|
||||
debugpy
|
||||
]
|
||||
);
|
||||
|
||||
withNodeJs = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
lua-language-server
|
||||
ripgrep
|
||||
stylua
|
||||
vue-language-server
|
||||
dockerfile-language-server-nodejs
|
||||
ruff
|
||||
hadolint
|
||||
cmake-language-server
|
||||
cmake-lint
|
||||
cmake-format
|
||||
markdownlint-cli2
|
||||
marksman
|
||||
csharpier
|
||||
netcoredbg
|
||||
black
|
||||
prettierd
|
||||
biome
|
||||
eslint
|
||||
typescript-language-server
|
||||
typescript
|
||||
vtsls
|
||||
stylelint-lsp
|
||||
stylelint
|
||||
clang-tools
|
||||
taplo
|
||||
zls
|
||||
vscode-js-debug
|
||||
neocmakelsp
|
||||
|
||||
ghostscript
|
||||
];
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
lazy-nvim
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
let
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
LazyVim
|
||||
|
||||
bufferline-nvim
|
||||
cmp-buffer
|
||||
cmp-nvim-lsp
|
||||
cmp-path
|
||||
cmp-git
|
||||
blink-cmp
|
||||
crates-nvim
|
||||
conform-nvim
|
||||
dashboard-nvim
|
||||
dressing-nvim
|
||||
flash-nvim
|
||||
friendly-snippets
|
||||
gitsigns-nvim
|
||||
grug-far-nvim
|
||||
indent-blankline-nvim
|
||||
lazydev-nvim
|
||||
lualine-nvim
|
||||
luvit-meta
|
||||
neotest
|
||||
noice-nvim
|
||||
nui-nvim
|
||||
nvim-cmp
|
||||
nvim-lint
|
||||
nvim-lspconfig
|
||||
nvim-snippets
|
||||
nvim-treesitter
|
||||
nvim-treesitter-context
|
||||
nvim-treesitter-textobjects
|
||||
nvim-ts-autotag
|
||||
nvim-ts-context-commentstring
|
||||
nvim-web-devicons
|
||||
persistence-nvim
|
||||
plenary-nvim
|
||||
snacks-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-nvim
|
||||
todo-comments-nvim
|
||||
tokyonight-nvim
|
||||
trouble-nvim
|
||||
ts-comments-nvim
|
||||
which-key-nvim
|
||||
vim-markdown-toc
|
||||
nvim-dap
|
||||
nvim-dap-ui
|
||||
nvim-dap-virtual-text
|
||||
nvim-nio
|
||||
one-small-step-for-vimkind
|
||||
none-ls-nvim
|
||||
render-markdown-nvim
|
||||
markdown-preview-nvim
|
||||
markdown-nvim
|
||||
image-nvim
|
||||
hover-nvim
|
||||
|
||||
# Python
|
||||
neotest-python
|
||||
nvim-dap-python
|
||||
|
||||
# C#
|
||||
omnisharp-extended-lsp-nvim
|
||||
neotest-dotnet
|
||||
|
||||
# Cmake
|
||||
cmake-tools-nvim
|
||||
SchemaStore-nvim
|
||||
|
||||
{
|
||||
name = "LuaSnip";
|
||||
path = luasnip;
|
||||
}
|
||||
|
||||
{
|
||||
name = "catppuccin";
|
||||
path = catppuccin-nvim;
|
||||
}
|
||||
{
|
||||
name = "mini.ai";
|
||||
path = mini-nvim;
|
||||
}
|
||||
{
|
||||
name = "mini.bufremove";
|
||||
path = mini-nvim;
|
||||
}
|
||||
{
|
||||
name = "mini.comment";
|
||||
path = mini-nvim;
|
||||
}
|
||||
{
|
||||
name = "mini.indentscope";
|
||||
path = mini-nvim;
|
||||
}
|
||||
{
|
||||
name = "mini.pairs";
|
||||
path = mini-nvim;
|
||||
}
|
||||
{
|
||||
name = "mini.surround";
|
||||
path = mini-nvim;
|
||||
}
|
||||
];
|
||||
mkEntryFromDrv =
|
||||
drv:
|
||||
if lib.isDerivation drv then
|
||||
{
|
||||
name = "${lib.getName drv}";
|
||||
path = drv;
|
||||
}
|
||||
else
|
||||
drv;
|
||||
|
||||
lazyPath = pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins);
|
||||
in
|
||||
# lua
|
||||
''
|
||||
require("lazy").setup({
|
||||
defaults = {
|
||||
lazy = true,
|
||||
},
|
||||
dev = {
|
||||
-- reuse files from pkgs.vimPlugins.*
|
||||
path = "${lazyPath}",
|
||||
patterns = { "" },
|
||||
-- fallback to download
|
||||
fallback = true,
|
||||
},
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- The following configs are needed for fixing lazyvim on nix
|
||||
-- force enable telescope-fzf-native.nvim
|
||||
-- { "nvim-telescope/telescope-fzf-native.nvim", enabled = true },
|
||||
|
||||
{ import = "lazyvim.plugins.extras.coding.blink" },
|
||||
{ import = "lazyvim.plugins.extras.coding.luasnip" },
|
||||
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
|
||||
{ import = "lazyvim.plugins.extras.coding.yanky" },
|
||||
{ import = "lazyvim.plugins.extras.coding.neogen" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.dap.nlua" },
|
||||
{ import = "lazyvim.plugins.extras.editor.dial" },
|
||||
-- { import = "lazyvim.plugins.extras.formatting.biome" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.black" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
{ import = "lazyvim.plugins.extras.lang.cmake" },
|
||||
{ import = "lazyvim.plugins.extras.lang.docker" },
|
||||
{ import = "lazyvim.plugins.extras.lang.git" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nix" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.zig" },
|
||||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nushell" },
|
||||
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
|
||||
{ import = "lazyvim.plugins.extras.lang.clangd" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.toml" },
|
||||
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-indentscope" },
|
||||
{ import = "lazyvim.plugins.extras.ui.smear-cursor" },
|
||||
{ import = "lazyvim.plugins.extras.ui.treesitter-context" },
|
||||
{ import = "lazyvim.plugins.extras.util.dot" },
|
||||
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
|
||||
{ import = "lazyvim.plugins.extras.util.project" },
|
||||
{ import = "lazyvim.plugins.extras.util.rest" },
|
||||
{ import = "lazyvim.plugins.extras.editor.refactoring" },
|
||||
{ import = "lazyvim.plugins.extras.editor.harpoon2" },
|
||||
{ import = "lazyvim.plugins.extras.editor.snacks_explorer" },
|
||||
{ import = "lazyvim.plugins.extras.editor.snacks_picker" },
|
||||
|
||||
-- import/override your plugins
|
||||
{ import = "plugins" },
|
||||
|
||||
-- Vue & Typescript
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.servers.vtsls.filetypes, "vue")
|
||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = "${pkgs.vue-language-server}/lib/node_modules/@vue/language-server",
|
||||
languages = { "vue" },
|
||||
configNamespace = "typescript",
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- Python debugpy
|
||||
{
|
||||
{
|
||||
"mfussenegger/nvim-dap-python",
|
||||
config = function ()
|
||||
require("dap-python").setup("python3")
|
||||
end
|
||||
},
|
||||
},
|
||||
|
||||
-- Nix
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
nixd = {
|
||||
cmd = { "nixd" },
|
||||
filetypes = { "nix" },
|
||||
settings = {
|
||||
nixd = {
|
||||
nixpkgs = {
|
||||
expr = "import <nixpkgs> { }",
|
||||
},
|
||||
formatting = {
|
||||
command = { "nixfmt" },
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
-- disable mason.nvim, use config.extraPackages
|
||||
{ "williamboman/mason-lspconfig.nvim", enabled = false },
|
||||
{ "williamboman/mason.nvim", enabled = false },
|
||||
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
|
||||
|
||||
-- put this line at the end of spec to clear ensure_installed
|
||||
{ "nvim-treesitter/nvim-treesitter", opts = function(_, opts) opts.ensure_installed = {} end },
|
||||
},
|
||||
})
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."nvim/parser".source =
|
||||
let
|
||||
parsers = pkgs.symlinkJoin {
|
||||
name = "treesitter-parsers";
|
||||
paths =
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
|
||||
plugins: with plugins; [
|
||||
c
|
||||
cpp
|
||||
c_sharp
|
||||
lua
|
||||
bash
|
||||
comment
|
||||
css
|
||||
scss
|
||||
nu
|
||||
ninja
|
||||
rst
|
||||
|
||||
# rust
|
||||
rust
|
||||
ron
|
||||
|
||||
# docker
|
||||
dockerfile
|
||||
|
||||
fish
|
||||
|
||||
# cmake
|
||||
cmake
|
||||
|
||||
# git
|
||||
gitattributes
|
||||
gitignore
|
||||
git_config
|
||||
gitcommit
|
||||
git_rebase
|
||||
|
||||
go
|
||||
gomod
|
||||
gowork
|
||||
gosum
|
||||
|
||||
hcl
|
||||
javascript
|
||||
jq
|
||||
json5
|
||||
lua
|
||||
make
|
||||
markdown
|
||||
nix
|
||||
python
|
||||
toml
|
||||
typescript
|
||||
vue
|
||||
yaml
|
||||
zig
|
||||
|
||||
]
|
||||
)).dependencies;
|
||||
};
|
||||
in
|
||||
"${parsers}/parser";
|
||||
|
||||
xdg.configFile."nvim/lua".source = ../config/nvim/lua;
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
settings = {
|
||||
unfocused-split-opacity = 0.85;
|
||||
desktop-notifications = false;
|
||||
background-opacity = 0;
|
||||
background-opacity = 0.4;
|
||||
background-blur = false;
|
||||
|
||||
wait-after-command = false;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ in
|
|||
#memory,
|
||||
#cpu,
|
||||
#pulseaudio {
|
||||
font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 2)}px;
|
||||
font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 1)}px;
|
||||
}
|
||||
|
||||
/* Main bar */
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ let
|
|||
"desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"
|
||||
"desc:Acer Technologies XV272U V3 1322131231233"
|
||||
];
|
||||
memeSelector = pkgs.callPackage ../../../home/scripts/memeSelector.nix { };
|
||||
in
|
||||
{
|
||||
networking.firewall.allowedTCPPortRanges = [
|
||||
|
|
@ -26,6 +27,7 @@ in
|
|||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules/presets/basic.nix
|
||||
../../modules/sunshine.nix
|
||||
|
||||
# Nvidia GPU Driver
|
||||
(import ../../modules/nvidia.nix {
|
||||
|
|
@ -52,10 +54,16 @@ in
|
|||
|
||||
../../modules/davinci-resolve.nix
|
||||
../../modules/webcam.nix
|
||||
../../modules/postgresql.nix
|
||||
./nginx.nix
|
||||
|
||||
];
|
||||
|
||||
# Live Sync D
|
||||
services.postgresql = {
|
||||
ensureUsers = [ { name = "${username}"; } ];
|
||||
ensureDatabases = [ "livesyncd" ];
|
||||
};
|
||||
|
||||
# Power Management
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
|
|
@ -65,6 +73,7 @@ in
|
|||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
memeSelector
|
||||
rustdesk
|
||||
((blender.override { cudaSupport = true; }).overrideAttrs (prev: {
|
||||
postInstall = ''
|
||||
|
|
@ -161,6 +170,9 @@ in
|
|||
misc = {
|
||||
vrr = 0;
|
||||
};
|
||||
bind = [
|
||||
"$mainMod ctrl, M, exec, ${memeSelector}/bin/memeSelector"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,16 +3,14 @@
|
|||
config,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
caskaydia = {
|
||||
name = "CaskaydiaCove Nerd Font Mono";
|
||||
package = pkgs.nerd-fonts.caskaydia-cove;
|
||||
};
|
||||
|
||||
sf-pro-display-bold = pkgs.callPackage ../../pkgs/fonts/sf-pro-display-bold { };
|
||||
in
|
||||
{
|
||||
sf-pro-display-bold = pkgs.callPackage ../../pkgs/fonts/sf-pro-display-bold {};
|
||||
in {
|
||||
stylix = {
|
||||
enable = true;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-medium.yaml";
|
||||
|
|
@ -39,17 +37,14 @@ in
|
|||
};
|
||||
|
||||
fonts = {
|
||||
packages = (
|
||||
with pkgs;
|
||||
[
|
||||
packages = with pkgs; [
|
||||
font-awesome
|
||||
jetbrains-mono
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
sf-pro-display-bold
|
||||
]
|
||||
);
|
||||
];
|
||||
|
||||
fontDir.enable = true;
|
||||
};
|
||||
|
|
@ -67,6 +62,10 @@ in
|
|||
hyprlock.enable = false;
|
||||
hyprland.enable = false;
|
||||
rofi.enable = false;
|
||||
nvf = {
|
||||
enable = true;
|
||||
transparentBackground = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
12
system/modules/sunshine.nix
Normal file
12
system/modules/sunshine.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
capSysAdmin = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
sunshine_name = config.networking.hostName;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue