omniflake/home/nvim/default.nix
2026-01-30 12:35:40 +01:00

165 lines
4.1 KiB
Nix

{ pkgs, ... }:
{
home.packages = with pkgs; [
astro-language-server
marksman
nil
typescript-language-server
];
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
extraConfig = builtins.readFile ./config.vim;
plugins = with pkgs.vimPlugins;
[
cmp-buffer
cmp-cmdline
cmp-emoji
cmp-nvim-lsp
cmp-nvim-ultisnips
cmp-path
{
plugin = fzf-vim;
type = "lua";
config = ''
vim.api.nvim_set_keymap('n', '<leader><tab>', ':Buffers<return>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<c-x><c-f>', '<Plug>(fzf-complete-path)', { silent = true })
vim.api.nvim_set_keymap('n', '<leader>o', ':Files<return>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>O', ':Files ~/', { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>r', ':Read<return>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>R', ':Read ~/', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>a', ':Ag<return>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>A', ':Ag ~/', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>.', ':Files ~/devel/omniflake/<return>', { noremap = true, silent = true })
vim.api.nvim_create_user_command(
'Read',
'call fzf#run(fzf#wrap({\'sink\': \'read\', \'dir\': <q-args>}))',
{ nargs = '?', complete = 'dir' }
)
'';
}
{
plugin = goyo;
config = ''
nnoremap yog :Goyo<return>
nnoremap [og :Goyo 80<return>
nnoremap ]og :Goyo!<return>
'';
}
{
plugin = limelight-vim;
config = ''
set termguicolors
let g:limelight_conceal_ctermfg = 'darkgray'
nnoremap yof :Limelight!!<return>
nnoremap [of :Limelight<return>
nnoremap ]of :Limelight!<return>
'';
}
nabla-nvim
neogit
{
plugin = nvim-cmp;
type = "lua";
config = builtins.readFile ./nvim-cmp.lua;
}
{
plugin = nvim-colorizer-lua;
config = "lua require 'colorizer'.setup()";
}
{
plugin = nvim-lspconfig;
type = "lua";
config = ''
vim.lsp.enable('astro')
vim.lsp.enable('marksman')
vim.lsp.enable('nil_ls')
vim.lsp.enable('r_language_server')
vim.lsp.enable('texlab')
vim.lsp.enable('ts_ls')
'';
}
{
plugin = papercolor-theme;
config = ''
set background=light
colorscheme PaperColor
'';
}
typescript-vim
{
plugin = ultisnips;
type = "lua";
config = ''
vim.api.nvim_set_keymap('n', '<leader>se', ':UltiSnipsEdit!<return>', { noremap = true, silent = true })
'';
}
vifm-vim
{
plugin = vim-astro;
config = ''
let g:astro_typescript = 'enable'
'';
}
vim-commentary
{
plugin = vim-easy-align;
config = ''
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
'';
}
vim-fish
vim-nix
vim-repeat
{
plugin = vim-slime;
config = ''
let g:slime_target = "tmux"
let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": ":.1"}
let g:slime_no_mappings = 1
let g:slime_dont_ask_default = 1
xmap s <plug>SlimeRegionSend
nmap s <plug>SlimeMotionSend
nmap ss <plug>SlimeLineSend
nnoremap s: :SlimeSend1
'';
}
vim-snippets
vim-speeddating
vim-surround
vim-unimpaired
vimwiki
];
};
xdg.configFile."nvim" = {
source = ./dotfiles;
recursive = true;
};
home.shellAliases.v = "nvim";
}