feat: add rust error explanation binding
This commit is contained in:
parent
3c9a9d42cf
commit
a641d4fafe
4 changed files with 135 additions and 115 deletions
8
home-manager/stvnliu/nixvim/custom/binds.nix
Normal file
8
home-manager/stvnliu/nixvim/custom/binds.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ree";
|
||||
action = "<CMD>RustLsp explainError<CR>";
|
||||
options.desc = "Explain this Rust error (custom)";
|
||||
}
|
||||
]
|
|
@ -26,125 +26,127 @@
|
|||
defaultEditor = true;
|
||||
globals.mapleader = " ";
|
||||
colorschemes.gruvbox = {enable = true;};
|
||||
keymaps = [
|
||||
# Global
|
||||
# Default mode is "" which means normal-visual-op
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bg";
|
||||
action = "<CMD>TransparentToggle<CR>";
|
||||
options.desc = "Toggle background transparency";
|
||||
}
|
||||
{
|
||||
key = "<C-n>";
|
||||
action = "<CMD>NvimTreeToggle<CR>";
|
||||
options.desc = "Toggle NvimTree";
|
||||
}
|
||||
keymaps =
|
||||
[
|
||||
# Global
|
||||
# Default mode is "" which means normal-visual-op
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bg";
|
||||
action = "<CMD>TransparentToggle<CR>";
|
||||
options.desc = "Toggle background transparency";
|
||||
}
|
||||
{
|
||||
key = "<C-n>";
|
||||
action = "<CMD>NvimTreeToggle<CR>";
|
||||
options.desc = "Toggle NvimTree";
|
||||
}
|
||||
|
||||
# File
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>f";
|
||||
action = "+find/file";
|
||||
}
|
||||
{
|
||||
# Format file
|
||||
key = "<leader>fm";
|
||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||
options.desc = "Format the current buffer";
|
||||
}
|
||||
# File
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>f";
|
||||
action = "+find/file";
|
||||
}
|
||||
{
|
||||
# Format file
|
||||
key = "<leader>fm";
|
||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||
options.desc = "Format the current buffer";
|
||||
}
|
||||
|
||||
# Git
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>g";
|
||||
action = "+git";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gt";
|
||||
action = "+toggles";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtb";
|
||||
action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
|
||||
options.desc = "Gitsigns current line blame";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtd";
|
||||
action = "<CMD>Gitsigns toggle_deleted";
|
||||
options.desc = "Gitsigns deleted";
|
||||
}
|
||||
{
|
||||
key = "<leader>gd";
|
||||
action = "<CMD>Gitsigns diffthis<CR>";
|
||||
options.desc = "Gitsigns diff this buffer";
|
||||
}
|
||||
# Git
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>g";
|
||||
action = "+git";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gt";
|
||||
action = "+toggles";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtb";
|
||||
action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
|
||||
options.desc = "Gitsigns current line blame";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtd";
|
||||
action = "<CMD>Gitsigns toggle_deleted";
|
||||
options.desc = "Gitsigns deleted";
|
||||
}
|
||||
{
|
||||
key = "<leader>gd";
|
||||
action = "<CMD>Gitsigns diffthis<CR>";
|
||||
options.desc = "Gitsigns diff this buffer";
|
||||
}
|
||||
|
||||
# Tabs
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>t";
|
||||
action = "+tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tn";
|
||||
action = "<CMD>tabnew<CR>";
|
||||
options.desc = "Create new tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>td";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
options.desc = "Close tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ts";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
options.desc = "Go to the sub-sequent tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tp";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
options.desc = "Go to the previous tab";
|
||||
}
|
||||
# Tabs
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>t";
|
||||
action = "+tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tn";
|
||||
action = "<CMD>tabnew<CR>";
|
||||
options.desc = "Create new tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>td";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
options.desc = "Close tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ts";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
options.desc = "Go to the sub-sequent tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tp";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
options.desc = "Go to the previous tab";
|
||||
}
|
||||
|
||||
# Terminal
|
||||
{
|
||||
# Escape terminal mode using ESC
|
||||
mode = "t";
|
||||
key = "<esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
options.desc = "Escape terminal mode";
|
||||
}
|
||||
# Terminal
|
||||
{
|
||||
# Escape terminal mode using ESC
|
||||
mode = "t";
|
||||
key = "<esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
options.desc = "Escape terminal mode";
|
||||
}
|
||||
|
||||
# Trouble
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d";
|
||||
action = "+diagnostics/debug";
|
||||
}
|
||||
{
|
||||
key = "<leader>dt";
|
||||
action = "<CMD>TroubleToggle<CR>";
|
||||
options.desc = "Toggle trouble";
|
||||
}
|
||||
# Trouble
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d";
|
||||
action = "+diagnostics/debug";
|
||||
}
|
||||
{
|
||||
key = "<leader>dt";
|
||||
action = "<CMD>TroubleToggle<CR>";
|
||||
options.desc = "Toggle trouble";
|
||||
}
|
||||
|
||||
# Rust
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>r";
|
||||
action = "+rust";
|
||||
}
|
||||
{
|
||||
# Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
|
||||
mode = "n";
|
||||
key = "<leader>rs";
|
||||
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
||||
options.desc = "Start standalone rust-analyzer";
|
||||
}
|
||||
];
|
||||
# Rust
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>r";
|
||||
action = "+rust";
|
||||
}
|
||||
{
|
||||
# Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
|
||||
mode = "n";
|
||||
key = "<leader>rs";
|
||||
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
||||
options.desc = "Start standalone rust-analyzer";
|
||||
}
|
||||
]
|
||||
++ (import ./custom/binds.nix);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
imports = [
|
||||
../common/variables.nix
|
||||
./greetd.nix
|
||||
#./ly.nix
|
||||
./bootloader.nix
|
||||
./nvidia.nix
|
||||
./fonts.nix
|
||||
|
|
9
nixos/ly.nix
Normal file
9
nixos/ly.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
services.displayManager.ly = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue