nvim: enable inlay hints + toggling
This commit is contained in:
parent
5c319ac288
commit
aed9af6f45
6 changed files with 110 additions and 31 deletions
56
flake.lock
56
flake.lock
|
@ -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": {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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"))
|
||||
|
||||
|
|
|
@ -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
40
home/common/nvim/rust.lua
Normal 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -13,6 +13,7 @@
|
|||
plugins = with pkgs.vimPlugins; [
|
||||
ts-comments-nvim
|
||||
nvim-ts-context-commentstring
|
||||
playground
|
||||
|
||||
{
|
||||
plugin = nvim-treesitter-context;
|
||||
|
|
Loading…
Reference in a new issue