test
This commit is contained in:
parent
a258f29019
commit
3b9218b2b9
3 changed files with 9 additions and 183 deletions
|
@ -54,6 +54,13 @@
|
|||
# Fugitive
|
||||
(nmap "<leader>gc" ":Git commit -a<CR>" // desc "[C]ommit" )
|
||||
(nmap "<leader>gp" ":Git push<CR>" // desc "[P]ush")
|
||||
# Window Management
|
||||
(nmap "<leader>wh" "<C-w>" // desc "Move to left window")
|
||||
# (nmap "<leader>wl" "<GO_TO_RIGHT_WINDOW>" // desc "Move to right window")
|
||||
# (nmap "<leader>wj" "<GO_TO_LOWER_WINDOW>" // desc "Move to lower window")
|
||||
# (nmap "<leader>wk" "<GO_TO_UPPER_WINDOW>" // desc "Move to upper window")
|
||||
# (nmap "<leader>wc" "<CLOSE_CURRENT_WINDOW>" // desc "[C]lose active window")
|
||||
# (nmap "<leader>wn" "<OPEN_NEW_WINDOW>" // desc "Open [n]ew window")
|
||||
];
|
||||
|
||||
options = {
|
|
@ -1,143 +1,8 @@
|
|||
{ inputs, pkgs, config, lib, theme, ... }: {
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
] ++ lib.optional (builtins.isString theme) ../../../../stylix/${theme}/home-manager/nixvim.nix;
|
||||
imports = [ ./nixvim-base.nix ];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
globals.mapleader = " ";
|
||||
globals.maplocalleader = " ";
|
||||
|
||||
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" // silent)
|
||||
(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")
|
||||
# ToggleTerm
|
||||
(nmap "<leader>t" "<Nop>" // desc "[T]oggleTerm" // silent)
|
||||
(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 "[P]ush")
|
||||
];
|
||||
|
||||
options = {
|
||||
number = true;
|
||||
shiftwidth = 2;
|
||||
# Indent wrapped text.
|
||||
breakindent = true;
|
||||
colorcolumn = "100";
|
||||
showmode = false;
|
||||
};
|
||||
plugins = {
|
||||
# Parser generator tool
|
||||
treesitter.enable = true;
|
||||
# Snippet engine for neovim
|
||||
luasnip.enable = true;
|
||||
# Nix language syntax highlighting / file type associations
|
||||
nix.enable = true;
|
||||
# Run nix develop / shell without exiting vim
|
||||
nix-develop.enable = true;
|
||||
# tab bar like Firefox or Chrome
|
||||
bufferline.enable = true;
|
||||
# Popup to show shortcuts
|
||||
which-key.enable = true;
|
||||
# Automatic indent
|
||||
intellitab.enable = true;
|
||||
# Highlight all entries of the currently selected word
|
||||
illuminate.enable = true;
|
||||
# sidebar file browser
|
||||
nvim-tree.enable = true;
|
||||
# Gutter information for git modifications
|
||||
gitsigns.enable = true;
|
||||
# Terminal in vim
|
||||
toggleterm.enable = true;
|
||||
# Rainbow matching {} [] () 's
|
||||
rainbow-delimiters.enable = true;
|
||||
# Colorize hex colors inline
|
||||
nvim-colorizer.enable = true;
|
||||
# git plugin for vim
|
||||
fugitive.enable = true;
|
||||
|
||||
# Airline / Powerline alternative
|
||||
lualine = {
|
||||
enable = true;
|
||||
componentSeparators = {
|
||||
left = "|";
|
||||
right = "|";
|
||||
};
|
||||
};
|
||||
|
||||
telescope = {
|
||||
enable = true;
|
||||
extensions.fzf-native.enable = true;
|
||||
keymaps = {
|
||||
"<leader><leader>" = {
|
||||
action = "find_files";
|
||||
desc = "Search files by name";
|
||||
};
|
||||
"<leader>s" = {
|
||||
action = "live_grep";
|
||||
desc = "Search by live grep";
|
||||
};
|
||||
"<leader>b" = {
|
||||
action = "buffers";
|
||||
desc = "Search open [B]uffers by file name";
|
||||
};
|
||||
"<leader>h" = {
|
||||
action = "help_tags";
|
||||
desc = "Search [H]elp";
|
||||
};
|
||||
"<leader>w" = {
|
||||
action = "grep_string";
|
||||
desc = "Search for [W]ord under cursor";
|
||||
};
|
||||
"<leader>gs" = {
|
||||
action = "git_status";
|
||||
desc = "Search [G]it [S]tatus";
|
||||
};
|
||||
"<leader>r" = {
|
||||
action = "oldfiles";
|
||||
desc = "Search [R]ecently opened files by name";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
|
@ -205,52 +70,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
nvim-cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
mapping = {
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-e>" = "cmp.mapping.close()";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<S-Tab>" = {
|
||||
action = "cmp.mapping.select_prev_item()";
|
||||
modes = [
|
||||
"i"
|
||||
"s"
|
||||
];
|
||||
};
|
||||
"<Tab>" = {
|
||||
action = "cmp.mapping.select_next_item()";
|
||||
modes = [
|
||||
"i"
|
||||
"s"
|
||||
];
|
||||
};
|
||||
};
|
||||
sources = [
|
||||
{ name = "nvim_lua"; }
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
colorschemes = {
|
||||
tokyonight.enable = true;
|
||||
gruvbox.enable = true;
|
||||
catppuccin.enable = true;
|
||||
dracula.enable = true;
|
||||
oxocarbon.enable = true;
|
||||
|
||||
};
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
everforest
|
||||
onehalf
|
||||
rose-pine
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Common configs
|
||||
./common/software/cli/bash.nix
|
||||
./common/software/cli/git.nix
|
||||
./common/software/cli/nixvim-small.nix
|
||||
./common/software/cli/nixvim-base.nix
|
||||
./common/software/cli/ssh.nix
|
||||
./common/software/cli/btop.nix
|
||||
|
||||
|
|
Loading…
Reference in a new issue