|
1 |
| -{ lib, pkgs, config, ... }: |
| 1 | +{ |
| 2 | + lib, |
| 3 | + pkgs, |
| 4 | + config, |
| 5 | + ... |
| 6 | +}: |
2 | 7 |
|
3 | 8 | with lib;
|
4 | 9 |
|
5 |
| -let cfg = config.lc-shell.vim; |
6 |
| -in { |
| 10 | +let |
| 11 | + cfg = config.lc-shell.vim; |
| 12 | +in |
| 13 | +{ |
7 | 14 | options.lc-shell.vim = {
|
8 | 15 | enable = mkEnableOption "vim configuration";
|
9 | 16 | };
|
10 | 17 |
|
11 | 18 | config = mkIf cfg.enable {
|
12 |
| - programs.neovim = let |
13 |
| - pastemode-vim = pkgs.vimUtils.buildVimPlugin { |
14 |
| - name = "pastemode-vim"; |
15 |
| - src = pkgs.fetchFromGitHub { |
16 |
| - owner = "lightcode"; |
17 |
| - repo = "PasteMode.vim"; |
18 |
| - rev = "1046b1efc0a85ee18a0f8cdbcb3d14a1743c1a1b"; |
19 |
| - sha256 = "0bp4rwhj08mjafcpn0f27im21gvndaa5yqfv9apar0lzqk3wwgnv"; |
| 19 | + programs.neovim = |
| 20 | + let |
| 21 | + pastemode-vim = pkgs.vimUtils.buildVimPlugin { |
| 22 | + name = "pastemode-vim"; |
| 23 | + src = pkgs.fetchFromGitHub { |
| 24 | + owner = "lightcode"; |
| 25 | + repo = "PasteMode.vim"; |
| 26 | + rev = "1046b1efc0a85ee18a0f8cdbcb3d14a1743c1a1b"; |
| 27 | + sha256 = "0bp4rwhj08mjafcpn0f27im21gvndaa5yqfv9apar0lzqk3wwgnv"; |
| 28 | + }; |
| 29 | + meta.homepage = "https://github.com/lightcode/PasteMode.vim"; |
20 | 30 | };
|
21 |
| - meta.homepage = "https://github.com/lightcode/PasteMode.vim"; |
22 |
| - }; |
23 |
| - in { |
24 |
| - enable = true; |
25 |
| - plugins = with pkgs.vimPlugins; [ |
26 |
| - gruvbox |
27 |
| - pastemode-vim |
28 |
| - supertab |
29 |
| - vim-airline-themes |
30 |
| - vim-cue |
31 |
| - vim-gitgutter |
32 |
| - vim-graphql |
33 |
| - vim-nix |
| 31 | + in |
| 32 | + { |
| 33 | + enable = true; |
| 34 | + plugins = with pkgs.vimPlugins; [ |
| 35 | + gruvbox |
| 36 | + pastemode-vim |
| 37 | + supertab |
| 38 | + vim-airline-themes |
| 39 | + vim-cue |
| 40 | + vim-gitgutter |
| 41 | + vim-graphql |
| 42 | + vim-nix |
34 | 43 |
|
35 |
| - { |
36 |
| - plugin = ale; |
37 |
| - config = '' |
38 |
| - let g:ale_fixers = { |
39 |
| - \ '*': ['remove_trailing_lines', 'trim_whitespace'], |
40 |
| - \ 'nix': ['nixfmt'], |
41 |
| - \ 'python': ['ruff_format'], |
42 |
| - \ 'typescript': ['prettier'], |
43 |
| - \} |
44 |
| - let g:ale_sh_shellcheck_options = '-x' |
45 |
| - let g:ale_sh_shellcheck_change_directory = 0 |
46 |
| - ''; |
47 |
| - } |
48 |
| - { |
49 |
| - plugin = vim-terraform; |
50 |
| - config = '' |
51 |
| - let g:terraform_fmt_on_save = 1 |
52 |
| - ''; |
53 |
| - } |
54 |
| - { |
55 |
| - plugin = vim-markdown; |
56 |
| - config = '' |
57 |
| - let g:vim_markdown_folding_disabled = 1 |
58 |
| - ''; |
59 |
| - } |
60 |
| - { |
61 |
| - plugin = vim-go; |
62 |
| - config = '' |
63 |
| - if executable('goimports') |
64 |
| - let g:go_fmt_command = 'goimports' |
65 |
| - endif |
66 |
| - ''; |
67 |
| - } |
68 |
| - { |
69 |
| - plugin = vim-pencil; |
70 |
| - config = '' |
71 |
| - let g:pencil#autoformat = 0 |
72 |
| - let g:pencil#conceallevel = 0 |
73 |
| - let g:pencil#wrapModeDefault = 'soft' |
74 |
| - ''; |
75 |
| - } |
76 |
| - { |
77 |
| - plugin = ctrlp-vim; |
78 |
| - config = '' |
79 |
| - let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:12,results:12' |
80 |
| - let g:ctrlp_custom_ignore = { |
81 |
| - \ 'dir': '\v[\/](\.(git|hg|svn))$', |
82 |
| - \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$' } |
83 |
| - if executable('ag') |
84 |
| - set grepprg=ag\ --nogroup\ --nocolor |
85 |
| - let g:ctrlp_user_command = 'ag %s -l --hidden --ignore .git --nocolor -g ""' |
86 |
| - endif |
87 |
| - ''; |
88 |
| - } |
89 |
| - { |
90 |
| - plugin = vim-airline; |
91 |
| - config = '' |
92 |
| - set noshowmode |
| 44 | + { |
| 45 | + plugin = ale; |
| 46 | + config = '' |
| 47 | + let g:ale_fixers = { |
| 48 | + \ '*': ['remove_trailing_lines', 'trim_whitespace'], |
| 49 | + \ 'nix': ['nixfmt'], |
| 50 | + \ 'python': ['ruff_format'], |
| 51 | + \ 'typescript': ['prettier'], |
| 52 | + \} |
| 53 | + let g:ale_sh_shellcheck_options = '-x' |
| 54 | + let g:ale_sh_shellcheck_change_directory = 0 |
| 55 | + ''; |
| 56 | + } |
| 57 | + { |
| 58 | + plugin = vim-terraform; |
| 59 | + config = '' |
| 60 | + let g:terraform_fmt_on_save = 1 |
| 61 | + ''; |
| 62 | + } |
| 63 | + { |
| 64 | + plugin = vim-markdown; |
| 65 | + config = '' |
| 66 | + let g:vim_markdown_folding_disabled = 1 |
| 67 | + ''; |
| 68 | + } |
| 69 | + { |
| 70 | + plugin = vim-go; |
| 71 | + config = '' |
| 72 | + if executable('goimports') |
| 73 | + let g:go_fmt_command = 'goimports' |
| 74 | + endif |
| 75 | + ''; |
| 76 | + } |
| 77 | + { |
| 78 | + plugin = vim-pencil; |
| 79 | + config = '' |
| 80 | + let g:pencil#autoformat = 0 |
| 81 | + let g:pencil#conceallevel = 0 |
| 82 | + let g:pencil#wrapModeDefault = 'soft' |
| 83 | + ''; |
| 84 | + } |
| 85 | + { |
| 86 | + plugin = ctrlp-vim; |
| 87 | + config = '' |
| 88 | + let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:12,results:12' |
| 89 | + let g:ctrlp_custom_ignore = { |
| 90 | + \ 'dir': '\v[\/](\.(git|hg|svn))$', |
| 91 | + \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$' } |
| 92 | + if executable('ag') |
| 93 | + set grepprg=ag\ --nogroup\ --nocolor |
| 94 | + let g:ctrlp_user_command = 'ag %s -l --hidden --ignore .git --nocolor -g ""' |
| 95 | + endif |
| 96 | + ''; |
| 97 | + } |
| 98 | + { |
| 99 | + plugin = vim-airline; |
| 100 | + config = '' |
| 101 | + set noshowmode |
93 | 102 |
|
94 |
| - let g:airline_theme = 'bubblegum' |
95 |
| - let g:airline_skip_empty_sections = 1 |
96 |
| - let g:airline_extensions = ['tabline', 'ctrlp', 'ale'] |
97 |
| - let g:airline#extensions#tabline#enabled = 1 |
98 |
| - let g:airline#extensions#tabline#left_sep = "" |
99 |
| - let g:airline#extensions#tabline#left_alt_sep = "" |
100 |
| - let g:airline#extensions#tabline#right_sep = "" |
101 |
| - let g:airline#extensions#tabline#right_alt_sep = "" |
102 |
| - let g:airline#extensions#tabline#formatter = 'default' |
103 |
| - ''; |
104 |
| - } |
105 |
| - ]; |
106 |
| - extraConfig = builtins.readFile ./vimrc; |
107 |
| - }; |
| 103 | + let g:airline_theme = 'bubblegum' |
| 104 | + let g:airline_skip_empty_sections = 1 |
| 105 | + let g:airline_extensions = ['tabline', 'ctrlp', 'ale'] |
| 106 | + let g:airline#extensions#tabline#enabled = 1 |
| 107 | + let g:airline#extensions#tabline#left_sep = "" |
| 108 | + let g:airline#extensions#tabline#left_alt_sep = "" |
| 109 | + let g:airline#extensions#tabline#right_sep = "" |
| 110 | + let g:airline#extensions#tabline#right_alt_sep = "" |
| 111 | + let g:airline#extensions#tabline#formatter = 'default' |
| 112 | + ''; |
| 113 | + } |
| 114 | + ]; |
| 115 | + extraConfig = builtins.readFile ./vimrc; |
| 116 | + }; |
108 | 117 | };
|
109 | 118 | }
|
0 commit comments