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

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

200 lines
4.4 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 {
2023-01-28 21:30:37 +00:00
enable = lib.mkIf (!cfg.lite) true;
2021-05-30 19:10:28 +00:00
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withRuby = true;
withPython3 = true;
2023-11-11 00:05:42 +00:00
extraPackages = with pkgs; lib.mkIf (!cfg.lite) ([
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
rnix-lsp
universal-ctags
2023-11-11 00:05:42 +00:00
] ++ lib.optionals (!cfg.lite) [
gopls
python3Full
2023-11-11 00:05:42 +00:00
]);
2021-05-30 19:10:28 +00:00
plugins = with pkgs.vimPlugins;
2023-11-11 00:05:42 +00:00
[
(pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
p.ini
p.json
p.json5
p.markdown
p.nix
p.toml
p.yaml
p.css
p.graphql
p.html
p.javascript
p.scss
p.tsx
p.typescript
p.vue
p.c
p.cpp
p.go
p.gomod
p.gosum
p.haskell
p.lua
p.php
p.python
p.ruby
p.rust
p.vim
p.vimdoc
p.passwd
p.sql
p.diff
p.gitcommit
p.gitignore
p.git_config
p.gitattributes
p.git_rebase
p.bash
p.dockerfile
p.make
p.ninja
p.terraform
]))
# 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
2023-07-13 16:07:58 +00:00
# Highlight characters when using f, F, t, and T
quick-scope
2023-07-13 16:07:58 +00:00
2023-07-14 11:13:13 +00:00
# Get sudo in vim; :SudaWrite <optional filename>
suda-vim
2023-07-13 16:07:58 +00:00
2023-07-14 11:13:13 +00:00
# Undo history etc. per project
vim-workspace-nvfetcher
2023-07-13 16:07:58 +00:00
# JSON schemas
SchemaStore-nvim
2023-07-20 21:59:08 +00:00
# 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)
''
" 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
];
}