Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 1 | { pkgs, ... }: { |
Skyler Grey | e699532 | 2022-06-12 09:29:17 +0100 | [diff] [blame] | 2 | programs.neovim = { |
| 3 | enable = true; |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 4 | coc = { |
| 5 | enable = true; |
| 6 | settings = { |
| 7 | "suggest.noselect" = false; |
| 8 | }; |
| 9 | }; |
Skyler Grey | e699532 | 2022-06-12 09:29:17 +0100 | [diff] [blame] | 10 | viAlias = true; |
| 11 | vimAlias = true; |
| 12 | vimdiffAlias = true; |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 13 | extraConfig = '' |
| 14 | set whichwrap=b,s,<,>,[,] |
Skyler Grey | a3999c0 | 2022-06-24 14:05:13 +0100 | [diff] [blame] | 15 | set linebreak |
Skyler Grey | 2e80a19 | 2022-06-15 14:23:01 +0100 | [diff] [blame] | 16 | set wrap |
| 17 | set number |
Skyler Grey | a949ffd | 2022-06-23 23:32:48 +0100 | [diff] [blame] | 18 | set cursorline |
Skyler Grey | 32da193 | 2022-07-05 08:37:59 +0100 | [diff] [blame] | 19 | set expandtab |
Skyler Grey | 8d2f105 | 2022-07-09 21:02:17 +0100 | [diff] [blame] | 20 | set mouse=a |
Skyler Grey | a0b7aea | 2022-07-12 12:01:49 +0100 | [diff] [blame] | 21 | set splitright |
Skyler Grey | 1e4cbc7 | 2022-07-12 12:39:02 +0100 | [diff] [blame^] | 22 | set splitbelow |
Skyler Grey | 4196611 | 2022-07-09 21:38:53 +0100 | [diff] [blame] | 23 | set clipboard=unnamedplus |
Skyler Grey | a949ffd | 2022-06-23 23:32:48 +0100 | [diff] [blame] | 24 | 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 Grey | 4802852 | 2022-06-23 23:37:22 +0100 | [diff] [blame] | 31 | |
Skyler Grey | ad45e3f | 2022-07-04 18:07:17 +0100 | [diff] [blame] | 32 | highlight ExtraWhitespace ctermbg=red guibg=red |
| 33 | match ExtraWhitespace /\s\+$/ |
Skyler Grey | 9f3a720 | 2022-07-05 08:59:50 +0100 | [diff] [blame] | 34 | " highlight Tab ctermbg=red guibg=red |
| 35 | " match Tab /\t/ |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 36 | |
Skyler Grey | 4802852 | 2022-06-23 23:37:22 +0100 | [diff] [blame] | 37 | 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 Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 48 | |
Skyler Grey | 8d2f105 | 2022-07-09 21:02:17 +0100 | [diff] [blame] | 49 | 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 Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 59 | lua << EOF |
| 60 | require('neorg').setup { |
| 61 | load = { |
| 62 | ["core.defaults"] = {} |
| 63 | } |
| 64 | } |
Skyler Grey | 5510953 | 2022-07-04 18:31:29 +0100 | [diff] [blame] | 65 | |
Skyler Grey | b328357 | 2022-06-24 21:25:29 +0100 | [diff] [blame] | 66 | require('orgmode').setup_ts_grammar() |
Skyler Grey | 810c00e | 2022-06-24 21:16:22 +0100 | [diff] [blame] | 67 | |
| 68 | require('nvim-treesitter.configs').setup { |
| 69 | highlight = { |
| 70 | enable = true, |
Skyler Grey | b328357 | 2022-06-24 21:25:29 +0100 | [diff] [blame] | 71 | additional_vim_regex_highlighting = {'org'}, |
Skyler Grey | 810c00e | 2022-06-24 21:16:22 +0100 | [diff] [blame] | 72 | }, |
| 73 | indent = { |
| 74 | enable = true, |
| 75 | }, |
| 76 | } |
Skyler Grey | c0a5245 | 2022-07-09 21:06:53 +0100 | [diff] [blame] | 77 | |
| 78 | require('git-conflict').setup() |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 79 | EOF |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 80 | ''; |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 81 | |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 82 | plugins = [ |
Skyler Grey | 8d2f105 | 2022-07-09 21:02:17 +0100 | [diff] [blame] | 83 | pkgs.vimPlugins.git-conflict-nvim |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 84 | pkgs.vimPlugins.vim-nix |
Skyler Grey | e96d011 | 2022-06-15 15:39:56 +0100 | [diff] [blame] | 85 | pkgs.vimPlugins.copilot-vim |
Skyler Grey | f2b5e26 | 2022-06-15 15:59:50 +0100 | [diff] [blame] | 86 | pkgs.vimPlugins.coc-tsserver |
Skyler Grey | 5510953 | 2022-07-04 18:31:29 +0100 | [diff] [blame] | 87 | pkgs.vimPlugins.coc-eslint |
Skyler Grey | 5886723 | 2022-06-23 22:02:10 +0100 | [diff] [blame] | 88 | pkgs.vimPlugins.zoomwintab-vim |
| 89 | pkgs.vimPlugins.onehalf |
Skyler Grey | 619d860 | 2022-06-24 14:20:51 +0100 | [diff] [blame] | 90 | pkgs.vimPlugins.neorg |
Skyler Grey | b328357 | 2022-06-24 21:25:29 +0100 | [diff] [blame] | 91 | pkgs.vimPlugins.orgmode |
Skyler Grey | 238934b | 2022-06-24 15:51:41 +0100 | [diff] [blame] | 92 | (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 Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 110 | ]; |
Skyler Grey | e699532 | 2022-06-12 09:29:17 +0100 | [diff] [blame] | 111 | }; |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 112 | |
| 113 | home.sessionVariables.EDITOR = "${pkgs.neovim}/bin/nvim"; |
Skyler Grey | 73c55fc | 2022-06-12 09:18:59 +0100 | [diff] [blame] | 114 | } |