nixos-configs/common/home/neovim/default.nix

117 lines
3 KiB
Nix
Raw Normal View History

2023-11-22 15:33:16 -05:00
{
config,
2023-11-22 15:33:16 -05:00
pkgs,
...
}: {
imports = [
./git.nix
./langs
./theme.nix
./treesitter.nix
];
programs = {
neovim = {
enable = true;
extraLuaConfig =
2024-06-09 22:49:30 -04:00
# lua
''
-- by default, the indent is 2 spaces.
vim.opt.smartindent = true;
vim.opt.expandtab = true;
vim.opt.shiftwidth = 2;
vim.opt.softtabstop = 2;
vim.opt.tabstop = 2;
vim.opt.number = true;
vim.opt.relativenumber = true;
vim.opt.undofile = true;
vim.opt.undodir = '${config.xdg.cacheHome}/nvim/';
2024-05-08 23:04:16 -04:00
-- Always show the signcolumn, otherwise it would shift
-- the text each time diagnostics appear/become resolved
vim.opt.signcolumn = 'yes';
-- remove highlight on words
2024-05-08 23:04:16 -04:00
vim.keymap.set('n', '<esc>', ':noh<cr><esc>', {
noremap = true,
silent = true,
});
-- Get rid of deprecated messages
vim.tbl_add_reverse_lookup = function(tbl)
for k, v in pairs(tbl) do
tbl[v] = k;
end
end;
vim.tbl_islist = function(tbl)
return vim.islist(tbl);
end;
vim.diagnostic.is_disabled = function()
return not vim.diagnostic.is_enabled();
end;
vim.lsp.buf_get_clients = function()
return vim.lsp.get_clients();
end;
vim.lsp.get_active_clients = function()
return vim.lsp.get_clients();
end;
'';
plugins = [
pkgs.vimPlugins.fzfWrapper
pkgs.vimPlugins.fzf-vim
{
plugin = pkgs.vimPlugins.todo-comments-nvim;
type = "lua";
config =
2024-06-09 22:49:30 -04:00
# lua
''
require('todo-comments').setup();
'';
}
{
plugin = pkgs.vimPlugins.mini-nvim;
type = "lua";
config =
2024-06-09 22:49:30 -04:00
# lua
''
-- TODO: see how this works
local ts_input = require('mini.surround').gen_spec.input.treesitter;
require('mini.surround').setup({
custom_surroundings = {
-- Use tree-sitter to search for function call
f = {
input = ts_input({
outer = '@call.outer',
inner = '@call.inner',
});
},
},
});
'';
}
2024-09-28 21:47:20 -04:00
{
plugin = pkgs.vimPlugins.nvim-config-local;
type = "lua";
config =
chore: update flake.lock Flake Inputs: • Updated input 'astal': 'github:Aylur/astal/9e63fe3' (2024-09-28) → 'github:Aylur/astal/f17b28d' (2024-09-29) • Updated input 'gpu-screen-recorder-src': 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=ebc8c69' (2024-09-27) → 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=0eb9ce0' (2024-09-29) • Updated input 'hyprland/hyprcursor': 'github:hyprwm/hyprcursor/912d560' (2024-08-02) → 'github:hyprwm/hyprcursor/b98726e' (2024-09-28) • Updated input 'nix-gaming': 'github:fufexan/nix-gaming/b9750ee' (2024-09-28) → 'github:fufexan/nix-gaming/6401744' (2024-09-29) • Updated input 'nix-gaming/umu': 'git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&ref=refs/heads/main&rev=e42043a&submodules=1' (2024-09-19) → 'git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&ref=refs/heads/main&rev=5cc1c3f&submodules=1' (2024-09-25) • Updated input 'nix-index-db': 'github:Mic92/nix-index-database/c7515c2' (2024-09-22) → 'github:Mic92/nix-index-database/a2ab158' (2024-09-29) • Updated input 'nixpkgs-wayland': 'github:nix-community/nixpkgs-wayland/811af6a' (2024-09-27) → 'github:nix-community/nixpkgs-wayland/206b2a2' (2024-09-29) • Updated input 'spotifyplus-src': 'github:thlucas1/homeassistantcomponent_spotifyplus/f017285' (2024-09-28) → 'github:thlucas1/homeassistantcomponent_spotifyplus/0765d55' (2024-09-29) Docker Images: • ghcr.io/linuxserver/radarr latest: sha256:1a50d4f08e283aa9ff4c723b940dceb4e8aeff7946e1993213efd0de3d5a4adb → sha256:d758c5a5edc4cda1263260948b3f460f511430bccea505dca3cb70af01332ff8
2024-09-29 16:31:31 -04:00
# lua
''
require('config-local').setup({
config_files = { '.nvim.lua', '.nvimrc', '.exrc' },
2024-09-28 21:47:20 -04:00
chore: update flake.lock Flake Inputs: • Updated input 'astal': 'github:Aylur/astal/9e63fe3' (2024-09-28) → 'github:Aylur/astal/f17b28d' (2024-09-29) • Updated input 'gpu-screen-recorder-src': 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=ebc8c69' (2024-09-27) → 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=0eb9ce0' (2024-09-29) • Updated input 'hyprland/hyprcursor': 'github:hyprwm/hyprcursor/912d560' (2024-08-02) → 'github:hyprwm/hyprcursor/b98726e' (2024-09-28) • Updated input 'nix-gaming': 'github:fufexan/nix-gaming/b9750ee' (2024-09-28) → 'github:fufexan/nix-gaming/6401744' (2024-09-29) • Updated input 'nix-gaming/umu': 'git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&ref=refs/heads/main&rev=e42043a&submodules=1' (2024-09-19) → 'git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&ref=refs/heads/main&rev=5cc1c3f&submodules=1' (2024-09-25) • Updated input 'nix-index-db': 'github:Mic92/nix-index-database/c7515c2' (2024-09-22) → 'github:Mic92/nix-index-database/a2ab158' (2024-09-29) • Updated input 'nixpkgs-wayland': 'github:nix-community/nixpkgs-wayland/811af6a' (2024-09-27) → 'github:nix-community/nixpkgs-wayland/206b2a2' (2024-09-29) • Updated input 'spotifyplus-src': 'github:thlucas1/homeassistantcomponent_spotifyplus/f017285' (2024-09-28) → 'github:thlucas1/homeassistantcomponent_spotifyplus/0765d55' (2024-09-29) Docker Images: • ghcr.io/linuxserver/radarr latest: sha256:1a50d4f08e283aa9ff4c723b940dceb4e8aeff7946e1993213efd0de3d5a4adb → sha256:d758c5a5edc4cda1263260948b3f460f511430bccea505dca3cb70af01332ff8
2024-09-29 16:31:31 -04:00
-- Where the plugin keeps files data
hashfile = '${config.xdg.cacheHome}/nvim/config-local',
});
'';
2024-09-28 21:47:20 -04:00
}
];
};
2023-07-19 21:52:35 -04:00
};
}