Compare commits

..

10 commits

Author SHA1 Message Date
Michi Floßmann
e4255f0817 add arrow plugin 2024-08-01 16:15:05 +02:00
Michi Floßmann
8a72107a1d update nixvim 2024-07-13 14:25:39 +02:00
Michi Floßmann
5844802ff0 use the nixvim way of loading snippets 2024-07-13 13:57:41 +02:00
Michi Floßmann
fcf9336704 add a todo 2024-07-13 13:44:15 +02:00
Michi Floßmann
556f20bb3e add otter plugin 2024-07-13 13:38:56 +02:00
Michi Floßmann
0d6ddb5b6d add luasnip loader code 2024-07-13 13:38:40 +02:00
1ca9e8e016 add find keymaps 2024-07-13 11:14:17 +02:00
f76b553076 add keymaps 2024-07-13 08:37:22 +02:00
d49cf6e3ad fix telescope 2024-07-13 08:37:13 +02:00
f483bd632c edit the lsp config 2024-07-12 15:18:42 +02:00
10 changed files with 166 additions and 102 deletions

135
flake.lock generated
View file

@ -9,11 +9,11 @@
]
},
"locked": {
"lastModified": 1713532798,
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"lastModified": 1717408969,
"narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=",
"owner": "numtide",
"repo": "devshell",
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"rev": "1ebbe68d57457c8cae98145410b164b5477761f4",
"type": "github"
},
"original": {
@ -36,22 +36,6 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -60,11 +44,11 @@
]
},
"locked": {
"lastModified": 1715865404,
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=",
"lastModified": 1719877454,
"narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9",
"rev": "4e3583423212f9303aa1a6337f8dffb415920e4f",
"type": "github"
},
"original": {
@ -73,21 +57,6 @@
"type": "github"
}
},
"flake-root": {
"locked": {
"lastModified": 1713493429,
"narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=",
"owner": "srid",
"repo": "flake-root",
"rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -106,11 +75,41 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719259945,
"narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixvim",
"pre-commit-hooks",
"git-hooks",
"nixpkgs"
]
},
@ -136,11 +135,11 @@
]
},
"locked": {
"lastModified": 1716457508,
"narHash": "sha256-ZxzffLuWRyuMrkVVq7wastNUqeO0HJL9xqfY1QsYaqo=",
"lastModified": 1719827439,
"narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "850cb322046ef1a268449cf1ceda5fd24d930b05",
"rev": "59ce796b2563e19821361abbe2067c3bb4143a7d",
"type": "github"
},
"original": {
@ -157,11 +156,11 @@
]
},
"locked": {
"lastModified": 1716511055,
"narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=",
"lastModified": 1719845423,
"narHash": "sha256-ZLHDmWAsHQQKnmfyhYSHJDlt8Wfjv6SQhl2qek42O7A=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "0bea8222f6e83247dd13b055d83e64bce02ee532",
"rev": "ec12b88104d6c117871fad55e931addac4626756",
"type": "github"
},
"original": {
@ -194,11 +193,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1716509168,
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
"lastModified": 1720542800,
"narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
"rev": "feb2849fdeb70028c70d73b848214b00d324a497",
"type": "github"
},
"original": {
@ -213,21 +212,20 @@
"devshell": "devshell",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"git-hooks": "git-hooks",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1716759197,
"narHash": "sha256-I4r9krPVUl1b70VbC8j8xDQ2mDBoGCx8tH9CExiJMd8=",
"lastModified": 1720864742,
"narHash": "sha256-NVkF91eZPav7zbcMR+7mUzOdMKgIEBJSwtFU2rv1OpY=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "ba293d36403c39c22dbb9a928f9af4d0df54b79f",
"rev": "195978e6272702ea5d6e9b837d083c411dc5d688",
"type": "github"
},
"original": {
@ -268,33 +266,6 @@
"type": "gitlab"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1716213921,
"narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"nix-formatter-pack": "nix-formatter-pack",
@ -325,11 +296,11 @@
]
},
"locked": {
"lastModified": 1715940852,
"narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=",
"lastModified": 1719887753,
"narHash": "sha256-p0B2r98UtZzRDM5miGRafL4h7TwGRC4DII+XXHDHqek=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "2fba33a182602b9d49f0b2440513e5ee091d838b",
"rev": "bdb6355009562d8f9313d9460c0d3860f525bc6c",
"type": "github"
},
"original": {

16
plugins/arrow.nix Normal file
View file

@ -0,0 +1,16 @@
{ icons, pkgs, ... }:
{
opts.enable = true;
extra = {
packages = [ pkgs.vimPlugins.arrow-nvim ];
config = ''
require('arrow').setup({
show_icons = true,
leader_key = ';', -- Recommended to be a single key
buffer_leader_key = 'm', -- Per Buffer Mappings
})
'';
};
}

View file

@ -7,4 +7,19 @@ _:
enable = true;
settings.pre_hook = "require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()";
};
keymaps = [
{
key = "<leader>/";
action = "<Plug>(comment_toggle_linewise_current)";
options.desc = "Toggle comment line";
mode = "n";
}
{
key = "<leader>/";
action = "<Plug>(comment_toggle_linewise_visual)";
options.desc = "Toggle comment line";
mode = "v";
}
];
}

View file

@ -8,7 +8,7 @@
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/guess-indent.lua
config = ''
require("guess-indent").setup({})
vim.cmd.lua { args = { "require('guess-indent').set_from_buffer('auto_cmd')" }, mods = { silent = true } }
vim.cmd.lua { args = { "require('guess-indent').set_from_buffer()" }, mods = { silent = true } }
'';
};
}

View file

@ -32,7 +32,26 @@
action = "code_action";
desc = "LSP code action";
};
"<leader>lr" = {
action = "rename";
desc = "Rename current symbol";
};
"<leader>lR" = {
action = "rename";
desc = "Search references";
};
"<leader>lh" = {
action = "signature_help";
desc = "Signature help";
};
"<leader>lG" = {
action = "workspace_symbol";
desc = "Search workspace symbols";
};
"gK" = {
action = "signature_help";
desc = "Signature help";
};
gd = {
action = "definition";
desc = "Go to definition";
@ -80,25 +99,25 @@
# Load all servers definitions
servers = {
ansiblels.enable = true;
bashls.enable = true;
cssls.enable = true;
docker-compose-language-service.enable = true;
dockerls.enable = true;
eslint.enable = true;
gopls.enable = true;
helm-ls.enable = true;
html.enable = true;
java-language-server.enable = true;
jsonls.enable = true;
lua-ls.enable = true;
nginx-language-server.enable = true;
nixd.enable = true;
pyright.enable = true;
sqls.enable = true;
terraformls.enable = true;
tsserver.enable = true;
yamlls.enable = true;
clangd.enable = true;
marksman.enable = true;
texlab.enable = true;
java-language-server.enable = false;
zls.enable = false;
rust-analyzer.enable = false;
typos-lsp = {
enable = true;

View file

@ -1,3 +1,9 @@
_:{
opts.enable = true;
opts = {
enable = true;
fromLua = [
{ paths = "~/.config/snippets/"; }
];
};
}

View file

@ -1,3 +1,18 @@
_: {
opts.enable = true;
keymaps = [
{
key = "<leader>O";
action = "function() require('oil').toggle_float() end";
options.desc = "Toggle oil floating window";
mode = "n";
}
{
key = "<leader>to";
action = "function() require('oil').toggle_float() end";
options.desc = "Toggle oil floating window";
mode = "n";
}
];
}

3
plugins/otter.nix Normal file
View file

@ -0,0 +1,3 @@
_:{
opts.enable = true;
}

View file

@ -36,15 +36,15 @@
# │ └────────────────────────────────────────┘ │
# └──────────────────────────────────────────────────┘
extraConfigLuaPre = ''
local TelescopeWithTheme = function(fn, args, extension)
local telescopeWithArgs = function(fn, args, extension)
args.layout_config = {
anchor = "N",
mirror = true,
width = 0.8,
}
if fn == "keymaps" or fn == "registers" then args.layout_config.height = function(_, _, max_lines) return max_lines end end
local args_with_theme = require("telescope.themes").get_dropdown(args)
if extension ~= "" then
@ -55,7 +55,7 @@
end
'';
# Use root keymaps to allow usage of custom TelescopeWithTheme function
# Use root keymaps to allow usage of custom telescopeWithArgs function
keymaps =
let
mkTelescopeKeymap =
@ -68,7 +68,7 @@
}: {
inherit key mode;
action.__raw = "function() TelescopeWithTheme('${fn}', ${helpers.toLuaObject args}, '${builtins.toString extension}') end";
action.__raw = "function() telescopeWithArgs('${fn}', ${helpers.toLuaObject args}, '${builtins.toString extension}') end";
options = { inherit desc; };
};
in
@ -108,7 +108,7 @@
fn = "live_grep";
}
{
desc = "Find help tags";
desc = "Find help";
key = "<leader>fh";
fn = "help_tags";
}
@ -129,14 +129,33 @@
}
{
desc = "Find word under cursor";
key = "<leader>fw";
key = "<leader>f*";
fn = "grep_string";
}
{
desc = "Search references";
key = "gr";
key = "<leader>lR";
fn = "lsp_references";
}
{
desc = "Find marks";
key = "<leader>f'";
fn = "marks";
}
{
desc = "Find commands";
key = "<leader>fC";
fn = "commands";
}
{
desc = "Find themes";
key = "<leader>ft";
fn = "colortheme";
args = {
enable_preview = true;
ignore_builtins = true;
};
}
];
};
}

View file

@ -8,12 +8,12 @@
enable = true;
# Enable treesitter based indentation (use '=' to auto-indent)
indent = true;
settings.indent.enable = true;
# Workaround to enable incremental selection without setting default keymaps (keymaps are set globally)
# This is needed in order to set custom descriptions and avoid to have multiple keymaps
# See https://github.com/nix-community/nixvim/issues/1506
moduleConfig.incremental_selection = {
settings.incremental_selection = {
enable = true;
keymaps = lib.mkForce { };
};