blob: f53e536d91deb61fa868c68d91b0ec90d73deb55 [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 Grey0bd95942022-07-27 13:16:29 +010024 set smartcase
Skyler Greya949ffd2022-06-23 23:32:48 +010025 colorscheme onehalfdark
26
27 if exists('+termguicolors')
28 let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
29 let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
30 set termguicolors
31 endif
Skyler Grey48028522022-06-23 23:37:22 +010032
Skyler Greyad45e3f2022-07-04 18:07:17 +010033 highlight ExtraWhitespace ctermbg=red guibg=red
34 match ExtraWhitespace /\s\+$/
Skyler Grey9f3a7202022-07-05 08:59:50 +010035 " highlight Tab ctermbg=red guibg=red
36 " match Tab /\t/
Skyler Grey686ca7f2022-06-24 14:30:05 +010037
Skyler Grey48028522022-06-23 23:37:22 +010038 set statusline=%t "tail of the filename
39 set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
40 set statusline+=%{&ff}] "file format
41 set statusline+=%h "help file flag
42 set statusline+=%m "modified flag
43 set statusline+=%r "read only flag
44 set statusline+=%y "filetype
45 set statusline+=%= "left/right separator
46 set statusline+=%c, "cursor column
47 set statusline+=%l/%L "cursor line/total lines
48 set statusline+=\ %P "percent through file
Skyler Grey686ca7f2022-06-24 14:30:05 +010049
Skyler Grey8d2f1052022-07-09 21:02:17 +010050 nnoremap <silent> K :call <SID>show_documentation()<CR>
51
52 function! s:show_documentation()
53 if (index(['vim','help'], &filetype) >= 0)
54 execute 'h '.expand('<cword>')
55 else
56 call CocAction('doHover')
57 endif
58 endfunction
59
Skyler Grey686ca7f2022-06-24 14:30:05 +010060 lua << EOF
61 require('neorg').setup {
62 load = {
63 ["core.defaults"] = {}
64 }
65 }
Skyler Grey55109532022-07-04 18:31:29 +010066
Skyler Greyb3283572022-06-24 21:25:29 +010067 require('orgmode').setup_ts_grammar()
Skyler Grey810c00e2022-06-24 21:16:22 +010068
69 require('nvim-treesitter.configs').setup {
70 highlight = {
71 enable = true,
Skyler Greyb3283572022-06-24 21:25:29 +010072 additional_vim_regex_highlighting = {'org'},
Skyler Grey810c00e2022-06-24 21:16:22 +010073 },
74 indent = {
75 enable = true,
76 },
77 }
Skyler Greyc0a52452022-07-09 21:06:53 +010078
79 require('git-conflict').setup()
Skyler Grey686ca7f2022-06-24 14:30:05 +010080 EOF
Skyler Greyc96cd8a2022-06-15 12:28:27 +010081 '';
Skyler Grey686ca7f2022-06-24 14:30:05 +010082
Skyler Greyc96cd8a2022-06-15 12:28:27 +010083 plugins = [
Skyler Grey8d2f1052022-07-09 21:02:17 +010084 pkgs.vimPlugins.git-conflict-nvim
Skyler Greyc96cd8a2022-06-15 12:28:27 +010085 pkgs.vimPlugins.vim-nix
Skyler Greye96d0112022-06-15 15:39:56 +010086 pkgs.vimPlugins.copilot-vim
Skyler Greyf2b5e262022-06-15 15:59:50 +010087 pkgs.vimPlugins.coc-tsserver
Skyler Grey55109532022-07-04 18:31:29 +010088 pkgs.vimPlugins.coc-eslint
Skyler Grey58867232022-06-23 22:02:10 +010089 pkgs.vimPlugins.zoomwintab-vim
90 pkgs.vimPlugins.onehalf
Skyler Grey619d8602022-06-24 14:20:51 +010091 pkgs.vimPlugins.neorg
Skyler Greyb3283572022-06-24 21:25:29 +010092 pkgs.vimPlugins.orgmode
Skyler Greyf49e4f32022-07-20 20:47:35 +010093 pkgs.vimPlugins.vim-sleuth
Skyler Grey249d9d02022-07-12 13:19:17 +010094 pkgs.vimPlugins.vim-visual-multi
Skyler Grey238934b2022-06-24 15:51:41 +010095 (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: [
96 pkgs.tree-sitter-grammars.tree-sitter-go
97 pkgs.tree-sitter-grammars.tree-sitter-nix
98 pkgs.tree-sitter-grammars.tree-sitter-tsx
99 pkgs.tree-sitter-grammars.tree-sitter-rust
100 pkgs.tree-sitter-grammars.tree-sitter-css
101 pkgs.tree-sitter-grammars.tree-sitter-norg
102 pkgs.tree-sitter-grammars.tree-sitter-json
103 pkgs.tree-sitter-grammars.tree-sitter-glsl
104 pkgs.tree-sitter-grammars.tree-sitter-regex
105 pkgs.tree-sitter-grammars.tree-sitter-latex
106 pkgs.tree-sitter-grammars.tree-sitter-python
107 pkgs.tree-sitter-grammars.tree-sitter-comment
108 pkgs.tree-sitter-grammars.tree-sitter-markdown
109 pkgs.tree-sitter-grammars.tree-sitter-org-nvim
110 pkgs.tree-sitter-grammars.tree-sitter-typescript
111 pkgs.tree-sitter-grammars.tree-sitter-javascript
112 ]))
Skyler Greyc96cd8a2022-06-15 12:28:27 +0100113 ];
Skyler Greye6995322022-06-12 09:29:17 +0100114 };
Skyler Greyc96cd8a2022-06-15 12:28:27 +0100115
116 home.sessionVariables.EDITOR = "${pkgs.neovim}/bin/nvim";
Skyler Grey73c55fc2022-06-12 09:18:59 +0100117}