os/modules/terminal-life/nvim/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

149 lines
3.6 KiB
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
{
config,
pkgs,
2022-12-26 14:06:47 +00:00
lib,
2021-05-30 19:10:28 +00:00
...
}: let
psCfg = config.pub-solar;
cfg = config.pub-solar.terminal-life;
2021-05-30 19:10:28 +00:00
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs);
2021-05-30 19:10:28 +00:00
in {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withRuby = true;
withPython3 = true;
extraPackages = with pkgs;
lib.mkIf (cfg.full) [
2023-06-09 15:06:11 +00:00
ansible-language-server
ccls
gopls
nixd
2021-05-30 19:10:28 +00:00
nodejs
nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs
nodePackages.svelte-language-server
nodePackages.typescript
nodePackages.typescript-language-server
2021-05-30 19:10:28 +00:00
nodePackages.vim-language-server
nodePackages.vue-language-server
2022-01-19 00:13:15 +00:00
nodePackages.vscode-langservers-extracted
2021-05-30 19:10:28 +00:00
nodePackages.yaml-language-server
python3Packages.python-lsp-server
2021-05-30 19:10:28 +00:00
python3Full
rust-analyzer
solargraph
2021-05-30 19:10:28 +00:00
terraform-ls
universal-ctags
2021-05-30 19:10:28 +00:00
];
plugins = with pkgs.vimPlugins; lib.mkIf cfg.full [
pkgs.vimPlugins.nvim-treesitter.withAllGrammars
# Dependencies for nvim-lspconfig
nvim-cmp
cmp-nvim-lsp
cmp_luasnip
luasnip
# Quickstart configs for neovim LSP
lsp_extensions-nvim
nvim-lspconfig
# Collaborative editing in Neovim using built-in capabilities
instant-nvim-nvfetcher
# Search functionality behind :Ack
ack-vim
# The status bar in the bottom of the screen with the mode indication and file location
vim-airline
# Automatically load editorconfig files in repos to configure nvim settings
editorconfig-vim
# File browser. Use <leader>n to access
nnn-vim
# Highlight characters when using f, F, t, and T
quick-scope
# Get sudo in vim; :SudaWrite <optional filename>
2024-06-02 21:47:00 +00:00
vim-suda
# Undo history etc. per project
vim-workspace-nvfetcher
# JSON schemas
SchemaStore-nvim
# Work with tags files
vim-gutentags
# Neovim colorschemes / themes
sonokai
vim-hybrid-material
vim-airline-themes
vim-apprentice-nvfetcher
# Git integrations
# A Git wrapper so awesome, it should be illegal
fugitive
# Shows git diff markers in the sign column
vim-gitgutter
# GitHub extension for fugitive
vim-rhubarb
# Ease your git workflow within Vim
vimagit-nvfetcher
# FZF fuzzy finder
fzf-vim
fzfWrapper
# Make the yanked region apparent
vim-highlightedyank
# :Beautify Code beautifier
vim-beautify-nvfetcher
# Unload, delete or wipe a buffer without closing the window
vim-bufkill
# Defaults everyone can agree on
vim-sensible
# emmet for vim: http://emmet.io/
emmet-vim
# Caddyfile syntax support for Vim
vim-caddyfile-nvfetcher
];
2021-12-02 11:19:37 +00:00
extraConfig = builtins.concatStringsSep "\n" [
''
" Persistent undo
set undofile
set undodir=${xdg.cacheHome}/nvim/undo
set backupdir=${xdg.dataHome}/nvim/backup
set directory=${xdg.dataHome}/nvim/swap/
''
(builtins.readFile ./init.vim)
(builtins.readFile ./plugins.vim)
(builtins.readFile ./clipboard.vim)
(builtins.readFile ./ui.vim)
(builtins.readFile ./quickfixopenall.vim)
(builtins.readFile ./lsp.vim)
(builtins.readFile ./filetypes.vim)
2021-12-02 11:19:37 +00:00
''
" fzf with file preview
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, { 'options': ['--keep-right', '--cycle', '--layout', 'reverse', '--preview', '${preview-file}/bin/preview-file {}'] }, <bang>0)
''
2021-05-30 19:10:28 +00:00
];
}