blob: f97c31e691ccc06c21cea921fa9853f8ebd1fbb5 [file] [log] [blame]
Skyler Greyc96cd8a2022-06-15 12:28:27 +01001{ pkgs, ... }: {
Skyler Greye6995322022-06-12 09:29:17 +01002 programs.neovim = {
3 enable = true;
Skyler Greyc96cd8a2022-06-15 12:28:27 +01004 coc = {
5 enable = true;
6 settings = {
7 "suggest.noselect" = false;
8 };
9 };
Skyler Greye6995322022-06-12 09:29:17 +010010 viAlias = true;
11 vimAlias = true;
12 vimdiffAlias = true;
Skyler Greyc96cd8a2022-06-15 12:28:27 +010013 extraConfig = ''
14 set whichwrap=b,s,<,>,[,]
Skyler Greya3999c02022-06-24 14:05:13 +010015 set linebreak
Skyler Grey2e80a192022-06-15 14:23:01 +010016 set wrap
17 set number
Skyler Greya949ffd2022-06-23 23:32:48 +010018 set cursorline
Skyler Grey32da1932022-07-05 08:37:59 +010019 set expandtab
Skyler Grey8d2f1052022-07-09 21:02:17 +010020 set mouse=a
Skyler Greya949ffd2022-06-23 23:32:48 +010021 colorscheme onehalfdark
22
23 if exists('+termguicolors')
24 let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
25 let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
26 set termguicolors
27 endif
Skyler Grey48028522022-06-23 23:37:22 +010028
Skyler Greyad45e3f2022-07-04 18:07:17 +010029 highlight ExtraWhitespace ctermbg=red guibg=red
30 match ExtraWhitespace /\s\+$/
Skyler Grey9f3a7202022-07-05 08:59:50 +010031 " highlight Tab ctermbg=red guibg=red
32 " match Tab /\t/
Skyler Grey686ca7f2022-06-24 14:30:05 +010033
Skyler Grey48028522022-06-23 23:37:22 +010034 set statusline=%t "tail of the filename
35 set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
36 set statusline+=%{&ff}] "file format
37 set statusline+=%h "help file flag
38 set statusline+=%m "modified flag
39 set statusline+=%r "read only flag
40 set statusline+=%y "filetype
41 set statusline+=%= "left/right separator
42 set statusline+=%c, "cursor column
43 set statusline+=%l/%L "cursor line/total lines
44 set statusline+=\ %P "percent through file
Skyler Grey686ca7f2022-06-24 14:30:05 +010045
Skyler Grey8d2f1052022-07-09 21:02:17 +010046 nnoremap <silent> K :call <SID>show_documentation()<CR>
47
48 function! s:show_documentation()
49 if (index(['vim','help'], &filetype) >= 0)
50 execute 'h '.expand('<cword>')
51 else
52 call CocAction('doHover')
53 endif
54 endfunction
55
Skyler Grey686ca7f2022-06-24 14:30:05 +010056 lua << EOF
57 require('neorg').setup {
58 load = {
59 ["core.defaults"] = {}
60 }
61 }
Skyler Grey55109532022-07-04 18:31:29 +010062
Skyler Greyb3283572022-06-24 21:25:29 +010063 require('orgmode').setup_ts_grammar()
Skyler Grey810c00e2022-06-24 21:16:22 +010064
65 require('nvim-treesitter.configs').setup {
66 highlight = {
67 enable = true,
Skyler Greyb3283572022-06-24 21:25:29 +010068 additional_vim_regex_highlighting = {'org'},
Skyler Grey810c00e2022-06-24 21:16:22 +010069 },
70 indent = {
71 enable = true,
72 },
73 }
Skyler Greyc0a52452022-07-09 21:06:53 +010074
75 require('git-conflict').setup()
Skyler Grey686ca7f2022-06-24 14:30:05 +010076 EOF
Skyler Greyc96cd8a2022-06-15 12:28:27 +010077 '';
Skyler Grey686ca7f2022-06-24 14:30:05 +010078
Skyler Greyc96cd8a2022-06-15 12:28:27 +010079 plugins = [
Skyler Grey8d2f1052022-07-09 21:02:17 +010080 pkgs.vimPlugins.git-conflict-nvim
Skyler Greyc96cd8a2022-06-15 12:28:27 +010081 pkgs.vimPlugins.vim-nix
Skyler Greye96d0112022-06-15 15:39:56 +010082 pkgs.vimPlugins.copilot-vim
Skyler Greyf2b5e262022-06-15 15:59:50 +010083 pkgs.vimPlugins.coc-tsserver
Skyler Grey55109532022-07-04 18:31:29 +010084 pkgs.vimPlugins.coc-eslint
Skyler Grey58867232022-06-23 22:02:10 +010085 pkgs.vimPlugins.zoomwintab-vim
86 pkgs.vimPlugins.onehalf
Skyler Grey619d8602022-06-24 14:20:51 +010087 pkgs.vimPlugins.neorg
Skyler Greyb3283572022-06-24 21:25:29 +010088 pkgs.vimPlugins.orgmode
Skyler Grey238934b2022-06-24 15:51:41 +010089 (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: [
90 pkgs.tree-sitter-grammars.tree-sitter-go
91 pkgs.tree-sitter-grammars.tree-sitter-nix
92 pkgs.tree-sitter-grammars.tree-sitter-tsx
93 pkgs.tree-sitter-grammars.tree-sitter-rust
94 pkgs.tree-sitter-grammars.tree-sitter-css
95 pkgs.tree-sitter-grammars.tree-sitter-norg
96 pkgs.tree-sitter-grammars.tree-sitter-json
97 pkgs.tree-sitter-grammars.tree-sitter-glsl
98 pkgs.tree-sitter-grammars.tree-sitter-regex
99 pkgs.tree-sitter-grammars.tree-sitter-latex
100 pkgs.tree-sitter-grammars.tree-sitter-python
101 pkgs.tree-sitter-grammars.tree-sitter-comment
102 pkgs.tree-sitter-grammars.tree-sitter-markdown
103 pkgs.tree-sitter-grammars.tree-sitter-org-nvim
104 pkgs.tree-sitter-grammars.tree-sitter-typescript
105 pkgs.tree-sitter-grammars.tree-sitter-javascript
106 ]))
Skyler Greyc96cd8a2022-06-15 12:28:27 +0100107 ];
Skyler Greye6995322022-06-12 09:29:17 +0100108 };
Skyler Greyc96cd8a2022-06-15 12:28:27 +0100109
110 home.sessionVariables.EDITOR = "${pkgs.neovim}/bin/nvim";
Skyler Grey73c55fc2022-06-12 09:18:59 +0100111}