Robert Cranston authored on 23/12/2022 03:28:33
Showing 1 changed files

... ...
@@ -245,8 +245,8 @@ xnoremap <silent> gK y:helpgrep <C-R>"<CR>
245 245
 """ Run
246 246
 
247 247
 " File.
248
-nnoremap <silent> <Space><Space>% :!%:p:S<CR>
249
-nnoremap <silent> <Space><Space># :!#:p:S<CR>
248
+nnoremap <silent> <Space><Space>% :!%:p:S \| less -FR<CR>
249
+nnoremap <silent> <Space><Space># :!#:p:S \| less -FR<CR>
250 250
 
251 251
 " Command.
252 252
 nnoremap <Space><Space>! :new \| .!
... ...
@@ -254,12 +254,12 @@ nnoremap <Space><Space>! :new \| .!
254 254
 """ Make
255 255
 " TODO: |dispatch| provides default mappings, try to emulate them?
256 256
 " TODO: Should these be <silent> as well?
257
-nnoremap <Space><Space>m% :!make %:r:S<CR>
258
-nnoremap <Space><Space>m# :!make #:r:S<CR>
259
-nnoremap <Space><Space>mm :!make<CR>
260
-nnoremap <Space><Space>ma :!make all<CR>
261
-nnoremap <Space><Space>mt :!make test<CR>
262
-nnoremap <Space><Space>md :!make debug<CR>
257
+nnoremap <Space><Space>m% :!make %:r:S \| less -FR<CR>
258
+nnoremap <Space><Space>m# :!make #:r:S \| less -FR<CR>
259
+nnoremap <Space><Space>mm :!make       \| less -FR<CR>
260
+nnoremap <Space><Space>ma :!make all   \| less -FR<CR>
261
+nnoremap <Space><Space>mt :!make test  \| less -FR<CR>
262
+nnoremap <Space><Space>md :!make debug \| less -FR<CR>
263 263
 if has('quickfix')
264 264
   nnoremap <Space><Space>m% :silent make! %:r:S \| redraw!<CR>
265 265
   nnoremap <Space><Space>m# :silent make! #:r:S \| redraw!<CR>
... ...
@@ -332,7 +332,7 @@ endif
332 332
 """ Diffs
333 333
 
334 334
 " Current file.
335
-nnoremap <silent> <Space><Space>dd :w !diff --color -u %:S -<CR>
335
+nnoremap <silent> <Space><Space>dd :w !diff --color=always -u %:S - \| less -FR<CR>
336 336
 
337 337
 " Analogous with |dp| |do| in Normal mode.
338 338
 nnoremap <silent> <Space>dpp :.diffput<CR>
... ...
@@ -429,6 +429,12 @@ autocmd vimrc BufWinLeave *
429 429
 \   mkview |
430 430
 \ endif |
431 431
 
432
+""" Don't show extra things in special buffers
433
+autocmd vimrc WinEnter,TerminalWinOpen *
434
+\ if &buftype !=# '' |
435
+\   silent setlocal nolist nospell |
436
+\ endif
437
+
432 438
 "" Colors
433 439
 " See |cterm-colors|, |gui-colors|. The greyscale hex values used for the GUI
434 440
 " are CIELCHuv lightness 20, 60 and 80.
... ...
@@ -447,12 +453,14 @@ highlight! Normal guibg=#303030 guifg=#c6c6c6 ctermfg=White
447 453
 " bold white todos.
448 454
 
449 455
 if !has('gui_running')
450
-  autocmd vimrc VimEnter,ColorScheme,OptionSet *
456
+  autocmd vimrc VimEnter,ColorScheme *
451 457
   \ highlight! Normal guibg=NONE |
452 458
 endif
453 459
 
454 460
 " TODO: Look at all in |'highlight'|.
455
-autocmd vimrc VimEnter,ColorScheme,OptionSet *
461
+" TODO: If we decide that we want `OptionSet` here as well, make these commands
462
+" |silent| as they clear the command line row otherwise.
463
+autocmd vimrc VimEnter,ColorScheme *
456 464
 \ highlight! Normal           term=NONE cterm=NONE gui=NONE ctermbg=NONE |
457 465
 \ highlight! LineNr           term=NONE cterm=NONE gui=NONE ctermbg=NONE guibg=NONE ctermfg=Grey     guifg=Grey     |
458 466
 \ highlight! FoldColumn       term=NONE cterm=NONE gui=NONE ctermbg=NONE guibg=NONE ctermfg=Grey     guifg=Grey     |
... ...
@@ -476,7 +484,7 @@ autocmd vimrc VimEnter,ColorScheme,OptionSet *
476 484
 \ highlight! Todo             term=bold cterm=bold gui=NONE ctermbg=NONE guibg=NONE ctermfg=White    guifg=White    |
477 485
 
478 486
 """" Diffs
479
-autocmd vimrc VimEnter,ColorScheme,OptionSet *
487
+autocmd vimrc VimEnter,ColorScheme *
480 488
 \ highlight! DiffAdd          term=NONE cterm=NONE gui=NONE ctermfg=Black guifg=Black ctermbg=DarkGreen  guibg=Green  |
481 489
 \ highlight! DiffDelete       term=NONE cterm=NONE gui=NONE ctermfg=Black guifg=Black ctermbg=DarkRed    guibg=Red    |
482 490
 \ highlight! DiffChange       term=NONE cterm=NONE gui=NONE ctermfg=Black guifg=Black ctermbg=DarkBlue   guibg=Blue   |
... ...
@@ -485,20 +493,20 @@ autocmd vimrc VimEnter,ColorScheme,OptionSet *
485 493
 \ highlight! diffRemoved      term=NONE cterm=NONE gui=NONE ctermbg=NONE  guibg=NONE  ctermfg=DarkRed    guifg=Red    |
486 494
 
487 495
 """" Comments
488
-autocmd vimrc VimEnter,ColorScheme,OptionSet *
496
+autocmd vimrc VimEnter,ColorScheme *
489 497
 \ highlight! Comment guifg=#919191 ctermfg=Grey
490 498
 
491 499
 """" Folds
492
-autocmd vimrc VimEnter,ColorScheme,OptionSet *
500
+autocmd vimrc VimEnter,ColorScheme *
493 501
 \ highlight! link Folded Comment |
494 502
 
495 503
 """" |'listchars'|
496
-autocmd vimrc VimEnter,ColorScheme,OptionSet *
504
+autocmd vimrc VimEnter,ColorScheme *
497 505
 \ highlight! link SpecialKey Special |
498 506
 \ highlight! link NonText    Special |
499 507
 
500 508
 """" Vim comments
501
-autocmd vimrc VimEnter,ColorScheme,OptionSet *
509
+autocmd vimrc VimEnter,ColorScheme *
502 510
 \ highlight! link vimCommentString vimComment |
503 511
 \ highlight! link vimCommentTitle  vimComment |
504 512
 
... ...
@@ -565,7 +573,7 @@ if has('eval')
565 573
   GitAdd https://github.com/tpope/vim-scriptease
566 574
 
567 575
   """" `jyscao/vim-greprtpscr`
568
-  GitAdd https://github.com/jyscao/vim-greprtpscr
576
+  GitAdd! https://github.com/jyscao/vim-greprtpscr
569 577
 
570 578
   """" `vimwiki/vimwiki`
571 579
   " GitAdd https://github.com/vimwiki/vimwiki
... ...
@@ -873,12 +881,6 @@ endif
873 881
 autocmd vimrc FileType vim
874 882
 \ setlocal keywordprg=:help formatoptions-=r
875 883
 
876
-autocmd vimrc FileType help
877
-\ setlocal nolist
878
-
879
-autocmd vimrc FileType man
880
-\ setlocal nolist
881
-
882 884
 autocmd vimrc FileType c,cpp
883 885
 \ setlocal commentstring=//\ %s
884 886
 
... ...
@@ -888,10 +890,8 @@ autocmd vimrc FileType dot
888 890
 autocmd vimrc FileType markdown
889 891
 \ setlocal complete+=kspell
890 892
 
891
-autocmd vimrc FileType *
892
-\ if &buftype ==# 'nowrite' |
893
-\   setlocal nospell nolist |
894
-\ endif |
893
+autocmd vimrc FileType man
894
+\ setlocal nolist nospell
895 895
 
896 896
 " As suggested in |ft-syntax-omni|, use syntax completion if no other
897 897
 " completion has been defined.