From 7eaf8339572488923f1f376e9aa354f41e5ea9d8 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 16 Feb 2024 15:39:00 +0900 Subject: [PATCH] Rearrange things, add Trouble --- .../common/software/cli/nixvim-base.nix | 35 +++++++++++-------- home-manager/common/software/cli/nixvim.nix | 2 +- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/home-manager/common/software/cli/nixvim-base.nix b/home-manager/common/software/cli/nixvim-base.nix index 915a8925..2f08d518 100644 --- a/home-manager/common/software/cli/nixvim-base.nix +++ b/home-manager/common/software/cli/nixvim-base.nix @@ -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 "ns" ":NvimTreeFindFile" // desc "[S]earch NvimTree") (nmap "nc" ":NvimTreeClose" // desc "[C]lose NvimTree") # ToggleTerm - (nmap "t" "" // desc "[T]oggleTerm") - (nmap "tt" ":ToggleTerm" // desc "[T]oggle Terminal") + (nmap "TT" ":ToggleTerm" // desc "[T]oggle Terminal") # Fugitive (nmap "gc" ":Git commit -a" // desc "[C]ommit" ) (nmap "gp" ":Git push" // desc "Git [p]ush") (nmap "gP" ":Git pull" // desc "[P]ull") + # Trouble + (nmap "tt" ":TroubleToggle" // desc "[T]oggle") + (nmap "tc" ":TroubleClose" // desc "[C]lose") + # Window Management (nmap "wh" ":wincmd h" // desc "Move left") (nmap "wl" ":wincmd l" // desc "Move right") @@ -72,20 +84,12 @@ # resize window (nmap "wrh" ":resize " // desc "Resize Horizontal") (nmap "wrv" ":vertical resize " // desc "Resize Vertical") - # Buffer Management (nmap "bn" ":bnext" // desc "Next buffer") (nmap "bN" ":bNext" // desc "Previous buffer") (nmap "bc" ":bdelete" // 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 @@ "g" = "Git Options..."; "l" = "LSP Options..."; "n" = "NvimTree..."; - "t" = "ToggleTerm..."; + "t" = "Trouble..."; + "T" = "ToggleTerm..."; "w" = "Manage Windows..."; "wo" = "Open New..."; "wr" = "Resize..."; @@ -136,8 +143,8 @@ lualine = { enable = true; componentSeparators = { - left = "|"; - right = "|"; + left = "«"; + right = "»"; }; }; diff --git a/home-manager/common/software/cli/nixvim.nix b/home-manager/common/software/cli/nixvim.nix index 2e057e22..2bf0a58d 100644 --- a/home-manager/common/software/cli/nixvim.nix +++ b/home-manager/common/software/cli/nixvim.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, config, lib, theme, ... }: { +{ ... }: { imports = [ ./nixvim-base.nix ]; programs.nixvim = {