[neovim] Adds configs. Auto-sessions doesn't load properly.

This commit is contained in:
2025-02-04 09:57:37 -08:00
parent cc6705d3b9
commit 6c1f099e12
7 changed files with 90 additions and 15 deletions

View File

@@ -29,19 +29,5 @@
inherit nixpkgs;
};
};
# nixosConfigurations.drew-desktop = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# modules = [
# ./configuration.nix
# ./hardware-configuration.nix
# inputs.home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.users.drew = import ./home-manager/drew.nix;
# home-manager.extraSpecialArgs = { inherit inputs; };
# }
# ];
# specialArgs = { inherit inputs; };
# };
};
}

View File

@@ -5,6 +5,7 @@
./features/shell.nix
./features/terminal.nix
./features/hyprland.nix
./features/neovim.nix
];
home.username = "drew";
@@ -14,7 +15,6 @@
home.packages = with pkgs; [
# Development
neovim
git
nix-prefetch-github

View File

@@ -0,0 +1,6 @@
include "%L"
<Multi_key> <g> <a> : "α"
<Multi_key> <g> <b> : "β"
<Multi_key> <g> <g> : "γ"
<Multi_key> <g> <p> : "π"

View File

@@ -0,0 +1,3 @@
set shiftwidth=4
set tabstop=4
set softtabstop=4

View File

@@ -0,0 +1 @@
require("periodic")

View File

@@ -0,0 +1,37 @@
vim.g.mapleader = ","
vim.cmd [[
colorscheme decay-dark
set autoindent
set expandtab
set smartindent
set shiftwidth=2
set tabstop=2
set softtabstop=2
filetype on
]]
-- Make sure sesssion options includes `localoptions` so that auto-sessions will start properly
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
local telescope = require('telescope.builtin')
vim.keymap.set("n", "<C-e>", "<cmd>RnvimrToggle<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-n>", "<cmd>TabNext<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-p>", telescope.find_files, { desc = "Telescope find files" })
vim.keymap.set("n", "<C-t>", telescope.buffers, { desc = "Telescope buffers" })
vim.filetype.add {
extension = {
rasi = 'rasi',
},
pattern = {
-- Some common config files and their types
['.*/waybar/config'] = 'jsonc',
['.*/mako/config'] = 'dosini',
['.*/kitty/*.conf'] = 'bash',
['.*/hypr/.*%.conf'] = 'hyprlang',
},
}

View File

@@ -0,0 +1,42 @@
{ pkgs, lib, ... }:
let
fromGitHub = repo: ref: rev: pkgs.vimUtils.buildVimPlugin {
pname = "${lib.strings.sanitizeDerivationName repo}";
version = ref;
src = builtins.fetchGit {
url = "https://github.com/${repo}.git";
ref = ref;
rev = rev;
};
};
in
{
home.file.".config/nvim" = {
source = ./config/neovim;
recursive = true;
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
nvim-treesitter
surround-nvim
telescope-nvim
plenary-nvim # dependency of telescope
rnvimr
(fromGitHub "decaycs/decay.nvim" "HEAD" "457014541ebcfb29bd660592a0b02f22c9e2d0e2")
auto-session
];
extraPackages = with pkgs; [
gcc # For treesitter complation
ripgrep # Search support
wayclip # Clipboard support
fd # finder for telescope
];
};
}