Rearrange things, add Trouble

This commit is contained in:
albert 2024-02-16 15:39:00 +09:00
parent 38ad6b83b6
commit 7eaf833957
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
2 changed files with 22 additions and 15 deletions

View file

@ -1,4 +1,4 @@
{ inputs, pkgs, config, lib, theme, ... }: {
{ inputs, pkgs, lib, theme, ... }: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
] ++ lib.optional (builtins.isString theme) ../../../../stylix/${theme}/home-manager/nixvim.nix;
@ -15,6 +15,15 @@
globals.mapleader = " ";
globals.maplocalleader = " ";
options = {
number = true;
shiftwidth = 2;
breakindent = true;
colorcolumn = "100";
showmode = false;
termguicolors = true;
};
keymaps = let
map = mode: key: action: { mode = mode; key = key; action = action; };
nmap = key: action: map [ "n" ] key action;
@ -53,12 +62,15 @@
(nmap "<leader>ns" ":NvimTreeFindFile<CR>" // desc "[S]earch NvimTree")
(nmap "<leader>nc" ":NvimTreeClose<CR>" // desc "[C]lose NvimTree")
# ToggleTerm
(nmap "<leader>t" "<Nop>" // desc "[T]oggleTerm")
(nmap "<leader>tt" ":ToggleTerm<CR>" // desc "[T]oggle Terminal")
(nmap "<leader>TT" ":ToggleTerm<CR>" // desc "[T]oggle Terminal")
# Fugitive
(nmap "<leader>gc" ":Git commit -a<CR>" // desc "[C]ommit" )
(nmap "<leader>gp" ":Git push<CR>" // desc "Git [p]ush")
(nmap "<leader>gP" ":Git pull<CR>" // desc "[P]ull")
# Trouble
(nmap "<leader>tt" ":TroubleToggle<CR>" // desc "[T]oggle")
(nmap "<leader>tc" ":TroubleClose<CR>" // desc "[C]lose")
# Window Management
(nmap "<leader>wh" ":wincmd h<CR>" // desc "Move left")
(nmap "<leader>wl" ":wincmd l<CR>" // desc "Move right")
@ -72,20 +84,12 @@
# resize window
(nmap "<leader>wrh" ":resize " // desc "Resize Horizontal")
(nmap "<leader>wrv" ":vertical resize " // desc "Resize Vertical")
# Buffer Management
(nmap "<leader>bn" ":bnext<CR>" // desc "Next buffer")
(nmap "<leader>bN" ":bNext<CR>" // desc "Previous buffer")
(nmap "<leader>bc" ":bdelete<CR>" // desc "[c]lose buffer")
];
options = {
number = true;
shiftwidth = 2;
breakindent = true;
colorcolumn = "100";
showmode = false;
};
plugins = {
# Parser generator tool
treesitter.enable = true;
@ -115,6 +119,8 @@
nvim-colorizer.enable = true;
# git plugin for vim
fugitive.enable = true;
# Alerts / CodActions
trouble.enable = true;
# Popup to show shortcuts
which-key = {
@ -125,7 +131,8 @@
"<leader>g" = "Git Options...";
"<leader>l" = "LSP Options...";
"<leader>n" = "NvimTree...";
"<leader>t" = "ToggleTerm...";
"<leader>t" = "Trouble...";
"<leader>T" = "ToggleTerm...";
"<leader>w" = "Manage Windows...";
"<leader>wo" = "Open New...";
"<leader>wr" = "Resize...";
@ -136,8 +143,8 @@
lualine = {
enable = true;
componentSeparators = {
left = "|";
right = "|";
left = "«";
right = "»";
};
};

View file

@ -1,4 +1,4 @@
{ inputs, pkgs, config, lib, theme, ... }: {
{ ... }: {
imports = [ ./nixvim-base.nix ];
programs.nixvim = {