Compare commits

...

4 commits

Author SHA1 Message Date
Michael Flossmann
58fd3c46c4 add committia and none-ls 2024-08-22 09:55:47 +02:00
Michael Flossmann
eb07e46c21 add cosmetic changes to comments and keybindings 2024-08-22 09:55:44 +02:00
Michael Flossmann
aaf656431a add aerial 2024-08-22 09:54:35 +02:00
Michael Flossmann
4bdb8fdc60 edit the config structure to use modules rather than sets 2024-08-22 09:53:36 +02:00
16 changed files with 168 additions and 15 deletions

View file

@ -1,5 +1,24 @@
{
{lib, ...}:{
# TODO: Make colorscheme configurable
colorscheme = lib.mkOverride 500 "everforest";
colorschemes = {
kanagawa.enable = true;
nord.enable = true;
tokyonight = {
enable = true;
settings = {
style = "storm";
light_style = "day";
transparent = false;
};
};
everforest = {
enable = true;
settings = {
enable_italic = 1;
};
};
catppuccin = {
enable = true;
@ -8,6 +27,13 @@
# Needed to keep terminal transparency, if any
transparent_background = false;
styles = {
keywords = [ "italic" ];
conditionals = [ "italic" ];
functions = [ "italic" ];
loops = [ "italic" ];
};
};
};
};

View file

@ -9,5 +9,6 @@ let
)
(builtins.readDir ./.)
);
in
lib.mkMerge (map (file: import ./${file}) definitions)
in {
imports = map (file: import ./${file}) definitions;
}

View file

@ -1,4 +1,4 @@
{
_: {
keymaps =
(import ./buffers.nix)
++ (import ./diagnostics.nix)

View file

@ -1,7 +1,7 @@
# Neovim options
# Use :options to get the list of all options
# Use :h <option> to load help for given <option>
{
_:{
opts = {
# Don't stop backspace at insert
backspace.__raw = ''

View file

@ -0,0 +1,51 @@
{ lib, pkgs, ...}:
{
extra = {
packages = [
(import ./package.nix { inherit lib pkgs; })
];
config = ''
require("aerial").setup({
backends = { "lsp", "treesitter", "markdown", "man" },
layout = { min_width = 28, placement = "edge" },
show_guides = true,
filter_kind = false,
guides = {
mid_item = " ",
last_item = " ",
nested_top = " ",
whitespace = " ",
},
autojump = true,
keymaps = {
["[y"] = "actions.prev",
["]y"] = "actions.next",
["[Y"] = "actions.prev_up",
["]Y"] = "actions.next_up",
["{"] = false,
["}"] = false,
["[["] = false,
["]]"] = false,
},
attach_mode = "global",
})
'';
};
rootOpts.keymaps = [
{
mode = "n";
key = "<leader>lo";
action.__raw = ''function() require("aerial").toggle() end'';
options.desc = "Symbols outline";
}
{
mode = "n";
key = "<leader>fs";
action.__raw = ''require("telescope").extensions.aerial.aerial'';
options.desc = "Find symbols";
}
];
}

View file

@ -0,0 +1,21 @@
{ pkgs, ...}:
let
version = "2.1.0";
in
pkgs.vimUtils.buildVimPlugin {
inherit version;
name = "aerial";
# src = pkgs.fetchFromGitHub {
# owner = "stevearc";
# repo = "aerial.nvim";
# rev = "v${version}";
# hash = "sha256:0ip8xmncp82svlbkphlas88xjvzrpzyy5b1c9x06dqbm4ifai0va";
# };
src = builtins.fetchTarball {
url = "http://github.com/stevearc/aerial.nvim/archive/v2.1.0.tar.gz";
sha256 = "sha256:0ip8xmncp82svlbkphlas88xjvzrpzyy5b1c9x06dqbm4ifai0va";
};
}

View file

@ -11,6 +11,13 @@
leader_key = ';', -- Recommended to be a single key
buffer_leader_key = 'm', -- Per Buffer Mappings
})
-- prewritten for later
-- require("which-key").add({
-- {";", desc = "Arrow buffers"},
-- {"m", desc = "Arrow marks"}
-- })
'';
};
}

4
plugins/committia.nix Normal file
View file

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

View file

@ -8,7 +8,7 @@
# Config from AstroNvim
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/heirline.lua
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/heirline.lua
config = ''
config = /*lua*/ ''
local status = require("astroui.status")
require("heirline").setup({

View file

@ -36,10 +36,10 @@
action = "rename";
desc = "Rename current symbol";
};
"<leader>lR" = {
action = "rename";
desc = "Search references";
};
# "<leader>lR" = {
# action = "references";
# desc = "Search references";
# };
"<leader>lh" = {
action = "signature_help";
desc = "Signature help";

View file

@ -6,4 +6,19 @@ _:{
{ paths = "~/.config/snippets/"; }
];
};
rootOpts.keymaps = [
{
mode = "i";
key = "<C-g>";
action.__raw = ''function() require("luasnip").jump(1) end'';
options.desc = "Jump to next snippet node";
}
{
mode = "i";
key = "<C-h>";
action.__raw = ''function() require("luasnip").jump(-1) end'';
options.desc = "Jump to previous snippet node";
}
];
}

4
plugins/none-ls.nix Normal file
View file

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

View file

@ -104,7 +104,7 @@
}
{
desc = "Find words";
key = "<leader>fg";
key = "<leader>fw";
fn = "live_grep";
}
{
@ -147,15 +147,31 @@
key = "<leader>fC";
fn = "commands";
}
{
desc = "Find man";
key = "<leader>fm";
fn = "man_pages";
}
{
desc = "Find words in all files";
key = "<leader>fm";
fn = "live_grep";
args.additional_args.__raw = ''function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end'';
}
{
desc = "Find themes";
key = "<leader>ft";
fn = "colortheme";
fn = "colorscheme";
args = {
enable_preview = true;
ignore_builtins = true;
};
}
{
desc = "Search diagnostics";
key = "<leader>lD";
fn = "diagnostics";
}
];
};
}

View file

@ -8,7 +8,12 @@
enable = true;
# Enable treesitter based indentation (use '=' to auto-indent)
settings.indent.enable = true;
settings = {
indent.enable = true;
highlight = {
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
@ -33,7 +38,7 @@
}
{
mode = [ "n" "x" "o" ];
key = ";";
key = "-";
action.__raw = "function() require('nvim-treesitter.textobjects.repeatable_move').repeat_last_move_opposite() end";
options.desc = "Repeat last move in the opposite direction";
}

View file

@ -27,6 +27,8 @@
"<leader>s".name = "${icons.Session} Session";
"<leader>t".name = "${icons.Terminal} Terminal";
"<leader>u".name = "${icons.Window} UI/UX";
";".name = "Arrow buffers"; # This should move to arrow.nix when moving to which-key.add()
"m".name = "Arrow marks"; # This should move to arrow.nix when moving to which-key.add(
};
};

View file

@ -41,7 +41,8 @@
GitSign = "";
GitStaged = "";
GitUnstaged = "";
GitUntracked = "";
GitUntracked.__raw = "require('astroui').get_icon('GitUntracked')"; # TODO: this should be all the signs (or even a function)
# GitUntracked = "★";
LSPLoading1 = "";
LSPLoading2 = "󰀚";
LSPLoading3 = "";