Compare commits

...

2 commits

Author SHA1 Message Date
aed9af6f45
nvim: enable inlay hints + toggling 2024-12-05 00:22:39 +01:00
5c319ac288
nvim: Iterate on colors 2024-12-05 00:22:04 +01:00
7 changed files with 129 additions and 45 deletions

View file

@ -40,11 +40,11 @@
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"lastModified": 1733269028,
"narHash": "sha256-kVq/jAKKtbvWwbL9wf0SKDxtxsC5Gb+nlIYEFnyXhGA=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"rev": "e37654df08605b510ad84eceaafcc7248495e843",
"type": "github"
},
"original": {
@ -103,11 +103,11 @@
"zig": "zig"
},
"locked": {
"lastModified": 1732920523,
"narHash": "sha256-/Udch6RRLBSjluDXjQHWpiYFFJR15g+qV263ibVBwoc=",
"lastModified": 1733235265,
"narHash": "sha256-BZBmyv2gY4SmanxCM0ZVYhYx7t2/Az/okDOQj+4RIso=",
"ref": "refs/heads/main",
"rev": "3c637a2777885dab9f8bb9d2b7c36411d62e1e4c",
"revCount": 8136,
"rev": "50dc4b75d73bab7631e22e19e940331ad7ac8cfd",
"revCount": 8155,
"type": "git",
"url": "ssh://git@github.com/ghostty-org/ghostty"
},
@ -209,11 +209,11 @@
]
},
"locked": {
"lastModified": 1732884235,
"narHash": "sha256-r8j6R3nrvwbT1aUp4EPQ1KC7gm0pu9VcV1aNaB+XG6Q=",
"lastModified": 1733317578,
"narHash": "sha256-anN/LcP5IuqEARvhPETg1vnbyG3IQ0wdvSAYEJfIQzA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "819f682269f4e002884702b87e445c82840c68f2",
"rev": "ad48eb25cd0b00ce730da00fa1f8e6e6c27b397d",
"type": "github"
},
"original": {
@ -232,11 +232,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1732925246,
"narHash": "sha256-MjqyzOEa6s9OGO8SMh5C2kqo57+iSNsgDbzPBbpi4QU=",
"lastModified": 1733314815,
"narHash": "sha256-FxQzRALeGEfZg7ZA+ArlGBbs3Jtwd7Tr7+E6iucHKDA=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "7461a0b228bb48bb02af086f8b9ee9a83583120b",
"rev": "7545e949aa9bc2396130191100f1fbf9765bc448",
"type": "github"
},
"original": {
@ -248,11 +248,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1732903628,
"narHash": "sha256-JF8zmoLdqmbKCSS5Smf/Yj0jEl5f+qKhSubhPo/BvUM=",
"lastModified": 1733247868,
"narHash": "sha256-TGXXXV/jWUBF2ZBiYt6RKIvUGpsefDe/RSXnUzejxMU=",
"owner": "neovim",
"repo": "neovim",
"rev": "2833925cfc688786759d6a980a1ad62b62d20570",
"rev": "ae93c7f369a174f3d738ab55030de2c9dfc10c57",
"type": "github"
},
"original": {
@ -263,11 +263,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1732617236,
"narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=",
"lastModified": 1733097829,
"narHash": "sha256-9hbb1rqGelllb4kVUCZ307G2k3/UhmA8PPGBoyuWaSw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e",
"rev": "2c15aa59df0017ca140d9ba302412298ab4bf22a",
"type": "github"
},
"original": {
@ -279,11 +279,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1732749044,
"narHash": "sha256-T38FQOg0BV5M8FN1712fovzNakSOENEYs+CSkg31C9Y=",
"lastModified": 1733220138,
"narHash": "sha256-Yh5XZ9yVurrcYdNTSWxYgW4+EJ0pcOqgM1043z9JaRc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0c5b4ecbed5b155b705336aa96d878e55acd8685",
"rev": "bcb68885668cccec12276bbb379f8f2557aa06ce",
"type": "github"
},
"original": {
@ -295,11 +295,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1732937961,
"narHash": "sha256-B5pYT+IVaqcrfOekkwKvx/iToDnuQWzc2oyDxzzBDc4=",
"lastModified": 1733097829,
"narHash": "sha256-9hbb1rqGelllb4kVUCZ307G2k3/UhmA8PPGBoyuWaSw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4703b8d2c708e13a8cab03d865f90973536dcdf5",
"rev": "2c15aa59df0017ca140d9ba302412298ab4bf22a",
"type": "github"
},
"original": {
@ -311,11 +311,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1732837521,
"narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=",
"lastModified": 1733212471,
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370",
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776",
"type": "github"
},
"original": {

View file

@ -50,7 +50,6 @@
plugins = with pkgs.vimPlugins; [
friendly-snippets
go-nvim
rustaceanvim
targets-vim
ts-comments-nvim
@ -116,6 +115,23 @@
'';
}
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "inlay-hints";
src = pkgs.fetchFromGitHub {
owner = "MysticalDevil";
repo = "inlay-hints.nvim";
rev = "af84dee42cd118af6d592b06c1c0e45d6432a6c0"; # 2024-08-23
hash = "sha256-DZVtFAUK9c8GInp+JdCQ1BKe0dkAheHKI67oxdMmA24=";
};
};
type = "lua";
config = ''
require('inlay-hints').setup()
require("inlay-hints.utils").enable_inlay_hints()
'';
}
{
plugin = codeium-nvim;
type = "lua";
@ -185,6 +201,12 @@
type = "lua";
config = lib.fileContents ./mini.lua;
}
{
plugin = rustaceanvim;
type = "lua";
config = lib.fileContents ./rust.lua;
}
];
};
}

View file

@ -42,16 +42,18 @@ local colors = {
background = "NONE",
foreground = "NONE",
accent1 = hsl(12, 100, 50),
accent1 = hsl(202, 57, 57), -- Blue
accent2 = hsl(40, 57, 57), -- Yellow
dimmed = hsl(0, 0, 25),
dimmed_subtle = hsl(0, 0, 50),
dimmed = hsl(212, 19, 25),
-- dimmed_subtle = hsl(212, 19, 70),
dimmed_subtle = hsl(212, 5, 65),
highlight_subtle = hsl(0, 0, 6),
highlight_subtle = hsl(212, 27, 11),
highlight_intense = hsl(58, 100, 60),
string = hsl(96, 50, 70),
comment = hsl(220, 50, 60),
string = hsl(96, 35, 60),
comment = hsl(2, 69, 68),
comment_error = hsl(2, 85, 50),
diagnostic_error = hsl(353, 100, 45),
@ -71,10 +73,6 @@ local colors = {
delete = hsl(350, 100, 40),
delete_quarter = hsl(350, 100, 15),
-- dialog_bg = background,
-- dialog_fg = hsl(216, 70, 80),
-- dialog_bg = hsl(216, 25, 20),
-- selection = hsl(216, 25, 33),
selection = hsl(213, 60, 40),
cmp_bg = hsl(218, 30, 13),
@ -105,7 +103,7 @@ local theme = {
Special = { link = "NormalNC" },
Type = { link = "NormalNC" },
String = { fg = c.string },
String = { fg = c.string, italic = true },
Comment = { fg = c.comment, italic = true, bold = true },
CommentError = { fg = c.comment_error, italic = true, bold = true },
@ -128,7 +126,8 @@ local theme = {
["@function"] = { link = "NormalNC" },
["@special"] = { link = "NormalNC" },
["@variable"] = { link = "NormalNC" },
["@lsp.type.variable"] = { fg = c.dimmed_subtle },
["@variable.parameter"] = { fg = c.accent2 },
["@lsp.type.variable"] = { fg = c.dimmed_subtle, italic = true },
-- UI Elements
CursorLine = { bg = c.highlight_subtle },
@ -148,8 +147,13 @@ local theme = {
DiagnosticSignInfo = { fg = c.diagnostic_info },
DiagnosticSignWarn = { fg = c.diagnostic_warning },
LineNr = { fg = c.dimmed, italic = true },
IndentLine = { fg = c.background },
IndentLineCurrent = { fg = c.dimmed },
CursorLineNr = { fg = c.dimmed_subtle, bg = c.highlight_subtle, bold = true },
IndentLine = { fg = c.dimmed },
IndentLineCurrent = { fg = c.dimmed_subtle },
MiniIndentscopeSymbol = { link = "IndentLine" },
MiniIndentscopeSymbolOff = { link = "IndentLine" },
TreesitterContext = { reverse = true },
TreesitterContextLineNumber = { bg = c.dimmed, reverse = true, italic = true },
InclineNormal = { bg = c.background },
@ -200,6 +204,7 @@ local theme = {
Visual = { bg = c.selection },
LspReferenceText = { fg = c.highlight_intense, undercurl = true },
LspInlayHint = { fg = c.accent1, italic = true, bold = true },
}
vim.cmd("hi clear")

View file

@ -152,5 +152,5 @@ vim.keymap.set("n", "K", function()
vim.keymap.set("n", "<Leader>ub", function()
vim.o.background = (vim.o.background == "light" and "dark" or "light")
end, opts("Toggle dark/light background"))
vim.keymap.set("n", "<Leader>uh", "<cmd>InlayHintsToggle<cr>", opts("Toggle inlay hints"))

View file

@ -1,12 +1,27 @@
local lspconfig = require("lspconfig")
local servers = {
cssls = {},
gopls = {},
html = {},
jsonls = {},
superhtml = {},
ts_ls = {},
gopls = {
settings = {
gopls = {
hints = {
rangeVariableTypes = true,
parameterNames = true,
constantValues = true,
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
functionTypeParameters = true,
},
},
},
},
harper_ls = {
filetypes = {
"asciidoc", "c", "gitcommit", "go", "html", "javascript", "just", "lua", "markdown",
@ -22,6 +37,7 @@ local servers = {
path = vim.split(package.path, ";"),
},
diagnostics = { globals = { "vim", "hs" } },
hint = { enable = true },
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,

40
home/common/nvim/rust.lua Normal file
View file

@ -0,0 +1,40 @@
vim.g.rustaceanvim = {
server = {
settings = {
["rust-analyzer"] = {
inlayHints = {
bindingModeHints = {
enable = false,
},
chainingHints = {
enable = true,
},
closingBraceHints = {
enable = true,
minLines = 25,
},
closureReturnTypeHints = {
enable = "never",
},
lifetimeElisionHints = {
enable = "never",
useParameterNames = false,
},
maxLength = 25,
parameterHints = {
enable = true,
},
reborrowHints = {
enable = "never",
},
renderColons = true,
typeHints = {
enable = true,
hideClosureInitialization = false,
hideNamedConstructor = false,
},
},
},
},
},
}

View file

@ -13,6 +13,7 @@
plugins = with pkgs.vimPlugins; [
ts-comments-nvim
nvim-ts-context-commentstring
playground
{
plugin = nvim-treesitter-context;