add cosmetic changes to comments and keybindings

This commit is contained in:
Michael Flossmann 2024-08-22 09:55:21 +02:00 committed by prunebutt
parent 55008ce528
commit 7e67b345e9
8 changed files with 68 additions and 33 deletions

View file

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

View file

@ -8,7 +8,7 @@
# Config from AstroNvim # 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/heirline.lua
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/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") local status = require("astroui.status")
require("heirline").setup({ require("heirline").setup({

View file

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

View file

@ -6,4 +6,19 @@ _:{
{ paths = "~/.config/snippets/"; } { 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";
}
];
} }

View file

@ -104,7 +104,7 @@
} }
{ {
desc = "Find words"; desc = "Find words";
key = "<leader>fg"; key = "<leader>fw";
fn = "live_grep"; fn = "live_grep";
} }
{ {
@ -147,15 +147,31 @@
key = "<leader>fC"; key = "<leader>fC";
fn = "commands"; 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"; desc = "Find themes";
key = "<leader>ft"; key = "<leader>ft";
fn = "colortheme"; fn = "colorscheme";
args = { args = {
enable_preview = true; enable_preview = true;
ignore_builtins = true; ignore_builtins = true;
}; };
} }
{
desc = "Search diagnostics";
key = "<leader>lD";
fn = "diagnostics";
}
]; ];
}; };
} }

View file

@ -8,7 +8,12 @@
enable = true; enable = true;
# Enable treesitter based indentation (use '=' to auto-indent) # 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) # 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 # This is needed in order to set custom descriptions and avoid to have multiple keymaps
@ -35,7 +40,7 @@
} }
{ {
mode = [ "n" "x" "o" ]; mode = [ "n" "x" "o" ];
key = ";"; key = "-";
action.__raw = "function() require('nvim-treesitter.textobjects.repeatable_move').repeat_last_move_opposite() end"; action.__raw = "function() require('nvim-treesitter.textobjects.repeatable_move').repeat_last_move_opposite() end";
options.desc = "Repeat last move in the opposite direction"; options.desc = "Repeat last move in the opposite direction";
} }

View file

@ -9,29 +9,20 @@
# Disable which-key when in neo-tree or telescope # Disable which-key when in neo-tree or telescope
settings = { # Customize section names (prefixed mappings)
icons.group = ""; registrations = {
window.border = "single"; "<leader>b".name = "${icons.Tab} Buffers";
"<leader>bs".name = "${icons.Sort} Sort Buffers";
# Customize section names (prefixed mappings) "<leader>d".name = "${icons.Debugger} Debugger";
spec = [ "<leader>f".name = "${icons.Search} Find";
{ __unkeyed = "<leader>b"; group = "Buffers"; icon = icons.Tab; } "<leader>g".name = "${icons.Git} Git";
{ __unkeyed = "<leader>bs"; group = "Sort Buffers"; icon = icons.Sort;} "<leader>l".name = "${icons.ActiveLSP} Language Tools";
{ __unkeyed = "<leader>d"; group = "Debugger"; icon = icons.Debugger;} "<leader>m".name = " Markdown";
{ __unkeyed = "<leader>f"; group = "Find"; icon = icons.Search;} "<leader>s".name = "${icons.Session} Session";
{ __unkeyed = "<leader>g"; group = "Git"; icon = icons.Git;} "<leader>t".name = "${icons.Terminal} Terminal";
{ __unkeyed = "<leader>l"; group = "Language Tools"; icon = icons.ActiveLSP;} "<leader>u".name = "${icons.Window} UI/UX";
{ __unkeyed = "<leader>m"; group = " Markdown"; } ";".name = "Arrow buffers"; # This should move to arrow.nix when moving to which-key.add()
{ __unkeyed = "<leader>s"; group = "Session"; icon = icons.Session;} "m".name = "Arrow marks"; # This should move to arrow.nix when moving to which-key.add(
{ __unkeyed = "<leader>t"; group = "Terminal"; icon = icons.Terminal;}
{ __unkeyed = "<leader>u"; group = "UI/UX"; icon = icons.Window;}
];
disable.ft = [
"TelescopePrompt"
"neo-tree"
"neo-tree-popup"
];
}; };

View file

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