blob: d10ab74ac9d248b5e7e545ad1ed851b7a09a16b0 [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 Greya0b7aea2022-07-12 12:01:49 +010021 set splitright
Skyler Grey1e4cbc72022-07-12 12:39:02 +010022 set splitbelow
Skyler Grey41966112022-07-09 21:38:53 +010023 set clipboard=unnamedplus
Skyler Greya949ffd2022-06-23 23:32:48 +010024 colorscheme onehalfdark
25
26 if exists('+termguicolors')
27 let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
28 let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
29 set termguicolors
30 endif
Skyler Grey48028522022-06-23 23:37:22 +010031
Skyler Greyad45e3f2022-07-04 18:07:17 +010032 highlight ExtraWhitespace ctermbg=red guibg=red
33 match ExtraWhitespace /\s\+$/
Skyler Grey9f3a7202022-07-05 08:59:50 +010034 " highlight Tab ctermbg=red guibg=red
35 " match Tab /\t/
Skyler Grey686ca7f2022-06-24 14:30:05 +010036
Skyler Grey48028522022-06-23 23:37:22 +010037 set statusline=%t "tail of the filename
38 set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
39 set statusline+=%{&ff}] "file format
40 set statusline+=%h "help file flag
41 set statusline+=%m "modified flag
42 set statusline+=%r "read only flag
43 set statusline+=%y "filetype
44 set statusline+=%= "left/right separator
45 set statusline+=%c, "cursor column
46 set statusline+=%l/%L "cursor line/total lines
47 set statusline+=\ %P "percent through file
Skyler Grey686ca7f2022-06-24 14:30:05 +010048
Skyler Grey8d2f1052022-07-09 21:02:17 +010049 nnoremap <silent> K :call <SID>show_documentation()<CR>
50
51 function! s:show_documentation()
52 if (index(['vim','help'], &filetype) >= 0)
53 execute 'h '.expand('<cword>')
54 else
55 call CocAction('doHover')
56 endif
57 endfunction
58
Skyler Grey686ca7f2022-06-24 14:30:05 +010059 lua << EOF
60 require('neorg').setup {
61 load = {
62 ["core.defaults"] = {}
63 }
64 }
Skyler Grey55109532022-07-04 18:31:29 +010065
Skyler Greyb3283572022-06-24 21:25:29 +010066 require('orgmode').setup_ts_grammar()
Skyler Grey810c00e2022-06-24 21:16:22 +010067
68 require('nvim-treesitter.configs').setup {
69 highlight = {
70 enable = true,
Skyler Greyb3283572022-06-24 21:25:29 +010071 additional_vim_regex_highlighting = {'org'},
Skyler Grey810c00e2022-06-24 21:16:22 +010072 },
73 indent = {
74 enable = true,
75 },
76 }
Skyler Greyc0a52452022-07-09 21:06:53 +010077
78 require('git-conflict').setup()
Skyler Grey686ca7f2022-06-24 14:30:05 +010079 EOF
Skyler Greyc96cd8a2022-06-15 12:28:27 +010080 '';
Skyler Grey686ca7f2022-06-24 14:30:05 +010081
Skyler Greyc96cd8a2022-06-15 12:28:27 +010082 plugins = [
Skyler Grey8d2f1052022-07-09 21:02:17 +010083 pkgs.vimPlugins.git-conflict-nvim
Skyler Greyc96cd8a2022-06-15 12:28:27 +010084 pkgs.vimPlugins.vim-nix
Skyler Greye96d0112022-06-15 15:39:56 +010085 pkgs.vimPlugins.copilot-vim
Skyler Greyf2b5e262022-06-15 15:59:50 +010086 pkgs.vimPlugins.coc-tsserver
Skyler Grey55109532022-07-04 18:31:29 +010087 pkgs.vimPlugins.coc-eslint
Skyler Grey58867232022-06-23 22:02:10 +010088 pkgs.vimPlugins.zoomwintab-vim
89 pkgs.vimPlugins.onehalf
Skyler Grey619d8602022-06-24 14:20:51 +010090 pkgs.vimPlugins.neorg
Skyler Greyb3283572022-06-24 21:25:29 +010091 pkgs.vimPlugins.orgmode
Skyler Grey238934b2022-06-24 15:51:41 +010092 (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: [
93 pkgs.tree-sitter-grammars.tree-sitter-go
94 pkgs.tree-sitter-grammars.tree-sitter-nix
95 pkgs.tree-sitter-grammars.tree-sitter-tsx
96 pkgs.tree-sitter-grammars.tree-sitter-rust
97 pkgs.tree-sitter-grammars.tree-sitter-css
98 pkgs.tree-sitter-grammars.tree-sitter-norg
99 pkgs.tree-sitter-grammars.tree-sitter-json
100 pkgs.tree-sitter-grammars.tree-sitter-glsl
101 pkgs.tree-sitter-grammars.tree-sitter-regex
102 pkgs.tree-sitter-grammars.tree-sitter-latex
103 pkgs.tree-sitter-grammars.tree-sitter-python
104 pkgs.tree-sitter-grammars.tree-sitter-comment
105 pkgs.tree-sitter-grammars.tree-sitter-markdown
106 pkgs.tree-sitter-grammars.tree-sitter-org-nvim
107 pkgs.tree-sitter-grammars.tree-sitter-typescript
108 pkgs.tree-sitter-grammars.tree-sitter-javascript
109 ]))
Skyler Greyc96cd8a2022-06-15 12:28:27 +0100110 ];
Skyler Greye6995322022-06-12 09:29:17 +0100111 };
Skyler Greyc96cd8a2022-06-15 12:28:27 +0100112
113 home.sessionVariables.EDITOR = "${pkgs.neovim}/bin/nvim";
Skyler Grey73c55fc2022-06-12 09:18:59 +0100114}