config lazyvim

This commit is contained in:
zack 2024-10-08 00:27:07 -04:00
parent 5ce32b345d
commit 07dcfdaedb
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
10 changed files with 391 additions and 52 deletions

38
flake.lock generated
View file

@ -709,11 +709,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1728223706, "lastModified": 1728303775,
"narHash": "sha256-HrsylIpk+17wwsh/+sgUBmL7VHakF+EWv9v9Dx1268I=", "narHash": "sha256-+DykzTwUrLGOLHQdnWB1Wp0WIfBGhpqXoyTXdwIOoiY=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "4e41cda27ed4176005082436cb35878335e63fae", "rev": "97444ed7a8a83406970fcc05907db1110435b59b",
"revCount": 5301, "revCount": 5302,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@ -1065,11 +1065,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1727571693, "lastModified": 1728176478,
"narHash": "sha256-b7sFVeqMtz8xntCL3tBY3O8suTg5PeF53LTL3eCcKyc=", "narHash": "sha256-px3Q0W//c+mZ4kPMXq4poztsjtXM1Ja1rN+825YMDUQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "bb58a3bf239e03fca9d51062e2fe028a4ea5a3d1", "rev": "b61309c3c1b6013d36299bc8285612865b3b9e4c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1086,11 +1086,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727917377, "lastModified": 1728308313,
"narHash": "sha256-eefXdEPUMuhiV6Vy3ASSyApCseE9OoKDgL/G6qenw/4=", "narHash": "sha256-GThSJ4OcPOOtf8j8ge7ik4141BHVbBALu0N7Ju+Nw18=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "9ae128172f823956e54947fe471bc6dfa670ecb4", "rev": "71f9c8bcc87f15dba12515e94e40de243b5db103",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1160,11 +1160,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1728217273, "lastModified": 1728249353,
"narHash": "sha256-p/gvyVf24WFs0bted3c71uSQk++ZOYRWbg3bjRoePu4=", "narHash": "sha256-7NBJm1jfMeAowE1J2oljYqWVvI9X7FyyxBY4O8uB/Os=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "50b3bd3fed0442bcbf7f58355e990da84af1749d", "rev": "c8a17040be4a20b29589cb4043a9e0c36af1930e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1450,11 +1450,11 @@
"systems": "systems_12" "systems": "systems_12"
}, },
"locked": { "locked": {
"lastModified": 1728247562, "lastModified": 1728305369,
"narHash": "sha256-ovmRSqdZgwNIrbwenGAym7hXOexPgKsJoo7fta7CG3E=", "narHash": "sha256-CxUppOwq/RxEKJ26MP9g9/t5qn1WxKn6UQd039pQSMo=",
"owner": "raphamorim", "owner": "raphamorim",
"repo": "rio", "repo": "rio",
"rev": "f27b9a1c1e0cb76be2eecfe59eb962912e5ea09e", "rev": "b9d8879b5463cbe71a47cca6494d3fe0ec1c9485",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1581,11 +1581,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728188225, "lastModified": 1728274624,
"narHash": "sha256-3Mf0XHpECwSxVDb7VYmiD7mqcMA3FcVVfqs3LLZHdaA=", "narHash": "sha256-auf6OnXvV8LiH/KvGIDmxUdhPeivGSxOHxrPvMHd+T4=",
"owner": "Gerg-L", "owner": "Gerg-L",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"rev": "f532f68a72549f8ee585aa2f6f7dbe9e2ce5a45c", "rev": "4bcc76b94f01cfddc899191e99d96059b8702608",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -0,0 +1,31 @@
{
"extras": [
"lazyvim.plugins.extras.coding.mini-comment",
"lazyvim.plugins.extras.coding.yanky",
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.editor.dial",
"lazyvim.plugins.extras.editor.inc-rename",
"lazyvim.plugins.extras.lang.angular",
"lazyvim.plugins.extras.lang.astro",
"lazyvim.plugins.extras.lang.cmake",
"lazyvim.plugins.extras.lang.docker",
"lazyvim.plugins.extras.lang.haskell",
"lazyvim.plugins.extras.lang.java",
"lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.nix",
"lazyvim.plugins.extras.lang.sql",
"lazyvim.plugins.extras.lang.svelte",
"lazyvim.plugins.extras.lang.tailwind",
"lazyvim.plugins.extras.lang.tex",
"lazyvim.plugins.extras.lang.typescript",
"lazyvim.plugins.extras.test.core",
"lazyvim.plugins.extras.util.dot",
"lazyvim.plugins.extras.util.mini-hipatterns",
"lazyvim.plugins.extras.coding.luasnip"
],
"news": {
"NEWS.md": "6520"
},
"version": 6
}

View file

@ -3,32 +3,34 @@ require("lazy").setup({
-- add LazyVim and import its plugins -- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" }, { "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins -- import/override with your plugins
{ import = "lazyvim.plugins.extras.lang.rust" }, -- { import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.json" }, -- { import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.astro" }, -- { import = "lazyvim.plugins.extras.lang.astro" },
{ import = "lazyvim.plugins.extras.lang.git" }, -- { import = "lazyvim.plugins.extras.lang.git" },
{ import = "lazyvim.plugins.extras.lang.docker" }, -- { import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.clangd" }, -- { import = "lazyvim.plugins.extras.lang.clangd" },
{ import = "lazyvim.plugins.extras.lang.cmake" }, -- { import = "lazyvim.plugins.extras.lang.cmake" },
{ import = "lazyvim.plugins.extras.lang.haskell" }, -- { import = "lazyvim.plugins.extras.lang.haskell" },
{ import = "lazyvim.plugins.extras.lang.java" }, -- { import = "lazyvim.plugins.extras.lang.java" },
{ import = "lazyvim.plugins.extras.lang.markdown" }, -- { import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.nix" }, -- { import = "lazyvim.plugins.extras.lang.nix" },
{ import = "lazyvim.plugins.extras.lang.sql" }, -- { import = "lazyvim.plugins.extras.lang.sql" },
{ import = "lazyvim.plugins.extras.lang.svelte" }, -- { import = "lazyvim.plugins.extras.lang.svelte" },
{ import = "lazyvim.plugins.extras.lang.tailwind" }, -- { import = "lazyvim.plugins.extras.lang.tailwind" },
{ import = "lazyvim.plugins.extras.lang.tex" }, -- { import = "lazyvim.plugins.extras.lang.tex" },
{ import = "lazyvim.plugins.extras.lang.typescript" }, -- { import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.toml" }, -- { import = "lazyvim.plugins.extras.lang.toml" },
{ import = "lazyvim.plugins.extras.lang.angular" }, -- { import = "lazyvim.plugins.extras.lang.angular" },
--
{ import = "lazyvim.plugins.extras.formatting.prettier" }, -- { import = "lazyvim.plugins.extras.formatting.prettier" },
--
{ import = "lazyvim.plugins.extras.coding.luasnip" }, -- { import = "lazyvim.plugins.extras.coding.luasnip" },
{ import = "lazyvim.plugins.extras.coding.yanky" }, -- { import = "lazyvim.plugins.extras.coding.yanky" },
--
{ import = "lazyvim.plugins.extras.dap.core" }, -- { import = "lazyvim.plugins.extras.dap.core" },
{ import = "plugins" }, { import = "plugins" },
{ import = "plugins.extras.rust" },
-- { import = "plugins.extras.clangd" },
}, },
defaults = { defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.

View file

@ -13,4 +13,43 @@ return {
}, },
}, },
}, },
-- {
-- "saghen/blink.cmp",
-- lazy = false, -- lazy loading handled internally
-- -- optional: provides snippets for the snippet source
-- dependencies = "rafamadriz/friendly-snippets",
--
-- -- use a release tag to download pre-built binaries
-- version = "v0.*",
-- -- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- -- build = 'cargo build --release',
--
-- opts = {
-- keymap = {
-- show = "<C-S-space>",
-- accept = "<Enter>",
-- select_prev = { "<S-Tab>", "<C-j>" },
-- select_next = { "<C-Tab>", "<C-k>" },
--
-- snippet_forward = "<Tab>",
-- snippet_backward = "<C-S-Tab>",
-- },
--
-- highlight = {
-- -- 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, assuming themes add support
-- use_nvim_cmp_as_default = true,
-- },
-- -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- -- adjusts spacing to ensure icons are aligned
-- nerd_font_variant = "normal",
--
-- -- experimental auto-brackets support
-- -- accept = { auto_brackets = { enabled = true } }
--
-- -- experimental signature help support
-- -- trigger = { signature_help = { enabled = true } }
-- },
-- },
} }

View file

@ -0,0 +1,153 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
root = {
".clangd",
".clang-tidy",
".clang-format",
"compile_commands.json",
"compile_flags.txt",
"configure.ac", -- AutoTools
},
})
end,
-- Add C/C++ to treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "cpp" } },
},
{
"p00f/clangd_extensions.nvim",
lazy = true,
config = function() end,
opts = {
inlay_hints = {
inline = false,
},
ast = {
--These require codicons (https://github.com/microsoft/vscode-codicons)
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
},
},
},
-- Correctly setup lspconfig for clangd 🚀
{
"neovim/nvim-lspconfig",
opts = {
servers = {
-- Ensure mason installs the server
clangd = {
keys = {
{ "<leader>ch", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
},
root_dir = function(fname)
return require("lspconfig.util").root_pattern(
"Makefile",
"configure.ac",
"configure.in",
"config.h.in",
"meson.build",
"meson_options.txt",
"build.ninja"
)(fname) or require("lspconfig.util").root_pattern("compile_commands.json", "compile_flags.txt")(
fname
) or require("lspconfig.util").find_git_ancestor(fname)
end,
capabilities = {
offsetEncoding = { "utf-16" },
},
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
init_options = {
usePlaceholders = true,
completeUnimported = true,
clangdFileStatus = true,
},
},
},
setup = {
clangd = function(_, opts)
local clangd_ext_opts = LazyVim.opts("clangd_extensions.nvim")
require("clangd_extensions").setup(vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts }))
return false
end,
},
},
},
{
"nvim-cmp",
opts = function(_, opts)
table.insert(opts.sorting.comparators, 1, require("clangd_extensions.cmp_scores"))
end,
},
{
"mfussenegger/nvim-dap",
optional = true,
opts = function()
local dap = require("dap")
if not dap.adapters["codelldb"] then
require("dap").adapters["codelldb"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "codelldb",
args = {
"--port",
"${port}",
},
},
}
end
for _, lang in ipairs({ "c", "cpp" }) do
dap.configurations[lang] = {
{
type = "codelldb",
request = "launch",
name = "Launch file",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
},
{
type = "codelldb",
request = "attach",
name = "Attach to process",
pid = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
}
end
end,
},
}

View file

@ -0,0 +1,118 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "rust",
root = { "Cargo.toml", "rust-project.json" },
})
end,
-- Extend auto completion
{
"hrsh7th/nvim-cmp",
dependencies = {
{
"Saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
opts = {
completion = {
cmp = { enabled = true },
},
},
},
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, { name = "crates" })
end,
},
-- Add Rust & related to treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "rust", "ron" } },
},
{
"mrcjkb/rustaceanvim",
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
ft = { "rust" },
opts = {
server = {
on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>cR", function()
vim.cmd.RustLsp("codeAction")
end, { desc = "Code Action", buffer = bufnr })
vim.keymap.set("n", "<leader>dr", function()
vim.cmd.RustLsp("debuggables")
end, { desc = "Rust Debuggables", buffer = bufnr })
end,
default_settings = {
-- rust-analyzer language server configuration
["rust-analyzer"] = {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
buildScripts = {
enable = true,
},
},
-- Add clippy lints for Rust.
checkOnSave = true,
procMacro = {
enable = true,
ignored = {
["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" },
["async-recursion"] = { "async_recursion" },
},
},
},
},
},
},
config = function(_, opts)
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
if vim.fn.executable("rust-analyzer") == 0 then
LazyVim.error(
"**rust-analyzer** not found in PATH, please install it.\nhttps://rust-analyzer.github.io/",
{ title = "rustaceanvim" }
)
end
end,
},
-- Correctly setup lspconfig for Rust 🚀
{
"neovim/nvim-lspconfig",
opts = {
servers = {
taplo = {
keys = {
{
"K",
function()
if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
require("crates").show_popup()
else
vim.lsp.buf.hover()
end
end,
desc = "Show Crate Documentation",
},
},
},
},
},
},
{
"nvim-neotest/neotest",
optional = true,
opts = {
adapters = {
["rustaceanvim.neotest"] = {},
},
},
},
}

View file

@ -72,8 +72,7 @@ in {
extraPortals = [ extraPortals = [
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-wlr pkgs.xdg-desktop-portal-wlr
# inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-hyprland
pkgs.xwaylandvideobridge pkgs.xwaylandvideobridge
]; ];
}; };

View file

@ -40,10 +40,7 @@ in {
exportGlyphNames = true exportGlyphNames = true
[buildPlans.IosevkaCustom.variants] [buildPlans.IosevkaCustom.variants]
inherits = "ss20" inherits = "ss03"
[buildPlans.IosevkaCustom.variants.design]
one = "base-flat-top-serif"
''; '';
}) })
noto-fonts noto-fonts

View file

@ -26,7 +26,7 @@
hardware.audio.enable = true; hardware.audio.enable = true;
hardware.nvidia.enable = true; hardware.nvidia.enable = true;
nprograms.nix-ld.enable = true; programs.nix-ld.enable = true;
programs.steam.enable = true; programs.steam.enable = true;
programs.steam.gamescopeSession.enable = true; programs.steam.gamescopeSession.enable = true;

View file

@ -27,7 +27,7 @@
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/mnt/lul/" = { fileSystems."/mnt/lul" = {
device = "/dev/disk/by-partuuid/2b7f6948-57a6-4fef-a931-b3aa962faee3"; device = "/dev/disk/by-partuuid/2b7f6948-57a6-4fef-a931-b3aa962faee3";
fsType = "ntfs-3g"; fsType = "ntfs-3g";
}; };