| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- { inputs
- , pkgs
- , ...
- }:
- {
- imports = [
- inputs.nixvim.homeManagerModules.nixvim
- ./copilot.nix # copilot plugin
- ./lsp.nix
- ./mini.nix # mini.nvim plugin
- ./opencode.nix
- ./telescope.nix # fuzzy find everything
- ./treesitter.nix # treesitter support
- ./which-key.nix # keybinding helper
- ];
- home.packages = [ pkgs.zig ];
- programs.nixvim.plugins = {
- tmux-navigator.enable = true;
- todo-comments.enable = true; # todo comments eg TODO, FIXME, etc
- };
- programs.nixvim = {
- enable = true;
- defaultEditor = true;
- vimdiffAlias = true;
- extraPlugins = with pkgs; [
- vimPlugins.kanagawa-nvim
- ];
- extraConfigLua = ''
- require("kanagawa").setup({
- transparent = true,
- })
- vim.cmd.colorscheme("kanagawa")
- '';
- globals.mapleader = " ";
- globals.maplocalleader = " ";
- globals.have_nerd_font = true;
- clipboard.register = "unnamedplus";
- opts = {
- number = true;
- relativenumber = true;
- showmode = false;
- breakindent = true;
- undofile = true;
- ignorecase = true;
- smartcase = true;
- signcolumn = "yes";
- updatetime = 250;
- timeoutlen = 300;
- splitright = true;
- splitbelow = true;
- list = true;
- listchars = {
- tab = "» ";
- trail = "·";
- nbsp = "␣";
- };
- inccommand = "split";
- cursorline = true;
- scrolloff = 10;
- hlsearch = true;
- swapfile = false;
- backup = false;
- conceallevel = 1;
- laststatus = 3;
- cmdheight = 0;
- };
- autoCmd = [
- {
- event = "TextYankPost";
- desc = "Highlight when yanking (copying) text";
- group = "kickstart-highlight-yank";
- callback.__raw = ''
- function()
- vim.highlight.on_yank()
- end
- '';
- }
- ];
- autoGroups = {
- "kickstart-highlight-yank".clear = true;
- };
- keymaps = [
- {
- key = "<Esc>";
- action = "<cmd>nohlsearch<CR>";
- mode = "n";
- }
- # Diagnostic keymaps
- # { key = "<leader>q"; action.__raw = "vim.diagnostic.setloclist"; mode = "n"; options.desc = "Open diagnostic [Q]uickfix list"; }
- # Exit terminal mode in the builtin terminal
- # { key = "<Esc><Esc>"; action = "<C-\\><C-n>"; mode = "t"; option.desc = "Exit terminal mode"; }
- # Keybinds to make split navigation easier. TODO: figure out if these work
- {
- key = "<C-h>";
- action = "<C-w>h";
- mode = "n";
- options.desc = "Move focus to the left window";
- }
- {
- key = "<C-l>";
- action = "<C-w>l";
- mode = "n";
- options.desc = "Move focus to the right window";
- }
- {
- key = "<C-j>";
- action = "<C-w>j";
- mode = "n";
- options.desc = "Move focus to the lower window";
- }
- {
- key = "<C-k>";
- action = "<C-w>k";
- mode = "n";
- options.desc = "Move focus to the upper window";
- }
- # Move highlighed blocks of code up and down
- {
- key = "K";
- action = ":m '<-2<CR>gv=gv";
- mode = "v";
- options.desc = "Move highlighted block up";
- }
- {
- key = "J";
- action = ":m '>+1<CR>gv=gv";
- mode = "v";
- options.desc = "Move highlighted block down";
- }
- {
- key = "J";
- action = "mzJ`z";
- mode = "n";
- options.desc = "Join lines without losing cursor position";
- }
- {
- key = "<C-d>";
- action = "<C-d>zz";
- mode = "n";
- options.desc = "Scroll down and center cursor";
- }
- {
- key = "<C-u>";
- action = "<C-u>zz";
- mode = "n";
- options.desc = "Scroll up and center cursor";
- }
- {
- key = "n";
- action = "nzzzv";
- mode = "n";
- options.desc = "Find next and center cursor";
- }
- {
- key = "N";
- action = "Nzzzv";
- mode = "n";
- options.desc = "Find previous and center cursor";
- }
- ];
- };
- }
|