This commit is contained in:
albert 2024-04-02 18:23:07 +09:00
parent 26bf52b112
commit bdf869a2e3
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
5 changed files with 98 additions and 86 deletions

View file

@ -43,6 +43,13 @@ nix develop -c /etc/nixos/git/docs/setup.sh
--- ---
# To Do List # To Do List
* [ ] fixes
* fix vim theming in tmux
* change tmux bracket angles
* change vim bracket angles
* find a better sidebar for vim
* try the outliner tool again for vim
## Host Specific ## Host Specific
### framework-server ### framework-server
* [ ] Try this https://www.ntop.org/products/traffic-analysis/ntop/ * [ ] Try this https://www.ntop.org/products/traffic-analysis/ntop/

View file

@ -37,7 +37,7 @@
GPG_TTY=$(tty) GPG_TTY=$(tty)
EDITOR=vim EDITOR=vim
ssh-add > /dev/null &> /dev/null ssh-add > /dev/null &> /dev/null
[ -z "$TMUX" ] && { tmux attach || exec tmux new-session && exit;} # [ -z "$TMUX" ] && { tmux attach || exec tmux new-session && exit;}
''; '';
sessionVariables = { sessionVariables = {
# Set the GTK Theme # Set the GTK Theme

View file

@ -1,6 +1,7 @@
{ inputs, pkgs, lib, theme, ... }: { { inputs, pkgs, lib, theme, ... }: {
imports = [ imports = [
./alpha.nix ./alpha.nix
./keymaps.nix
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
] ++ lib.optional (builtins.isString theme) ../../../../../stylix/themes/${theme}/home-manager/nixvim.nix; ] ++ lib.optional (builtins.isString theme) ../../../../../stylix/themes/${theme}/home-manager/nixvim.nix;
@ -25,88 +26,9 @@
breakindent = true; breakindent = true;
colorcolumn = "100"; colorcolumn = "100";
showmode = false; showmode = false;
termguicolors = true;
}; };
keymaps = let
map = mode: key: action: { mode = mode; key = key; action = action; };
nmap = key: action: map [ "n" ] key action;
nvmap = key: action: map [ "n" "v" ] key action;
# imap = key: action: map [ "i" ] key action;
desc = d: { options.desc = d; };
silent = { options.silent = true; };
expr = { options.expr = true; };
in [
# Unmap keys that aren't useful, or that we want to use for different things
(nvmap "<Space>" "<Nop>" // silent)
(nvmap "<Cr>" "<Nop>" // silent)
(nvmap "s" "<Nop>" // silent)
# Redo
(nmap "R" "<C-r>")
# Copy and paste
(nvmap "<leader>y" "\"+y" // desc "Cop[y] to clipboard")
(nvmap "<leader>p" "\"+p" // desc "[P]aste from clipboard")
# Jump to start/end of line
(nvmap "H" "0")
(nvmap "L" "$")
# Navigate up and down word wrapped text as if it were not word wrapped
(nmap "k" "v:count == 0 ? 'gk' : 'k'" // silent // expr)
(nmap "j" "v:count == 0 ? 'gj' : 'j'" // silent // expr)
# Center cursor when jumping foward or back
(nmap "<C-o>" "<C-o>zz")
(nmap "<C-i>" "<C-i>zz")
# Insert Mode
# Normal Mode
# NVimTree
(nmap "<leader>n" "<Nop>" // desc "[N]vimTree")
(nmap "<leader>nf" ":NvimTreeFocus<CR>" // desc "[F]ocus NvimTree")
(nmap "<leader>nt" ":NvimTreeToggle<CR>" // desc "[T]oggle NvimTree")
(nmap "<leader>ns" ":NvimTreeFindFile<CR>"// desc "[S]earch NvimTree")
(nmap "<leader>nc" ":NvimTreeClose<CR>" // desc "[C]lose NvimTree")
(nmap "<leader>nr" ":NvimTreeRefresh<CR>" // desc "[R]efresh NvimTree")
(nmap "<leader>nT" ":NoiceTelescope<CR>" // desc "Noice [T]elescope")
# ToggleTerm
(nmap "<leader>Tt" ":ToggleTerm<CR>" // desc "[T]oggle Terminal")
(nmap "<leader>Ts" ":TermSelect<CR>" // desc "[S]elect a terminal")
# Fugitive
(nmap "<leader>gc" ":Git cam \"" // desc "[C]ommit" )
(nmap "<leader>gp" ":Git push<CR>" // desc "Git [p]ush")
(nmap "<leader>gP" ":Git pull<CR>" // desc "[P]ull")
(nmap "<leader>ga" ":Git add " // desc "[A]dd file...")
(nmap "<leader>gb" ":Git blame<CR>" // desc "[B]lame")
(nmap "<leader>gd" ":Git diff<CR>" // desc "[D]iff")
# Trouble
(nmap "<leader>tf" ":Trouble<CR>" // desc "[F]ocus")
(nmap "<leader>tt" ":TroubleToggle<CR>" // desc "[T]oggle")
(nmap "<leader>tc" ":TroubleClose<CR>" // desc "[C]lose")
# Navbuddy
(nmap "<leader>N" ":Navbuddy<CR>" // desc "[N]avbuddy")
# Window Management
(nmap "<leader>wh" ":wincmd h<CR>" // desc "Move left")
(nmap "<leader>wl" ":wincmd l<CR>" // desc "Move right")
(nmap "<leader>wj" ":wincmd j<CR>" // desc "Move down")
(nmap "<leader>wk" ":wincmd k<CR>" // desc "Move up")
(nmap "<leader>wn" ":wincmd w<CR>" // desc "Move to next")
(nmap "<leader>wN" ":wincmd p<CR>" // desc "Move to previous")
(nmap "<leader>wc" ":wincmd c<CR>" // desc "[C]lose active window")
(nmap "<leader>woh" ":wincmd n<CR>" // desc "Open [H]orizontal window")
(nmap "<leader>wov" ":wincmd v<CR>" // desc "Open [V]ertical window")
# 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")
(nmap "<leader>bt" ":enew<CR>" // desc "New [T]ab")
# Multicursors
(nmap "<leader>ms" ":MCstart<CR>" // desc "[S]tart Multicorsor")
(nmap "<leader>mv" ":MCvisual<CR>" // desc "[V]isual Multicorsor")
(nmap "<leader>mc" ":MCclear<CR>" // desc "[C]lear Multicorsor")
(nmap "<leader>mu" ":MCunderCursor<CR>" // desc "Select [U]nder Corsor")
(nmap "<leader>mp" ":MCpattern<CR>" // desc "Select [P]attern")
];
plugins = { plugins = {
# Testing # Testing
noice = { noice = {
@ -335,12 +257,13 @@
catppuccin.enable = true; catppuccin.enable = true;
dracula.enable = true; dracula.enable = true;
oxocarbon.enable = true; oxocarbon.enable = true;
ayu.enable = true;
kanagawa.enable = true;
}; };
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
awesome-vim-colorschemes
everforest everforest
onehalf onedark-nvim
rose-pine rose-pine
melange-nvim melange-nvim
]; ];

View file

@ -0,0 +1,82 @@
{ ... }: {
programs.nixvim.keymaps =
let
map = mode: key: action: { mode = mode; key = key; action = action; };
nmap = key: action: map [ "n" ] key action;
nvmap = key: action: map [ "n" "v" ] key action;
# imap = key: action: map [ "i" ] key action;
desc = d: { options.desc = d; };
silent = { options.silent = true; };
expr = { options.expr = true; };
in [
# Unmap keys that aren't useful, or that we want to use for different things
(nvmap "<Space>" "<Nop>" // silent)
(nvmap "<Cr>" "<Nop>" // silent)
(nvmap "s" "<Nop>" // silent)
# Redo
(nmap "R" "<C-r>")
# Copy and paste
(nvmap "<leader>y" "\"+y" // desc "Cop[y] to clipboard")
(nvmap "<leader>p" "\"+p" // desc "[P]aste from clipboard")
# Jump to start/end of line
(nvmap "H" "0")
(nvmap "L" "$")
# Navigate up and down word wrapped text as if it were not word wrapped
(nmap "k" "v:count == 0 ? 'gk' : 'k'" // silent // expr)
(nmap "j" "v:count == 0 ? 'gj' : 'j'" // silent // expr)
# Center cursor when jumping foward or back
(nmap "<C-o>" "<C-o>zz")
(nmap "<C-i>" "<C-i>zz")
# Insert Mode
# Normal Mode
# NVimTree
(nmap "<leader>n" "<Nop>" // desc "[N]vimTree")
(nmap "<leader>nf" ":NvimTreeFocus<CR>" // desc "[F]ocus NvimTree")
(nmap "<leader>nt" ":NvimTreeToggle<CR>" // desc "[T]oggle NvimTree")
(nmap "<leader>ns" ":NvimTreeFindFile<CR>"// desc "[S]earch NvimTree")
(nmap "<leader>nc" ":NvimTreeClose<CR>" // desc "[C]lose NvimTree")
(nmap "<leader>nr" ":NvimTreeRefresh<CR>" // desc "[R]efresh NvimTree")
(nmap "<leader>nT" ":NoiceTelescope<CR>" // desc "Noice [T]elescope")
# ToggleTerm
(nmap "<leader>Tt" ":ToggleTerm<CR>" // desc "[T]oggle Terminal")
(nmap "<leader>Ts" ":TermSelect<CR>" // desc "[S]elect a terminal")
# Fugitive
(nmap "<leader>gc" ":Git cam \"" // desc "[C]ommit" )
(nmap "<leader>gp" ":Git push<CR>" // desc "Git [p]ush")
(nmap "<leader>gP" ":Git pull<CR>" // desc "[P]ull")
(nmap "<leader>ga" ":Git add " // desc "[A]dd file...")
(nmap "<leader>gb" ":Git blame<CR>" // desc "[B]lame")
(nmap "<leader>gd" ":Git diff<CR>" // desc "[D]iff")
# Trouble
(nmap "<leader>tf" ":Trouble<CR>" // desc "[F]ocus")
(nmap "<leader>tt" ":TroubleToggle<CR>" // desc "[T]oggle")
(nmap "<leader>tc" ":TroubleClose<CR>" // desc "[C]lose")
# Navbuddy
(nmap "<leader>N" ":Navbuddy<CR>" // desc "[N]avbuddy")
# Window Management
(nmap "<leader>wh" ":wincmd h<CR>" // desc "Move left")
(nmap "<leader>wl" ":wincmd l<CR>" // desc "Move right")
(nmap "<leader>wj" ":wincmd j<CR>" // desc "Move down")
(nmap "<leader>wk" ":wincmd k<CR>" // desc "Move up")
(nmap "<leader>wn" ":wincmd w<CR>" // desc "Move to next")
(nmap "<leader>wN" ":wincmd p<CR>" // desc "Move to previous")
(nmap "<leader>wc" ":wincmd c<CR>" // desc "[C]lose active window")
(nmap "<leader>woh" ":wincmd n<CR>" // desc "Open [H]orizontal window")
(nmap "<leader>wov" ":wincmd v<CR>" // desc "Open [V]ertical window")
# 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")
(nmap "<leader>bt" ":enew<CR>" // desc "New [T]ab")
# Multicursors
(nmap "<leader>ms" ":MCstart<CR>" // desc "[S]tart Multicorsor")
(nmap "<leader>mv" ":MCvisual<CR>" // desc "[V]isual Multicorsor")
(nmap "<leader>mc" ":MCclear<CR>" // desc "[C]lear Multicorsor")
(nmap "<leader>mu" ":MCunderCursor<CR>" // desc "Select [U]nder Corsor")
(nmap "<leader>mp" ":MCpattern<CR>" // desc "Select [P]attern")
];
}

View file

@ -8,7 +8,7 @@
{ {
plugin = power-theme; plugin = power-theme;
extraConfig = '' extraConfig = ''
set -g @tmux_power_theme '#${config.lib.stylix.colors.base06}' set -g @tmux_power_theme '#${config.lib.stylix.colors.base05}'
set -g @tmux_power_right_arrow_icon ' ' set -g @tmux_power_right_arrow_icon ' '
set -g @tmux_power_left_arrow_icon ' ' set -g @tmux_power_left_arrow_icon ' '
set -g @tmux_power_prefix_highlight_pos 'R' set -g @tmux_power_prefix_highlight_pos 'R'
@ -29,8 +29,8 @@
extraConfig = '' extraConfig = ''
bind | split-window -h bind | split-window -h
bind - split-window -v bind - split-window -v
bind n swap-window -t +1 bind n next-window
bind N swap-window -t -1 bind N previous-window
''; '';
}; };
} }