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 | 0bd9594 | 2022-07-27 13:16:29 +0100 | [diff] [blame] | 24 | set smartcase |
Skyler Grey | a949ffd | 2022-06-23 23:32:48 +0100 | [diff] [blame] | 25 | 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 Grey | 4802852 | 2022-06-23 23:37:22 +0100 | [diff] [blame] | 32 | |
Skyler Grey | 76d302d | 2022-08-02 23:15:29 +0100 | [diff] [blame] | 33 | let g:better_whitespace_enabled=1 |
| 34 | let g:strip_whitespace_on_save=1 |
| 35 | let g:strip_only_modified_lines=1 |
| 36 | let g:strip_whitelines_at_eof=1 |
| 37 | let g:show_spaces_that_precede_tabs=1 |
| 38 | nnoremap ]w :NextTrailingWhitespace<CR> |
| 39 | nnoremap [w :PrevTrailingWhitespace<CR> |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 40 | |
Skyler Grey | 4802852 | 2022-06-23 23:37:22 +0100 | [diff] [blame] | 41 | set statusline=%t "tail of the filename |
| 42 | set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding |
| 43 | set statusline+=%{&ff}] "file format |
| 44 | set statusline+=%h "help file flag |
| 45 | set statusline+=%m "modified flag |
| 46 | set statusline+=%r "read only flag |
| 47 | set statusline+=%y "filetype |
| 48 | set statusline+=%= "left/right separator |
| 49 | set statusline+=%c, "cursor column |
| 50 | set statusline+=%l/%L "cursor line/total lines |
| 51 | set statusline+=\ %P "percent through file |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 52 | |
Skyler Grey | 76d302d | 2022-08-02 23:15:29 +0100 | [diff] [blame] | 53 | let g:VM_theme_set_by_colorscheme = 1 |
| 54 | highlight VM_Extend ctermfg=NONE guifg=NONE ctermbg=239 guibg=#474e5d |
| 55 | highlight VM_Cursor ctermfg=188 guifg=#dcdfe4 ctermbg=168 guibg=#e06c75 |
| 56 | highlight VM_Insert ctermfg=236 guifg=#282c34 ctermbg=176 guibg=#c678dd |
| 57 | highlight VM_Mono ctermfg=236 guifg=#282c34 ctermbg=75 guibg=#61afef |
| 58 | |
Skyler Grey | 8d2f105 | 2022-07-09 21:02:17 +0100 | [diff] [blame] | 59 | nnoremap <silent> K :call <SID>show_documentation()<CR> |
| 60 | |
| 61 | function! s:show_documentation() |
| 62 | if (index(['vim','help'], &filetype) >= 0) |
| 63 | execute 'h '.expand('<cword>') |
| 64 | else |
| 65 | call CocAction('doHover') |
| 66 | endif |
| 67 | endfunction |
| 68 | |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 69 | lua << EOF |
| 70 | require('neorg').setup { |
| 71 | load = { |
| 72 | ["core.defaults"] = {} |
| 73 | } |
| 74 | } |
Skyler Grey | 5510953 | 2022-07-04 18:31:29 +0100 | [diff] [blame] | 75 | |
Skyler Grey | b328357 | 2022-06-24 21:25:29 +0100 | [diff] [blame] | 76 | require('orgmode').setup_ts_grammar() |
Skyler Grey | 810c00e | 2022-06-24 21:16:22 +0100 | [diff] [blame] | 77 | |
| 78 | require('nvim-treesitter.configs').setup { |
| 79 | highlight = { |
| 80 | enable = true, |
Skyler Grey | b328357 | 2022-06-24 21:25:29 +0100 | [diff] [blame] | 81 | additional_vim_regex_highlighting = {'org'}, |
Skyler Grey | 810c00e | 2022-06-24 21:16:22 +0100 | [diff] [blame] | 82 | }, |
Skyler Grey | 76d302d | 2022-08-02 23:15:29 +0100 | [diff] [blame] | 83 | rainbow = { |
| 84 | enable = true, |
| 85 | extended_mode = true, |
| 86 | max_file_lines = nil, |
| 87 | }, |
Skyler Grey | 4597d65 | 2022-08-03 00:23:19 +0100 | [diff] [blame^] | 88 | incremental_selection = { |
| 89 | enable = true, |
| 90 | keymaps = { |
| 91 | init_selection = "gnn", |
| 92 | node_incremental = "grn", |
| 93 | scope_incremental = "grc", |
| 94 | node_decremental = "grm", |
| 95 | }, |
| 96 | }, |
Skyler Grey | 810c00e | 2022-06-24 21:16:22 +0100 | [diff] [blame] | 97 | indent = { |
| 98 | enable = true, |
| 99 | }, |
| 100 | } |
Skyler Grey | c0a5245 | 2022-07-09 21:06:53 +0100 | [diff] [blame] | 101 | |
| 102 | require('git-conflict').setup() |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 103 | EOF |
Skyler Grey | 4597d65 | 2022-08-03 00:23:19 +0100 | [diff] [blame^] | 104 | |
| 105 | set foldmethod=expr |
| 106 | set foldexpr=nvim_treesitter#foldexpr() |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 107 | ''; |
Skyler Grey | 686ca7f | 2022-06-24 14:30:05 +0100 | [diff] [blame] | 108 | |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 109 | plugins = [ |
Skyler Grey | 8d2f105 | 2022-07-09 21:02:17 +0100 | [diff] [blame] | 110 | pkgs.vimPlugins.git-conflict-nvim |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 111 | pkgs.vimPlugins.vim-nix |
Skyler Grey | e96d011 | 2022-06-15 15:39:56 +0100 | [diff] [blame] | 112 | pkgs.vimPlugins.copilot-vim |
Skyler Grey | f2b5e26 | 2022-06-15 15:59:50 +0100 | [diff] [blame] | 113 | pkgs.vimPlugins.coc-tsserver |
Skyler Grey | 5510953 | 2022-07-04 18:31:29 +0100 | [diff] [blame] | 114 | pkgs.vimPlugins.coc-eslint |
Skyler Grey | 5886723 | 2022-06-23 22:02:10 +0100 | [diff] [blame] | 115 | pkgs.vimPlugins.zoomwintab-vim |
| 116 | pkgs.vimPlugins.onehalf |
Skyler Grey | 619d860 | 2022-06-24 14:20:51 +0100 | [diff] [blame] | 117 | pkgs.vimPlugins.neorg |
Skyler Grey | b328357 | 2022-06-24 21:25:29 +0100 | [diff] [blame] | 118 | pkgs.vimPlugins.orgmode |
Skyler Grey | f49e4f3 | 2022-07-20 20:47:35 +0100 | [diff] [blame] | 119 | pkgs.vimPlugins.vim-sleuth |
Skyler Grey | 249d9d0 | 2022-07-12 13:19:17 +0100 | [diff] [blame] | 120 | pkgs.vimPlugins.vim-visual-multi |
Skyler Grey | 76d302d | 2022-08-02 23:15:29 +0100 | [diff] [blame] | 121 | pkgs.vimPlugins.vim-better-whitespace |
Skyler Grey | 3ed2abf | 2022-08-03 00:12:26 +0100 | [diff] [blame] | 122 | (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: |
| 123 | (builtins.filter (x: builtins.typeOf x == "set") (builtins.attrValues pkgs.tree-sitter-grammars)) ++ |
| 124 | [ |
Skyler Grey | 76d302d | 2022-08-02 23:15:29 +0100 | [diff] [blame] | 125 | pkgs.vimPlugins.nvim-ts-rainbow |
Skyler Grey | 238934b | 2022-06-24 15:51:41 +0100 | [diff] [blame] | 126 | ])) |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 127 | ]; |
Skyler Grey | e699532 | 2022-06-12 09:29:17 +0100 | [diff] [blame] | 128 | }; |
Skyler Grey | c96cd8a | 2022-06-15 12:28:27 +0100 | [diff] [blame] | 129 | |
| 130 | home.sessionVariables.EDITOR = "${pkgs.neovim}/bin/nvim"; |
Skyler Grey | 73c55fc | 2022-06-12 09:18:59 +0100 | [diff] [blame] | 131 | } |