mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
feat: update system
This commit is contained in:
@@ -41,8 +41,14 @@ in
|
||||
snippet.expand = # lua
|
||||
"function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
window = {
|
||||
completion.border = "rounded";
|
||||
documentation.border = "rounded";
|
||||
completion = {
|
||||
border = "solid";
|
||||
zindex = 10;
|
||||
};
|
||||
documentation = {
|
||||
border = "solid";
|
||||
zindex = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
extraConfigLuaPre = # lua
|
||||
''
|
||||
vim.lsp.set_log_level("off")
|
||||
require("actions-preview").setup({})
|
||||
|
||||
local signs = {
|
||||
@@ -28,15 +29,19 @@ in
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = true,
|
||||
severity_sort = false,
|
||||
})
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" })
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "solid" })
|
||||
'';
|
||||
diagnostics = {
|
||||
signs.text = {
|
||||
"__rawKey__vim.diagnostic.severity.ERROR" = "";
|
||||
"__rawKey__vim.diagnostic.severity.WARN" = "";
|
||||
"__rawKey__vim.diagnostic.severity.INFO" = "";
|
||||
"__rawKey__vim.diagnostic.severity.HINT" = "";
|
||||
};
|
||||
underline = true;
|
||||
update_in_insert = true;
|
||||
severity_sort = true;
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>sa";
|
||||
@@ -70,9 +75,19 @@ in
|
||||
action.__raw = # lua
|
||||
"vim.lsp.buf.hover";
|
||||
}
|
||||
{
|
||||
key = "<leader>sh";
|
||||
mode = "n";
|
||||
options.silent = true;
|
||||
action.__raw = # lua
|
||||
"function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}), {0}) end";
|
||||
}
|
||||
];
|
||||
plugins = {
|
||||
lsp.enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
inlayHints = false;
|
||||
};
|
||||
telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
@@ -81,7 +96,6 @@ in
|
||||
"<leader>si" = "lsp_implementations";
|
||||
"<leader>sw" = "lsp_workspace_symbols";
|
||||
"<leader>st" = "lsp_type_definitions";
|
||||
"<leader>sh" = "diagnostics";
|
||||
};
|
||||
};
|
||||
inc-rename.enable = true;
|
||||
@@ -133,8 +147,8 @@ in
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>sh";
|
||||
icon = "";
|
||||
desc = "Diagnostics";
|
||||
icon = "";
|
||||
desc = "Inlay Hints";
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "<leader>sa";
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
hmConfig,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.presets.base.spellcheck;
|
||||
in
|
||||
{
|
||||
options.presets.base.spellcheck = {
|
||||
enable = lib.mkEnableOption "Spellcheck";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
plugins.lsp.servers.harper_ls = {
|
||||
enable = true;
|
||||
settings = {
|
||||
userDictPath = "${hmConfig.xdg.configHome}/harper-user-dictionary.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -32,8 +32,8 @@ in
|
||||
options = {
|
||||
globalstatus = true;
|
||||
section_separators = {
|
||||
left = ""; # "";
|
||||
right = ""; # "";
|
||||
left = "";
|
||||
right = "";
|
||||
};
|
||||
component_separators = {
|
||||
left = "┊";
|
||||
@@ -45,8 +45,8 @@ in
|
||||
{
|
||||
__unkeyed-1 = "mode";
|
||||
separator = {
|
||||
right = ""; # "";
|
||||
left = ""; # "";
|
||||
right = "";
|
||||
left = "";
|
||||
};
|
||||
icon = "";
|
||||
}
|
||||
@@ -56,8 +56,8 @@ in
|
||||
{
|
||||
__unkeyed-1 = "location";
|
||||
separator = {
|
||||
right = ""; # "";
|
||||
left = ""; # "";
|
||||
right = "";
|
||||
left = "";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28,7 +28,7 @@ in
|
||||
filteredItems.visible = true;
|
||||
};
|
||||
extraSources = [ "document_symbols" ];
|
||||
popupBorderStyle = "rounded";
|
||||
popupBorderStyle = "solid";
|
||||
eventHandlers.neo_tree_buffer_leave = # lua
|
||||
''
|
||||
function()
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{ lib, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
options.programs.nixvim = lib.mkOption {
|
||||
type = lib.types.submoduleWith {
|
||||
type = pkgs.lib.types.submoduleWith {
|
||||
specialArgs = {
|
||||
inherit pkgs;
|
||||
};
|
||||
modules = [
|
||||
./auto-save.nix
|
||||
./auto-format.nix
|
||||
@@ -15,6 +18,7 @@
|
||||
./base/diagnostics.nix
|
||||
./base/find.nix
|
||||
./base/formatting.nix
|
||||
./base/spellcheck.nix
|
||||
./base/status-line.nix
|
||||
./base/syntax.nix
|
||||
./base/tree.nix
|
||||
@@ -29,10 +33,12 @@
|
||||
./languages/python.nix
|
||||
./languages/rust.nix
|
||||
./languages/shell.nix
|
||||
./languages/svelte.nix
|
||||
|
||||
./remaps/half-page-scroll.nix
|
||||
./remaps/no-accidental-macro.nix
|
||||
./remaps/paste-keep-buffer.nix
|
||||
./remaps/wrapped-line-nav.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.presets.languages.c;
|
||||
in
|
||||
{
|
||||
options.presets.languages.c = {
|
||||
enable = lib.mkEnableOption "C/C++";
|
||||
cppcheck = lib.mkEnableOption "cppcheck";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
@@ -13,12 +18,28 @@ in
|
||||
c = [ "clang-format" ];
|
||||
cpp = [ "clang-format" ];
|
||||
};
|
||||
lsp.servers.clangd = {
|
||||
none-ls = {
|
||||
enable = true;
|
||||
cmd = [
|
||||
"clangd"
|
||||
"--offset-encoding=utf-16"
|
||||
];
|
||||
sources.diagnostics = {
|
||||
cppcheck = lib.mkIf cfg.cppcheck {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
lsp.servers = {
|
||||
clangd = {
|
||||
enable = true;
|
||||
cmd = [
|
||||
"clangd"
|
||||
"--offset-encoding=utf-16"
|
||||
];
|
||||
settings.InlayHints = {
|
||||
Designators = true;
|
||||
Enabled = true;
|
||||
ParameterNames = true;
|
||||
DeducedTypes = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -42,7 +42,31 @@ in
|
||||
}
|
||||
];
|
||||
lsp.servers = {
|
||||
ts_ls.enable = true;
|
||||
ts_ls = {
|
||||
enable = true;
|
||||
settings = {
|
||||
typescript.inlayHints = {
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
};
|
||||
javascript.inlayHints = {
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
eslint.enable = lib.mkIf cfg.eslint true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -15,6 +15,10 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
plugins = {
|
||||
conform-nvim.settings.formatters_by_ft.nix = [ "nixfmt" ];
|
||||
none-ls = {
|
||||
enable = true;
|
||||
sources.diagnostics.statix.enable = true;
|
||||
};
|
||||
lsp.servers.nil_ls.enable = true;
|
||||
nix.enable = true;
|
||||
};
|
||||
|
||||
@@ -14,6 +14,28 @@ in
|
||||
enable = true;
|
||||
installCargo = false;
|
||||
installRustc = false;
|
||||
settings.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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.presets.languages.svelte;
|
||||
in
|
||||
{
|
||||
options.presets.languages.svelte = {
|
||||
enable = lib.mkEnableOption "Svelte";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
plugins.lsp.servers.svelte = {
|
||||
enable = true;
|
||||
settings.typescript.inlayHints = {
|
||||
parameterNames.enabled = "all";
|
||||
parameterTypes.enabled = true;
|
||||
variableTypes.enabled = true;
|
||||
propertyDeclarationTypes.enabled = true;
|
||||
functionLikeReturnTypes.enabled = true;
|
||||
enumMemberValues.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.presets.remaps.wrapped-line-nav;
|
||||
in
|
||||
{
|
||||
options.presets.remaps.wrapped-line-nav = {
|
||||
enable = lib.mkEnableOption "Navigate wrapped lines up and down";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
key = "<up>";
|
||||
action = "g<up>";
|
||||
}
|
||||
{
|
||||
key = "<down>";
|
||||
action = "g<down>";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -13,7 +13,7 @@ in
|
||||
key = "<leader>xx";
|
||||
mode = "n";
|
||||
action.__raw = # lua
|
||||
"require('trouble').toggle";
|
||||
"function() require('trouble').toggle('diagnostics') end";
|
||||
}
|
||||
{
|
||||
key = "<leader>xw";
|
||||
@@ -42,10 +42,7 @@ in
|
||||
];
|
||||
plugins = {
|
||||
web-devicons.enable = true;
|
||||
trouble = {
|
||||
enable = true;
|
||||
settings.use_diagnostic_signs = true;
|
||||
};
|
||||
trouble.enable = true;
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed-1 = "<leader>x";
|
||||
|
||||
Reference in New Issue
Block a user