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;
|
2022-08-14 15:17:35 +00:00
|
|
|
cfg = config.pub-solar.terminal-life;
|
2021-05-30 19:10:28 +00:00
|
|
|
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
|
|
|
|
2021-11-29 18:06:10 +00:00
|
|
|
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;
|
|
|
|
|
2022-08-14 15:17:35 +00:00
|
|
|
extraPackages = with pkgs;
|
|
|
|
lib.mkIf (!cfg.lite) [
|
2023-06-09 15:06:11 +00:00
|
|
|
ansible-language-server
|
2021-10-29 14:44:35 +00:00
|
|
|
ccls
|
|
|
|
gopls
|
2023-07-02 00:50:01 +00:00
|
|
|
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
|
2021-10-29 14:44:35 +00:00
|
|
|
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
|
2023-05-17 21:56:46 +00:00
|
|
|
python3Packages.python-lsp-server
|
2021-05-30 19:10:28 +00:00
|
|
|
python3Full
|
2021-10-29 14:44:35 +00:00
|
|
|
rust-analyzer
|
2023-07-02 00:50:01 +00:00
|
|
|
solargraph
|
2021-05-30 19:10:28 +00:00
|
|
|
terraform-ls
|
2022-08-13 10:59:42 +00:00
|
|
|
rnix-lsp
|
2021-10-29 14:44:35 +00:00
|
|
|
universal-ctags
|
2022-08-13 10:59:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
++ lib.optionals (!cfg.lite) [
|
|
|
|
gopls
|
|
|
|
python3Full
|
2021-05-30 19:10:28 +00:00
|
|
|
];
|
|
|
|
|
2023-05-17 21:56:46 +00:00
|
|
|
plugins = with pkgs.vimPlugins;
|
|
|
|
[]
|
|
|
|
++ lib.optionals (!cfg.lite) [
|
2023-07-13 13:53:10 +00:00
|
|
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
|
2023-07-14 11:38:01 +00:00
|
|
|
p.ini
|
2023-07-13 13:53:10 +00:00
|
|
|
p.json
|
|
|
|
p.json5
|
2023-07-14 11:38:01 +00:00
|
|
|
p.markdown
|
|
|
|
p.nix
|
|
|
|
p.toml
|
2023-07-13 13:53:10 +00:00
|
|
|
p.yaml
|
|
|
|
|
|
|
|
p.css
|
2023-07-14 11:38:01 +00:00
|
|
|
p.graphql
|
|
|
|
p.html
|
|
|
|
p.javascript
|
2023-07-13 13:53:10 +00:00
|
|
|
p.scss
|
|
|
|
p.tsx
|
2023-07-14 11:38:01 +00:00
|
|
|
p.typescript
|
2023-07-13 13:53:10 +00:00
|
|
|
p.vue
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
p.c
|
|
|
|
p.cpp
|
2023-07-13 13:53:10 +00:00
|
|
|
p.go
|
|
|
|
p.gomod
|
|
|
|
p.gosum
|
|
|
|
p.haskell
|
2023-07-14 11:38:01 +00:00
|
|
|
p.lua
|
|
|
|
p.php
|
|
|
|
p.python
|
|
|
|
p.ruby
|
|
|
|
p.rust
|
2023-07-13 13:53:10 +00:00
|
|
|
|
|
|
|
p.vim
|
|
|
|
p.vimdoc
|
|
|
|
|
|
|
|
p.passwd
|
2023-07-14 11:38:01 +00:00
|
|
|
p.sql
|
2023-07-13 13:53:10 +00:00
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
p.diff
|
2023-07-13 13:53:10 +00:00
|
|
|
p.gitcommit
|
|
|
|
p.gitignore
|
|
|
|
p.git_config
|
|
|
|
p.gitattributes
|
|
|
|
p.git_rebase
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
p.bash
|
2023-07-13 13:53:10 +00:00
|
|
|
p.dockerfile
|
2023-07-14 11:38:01 +00:00
|
|
|
p.make
|
|
|
|
p.ninja
|
2023-07-13 13:53:10 +00:00
|
|
|
p.terraform
|
|
|
|
]))
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# Dependencies for nvim-lspconfig
|
2023-05-17 21:56:46 +00:00
|
|
|
nvim-cmp
|
|
|
|
cmp-nvim-lsp
|
|
|
|
cmp_luasnip
|
|
|
|
luasnip
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# Quickstart configs for neovim LSP
|
2023-05-17 21:56:46 +00:00
|
|
|
lsp_extensions-nvim
|
|
|
|
nvim-lspconfig
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# Collaborative editing in Neovim using built-in capabilities
|
2023-05-17 21:56:46 +00:00
|
|
|
instant-nvim-nvfetcher
|
|
|
|
|
2023-07-13 13:53:10 +00:00
|
|
|
# Search functionality behind :Ack
|
2023-05-17 21:56:46 +00:00
|
|
|
ack-vim
|
2023-07-13 13:53:10 +00:00
|
|
|
|
|
|
|
# The status bar in the bottom of the screen with the mode indication and file location
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-airline
|
2023-07-13 13:53:10 +00:00
|
|
|
|
|
|
|
# Automatically load editorconfig files in repos to configure nvim settings
|
2023-05-17 21:56:46 +00:00
|
|
|
editorconfig-vim
|
2023-07-13 13:53:10 +00:00
|
|
|
|
|
|
|
# File browser. Use <leader>n to access
|
2023-05-17 21:56:46 +00:00
|
|
|
nnn-vim
|
2023-07-13 13:53:10 +00:00
|
|
|
|
2023-07-13 16:07:58 +00:00
|
|
|
# Highlight characters when using f, F, t, and T
|
2023-05-17 21:56:46 +00:00
|
|
|
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>
|
2023-05-17 21:56:46 +00:00
|
|
|
suda-vim
|
2023-07-13 16:07:58 +00:00
|
|
|
|
2023-07-14 11:13:13 +00:00
|
|
|
# Undo history etc. per project
|
2023-05-17 21:56:46 +00:00
|
|
|
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
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# Neovim colorschemes / themes
|
2023-05-17 21:56:46 +00:00
|
|
|
sonokai
|
|
|
|
vim-hybrid-material
|
|
|
|
vim-airline-themes
|
|
|
|
vim-apprentice-nvfetcher
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# Git integrations
|
|
|
|
# A Git wrapper so awesome, it should be illegal
|
2023-05-17 21:56:46 +00:00
|
|
|
fugitive
|
2023-07-14 11:38:01 +00:00
|
|
|
# Shows git diff markers in the sign column
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-gitgutter
|
2023-07-14 11:38:01 +00:00
|
|
|
# GitHub extension for fugitive
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-rhubarb
|
2023-07-14 11:38:01 +00:00
|
|
|
# Ease your git workflow within Vim
|
2023-05-17 21:56:46 +00:00
|
|
|
vimagit-nvfetcher
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# FZF fuzzy finder
|
2023-05-17 21:56:46 +00:00
|
|
|
fzf-vim
|
|
|
|
fzfWrapper
|
2023-07-14 11:38:01 +00:00
|
|
|
# Make the yanked region apparent
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-highlightedyank
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# :Beautify Code beautifier
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-beautify-nvfetcher
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# Unload, delete or wipe a buffer without closing the window
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-bufkill
|
2023-07-14 11:38:01 +00:00
|
|
|
# Defaults everyone can agree on
|
2023-05-17 21:56:46 +00:00
|
|
|
vim-sensible
|
|
|
|
|
2023-07-14 11:38:01 +00:00
|
|
|
# emmet for vim: http://emmet.io/
|
2023-05-17 21:56:46 +00:00
|
|
|
emmet-vim
|
2023-07-14 11:38:01 +00:00
|
|
|
# Caddyfile syntax support for Vim
|
2023-05-17 21:56:46 +00:00
|
|
|
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
|
|
|
];
|
|
|
|
}
|