~gpanders/dotfiles

ff06c28eb618f8a590e3dd3e621ade7800dd73f3 — Greg Anders 1 year, 11 months ago 4ffc026
Vim tweaks

- Use simplified fork of base16-vim
- Simplify mail ftplugin and add (some) markdown syntax to mail buffers
- Decouple fugitive dependency for fzy git ls-files
- Set 'backup' and change 'breakat' settings
- Remove wildignore.vim plugin
M vim/.vim/after/ftplugin/mail.vim => vim/.vim/after/ftplugin/mail.vim +0 -20
@@ 11,23 11,3 @@ let b:undo_ftplugin .= '|setl fo< wm< nu< list< spell<'

let b:highlight_trailing_whitespace = 0
let b:undo_ftplugin .= '|unlet! b:highlight_trailing_whitespace'

" See https://en.wikipedia.org/wiki/Posting_style
if !exists('g:mail_posting_style')
    let g:mail_posting_style = 'top'
endif

augroup mail
    autocmd!
    if !&readonly && &modifiable
        " Place cursor in writing position and start insert mode
        if g:mail_posting_style ==# 'top'
            autocmd BufWinEnter <buffer> exe "normal! }2o\<Esc>k" | startinsert
        elseif g:mail_posting_style ==# 'bottom'
            autocmd BufWinEnter <buffer> exe "normal! G2o\<Esc>" | startinsert
        else
            echohl Error | echom 'Unknown value for g:mail_posting_style' | echohl None
        endif
    endif
augroup END
let b:undo_ftplugin .= '|au! mail * <buffer>'

A vim/.vim/after/syntax/mail.vim => vim/.vim/after/syntax/mail.vim +18 -0
@@ 0,0 1,18 @@
syn region mailItalic matchgroup=mailItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=mailLineStart,@Spell
syn region mailItalic matchgroup=mailItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=mailLineStart,@Spell
syn region mailBold matchgroup=mailBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=mailLineStart,mailItalic,@Spell
syn region mailBold matchgroup=mailBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=mailLineStart,mailItalic,@Spell
syn region mailBoldItalic matchgroup=mailBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=mailLineStart,@Spell
syn region mailBoldItalic matchgroup=mailBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=mailLineStart,@Spell

hi def mailBold                term=bold cterm=bold gui=bold
hi def mailBoldUnderline       term=bold,underline cterm=bold,underline gui=bold,underline
hi def mailBoldItalic          term=bold,italic cterm=bold,italic gui=bold,italic
hi def mailBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
hi def mailUnderline           term=underline cterm=underline gui=underline
hi def mailUnderlineItalic     term=italic,underline cterm=italic,underline gui=italic,underline
hi def mailItalic              term=italic cterm=italic gui=italic

hi def link mailItalicDelimiter       mailItalic
hi def link mailBoldDelimiter         mailBold
hi def link mailBoldItalicDelimiter   mailBoldItalic

M vim/.vim/colors/base16-eighties.vim => vim/.vim/colors/base16-eighties.vim +0 -6
@@ 20,12 20,6 @@ if exists('*g:Base16hi')
  call g:Base16hi('StatuslineModeInsert', g:base16_gui0D, '', g:base16_cterm0D, '')
  call g:Base16hi('StatuslineModeReplace', g:base16_gui08, '', g:base16_cterm08, '')
  call g:Base16hi('StatuslineModeVisual', g:base16_gui0E, '', g:base16_cterm0E, '')

  call g:Base16hi('SpellBad', '', '', g:base16_cterm08, 'NONE')
  call g:Base16hi('SpellCap', '', '', g:base16_cterm0D, 'NONE')
  call g:Base16hi('SpellRare', '', '', g:base16_cterm0E, 'NONE')
  call g:Base16hi('SpellLocal', '', '', g:base16_cterm0C, 'NONE')
  call g:Base16hi('WildMenu', g:base16_gui07, g:base16_gui02, g:base16_cterm07, g:base16_cterm02)
endif

unlet g:did_user_colors

M vim/.vim/colors/base16-onedark.vim => vim/.vim/colors/base16-onedark.vim +0 -6
@@ 22,12 22,6 @@ if exists('*g:Base16hi')
  call g:Base16hi('StatuslineModeInsert', g:base16_gui0D, '', g:base16_cterm0D, '')
  call g:Base16hi('StatuslineModeReplace', g:base16_gui08, '', g:base16_cterm08, '')
  call g:Base16hi('StatuslineModeVisual', g:base16_gui0E, '', g:base16_cterm0E, '')

  call g:Base16hi('SpellBad', '', '', g:base16_cterm08, 'NONE')
  call g:Base16hi('SpellCap', '', '', g:base16_cterm0D, 'NONE')
  call g:Base16hi('SpellRare', '', '', g:base16_cterm0E, 'NONE')
  call g:Base16hi('SpellLocal', '', '', g:base16_cterm0C, 'NONE')
  call g:Base16hi('WildMenu', g:base16_gui0B, g:base16_gui02, g:base16_cterm0B, g:base16_cterm02)
endif

unlet g:did_user_colors

M vim/.vim/colors/base16-tomorrow.vim => vim/.vim/colors/base16-tomorrow.vim +0 -6
@@ 20,12 20,6 @@ if exists('*g:Base16hi')
  call g:Base16hi('StatuslineModeInsert', g:base16_gui0D, '', g:base16_cterm0D, '')
  call g:Base16hi('StatuslineModeReplace', g:base16_gui08, '', g:base16_cterm08, '')
  call g:Base16hi('StatuslineModeVisual', g:base16_gui0E, '', g:base16_cterm0E, '')

  call g:Base16hi('SpellBad', '', '', g:base16_cterm08, 'NONE')
  call g:Base16hi('SpellCap', '', '', g:base16_cterm0D, 'NONE')
  call g:Base16hi('SpellRare', '', '', g:base16_cterm0E, 'NONE')
  call g:Base16hi('SpellLocal', '', '', g:base16_cterm0C, 'NONE')
  call g:Base16hi('WildMenu', g:base16_gui08, g:base16_gui02, g:base16_cterm08, 'NONE')
endif

unlet g:did_user_colors

M vim/.vim/plugin/ale.vim => vim/.vim/plugin/ale.vim +0 -2
@@ 11,5 11,3 @@ let g:ale_lint_on_text_changed = 'normal'
let g:ale_set_highlights = 0

let g:ale_completion_enabled = 0

silent! packadd ale

M vim/.vim/plugin/fzy.vim => vim/.vim/plugin/fzy.vim +13 -4
@@ 7,10 7,13 @@ if exists('g:loaded_fzy') || !executable('fzy')
endif
let g:loaded_fzy = 1

let s:save_cpo = &cpo
set cpo&vim

if executable('fd')
    let g:fzy_find_files_cmd = 'fd --type f --hidden --exclude .git'
    let g:fzy_find_files_cmd = 'fd --type f'
elseif executable('rg')
    let g:fzy_find_files_cmd = 'rg --files --hidden --glob !.git'
    let g:fzy_find_files_cmd = 'rg --files'
elseif executable('ag')
    let g:fzy_find_files_cmd = 'ag -g '''''
elseif executable('find')


@@ 19,9 22,15 @@ endif

augroup plugin.fzy
    autocmd!
    " If in a git repo and using vim-fugitive, use git ls-files
    autocmd User Fugitive let b:fzy_find_files_cmd = 'git ls-files -co --exclude-standard'
    " If in a git repo use git ls-files
    autocmd BufReadPost *
                \ if get(systemlist('git rev-parse --is-inside-work-tree'), 0, '') ==# 'true' |
                \   let b:fzy_find_files_cmd = 'git ls-files -co --exclude-standard' |
                \ endif
augroup END

nnoremap <silent> <C-P> :call fzy#files()<CR>
nnoremap <silent> <Space>] :call fzy#tags()<CR>

let &cpo = s:save_cpo
unlet s:save_cpo

M vim/.vim/plugin/minpac.vim => vim/.vim/plugin/minpac.vim +2 -2
@@ 67,10 67,10 @@ function! s:PackInit()
        " call minpac#add('neoclide/coc.nvim', {'type': 'opt', 'rev': 'release'})

        " Asynchronous linting
        call minpac#add('dense-analysis/ale', {'type': 'opt'})
        call minpac#add('dense-analysis/ale')

        " Colorschemes
        call minpac#add('chriskempson/base16-vim', {'type': 'opt'})
        call minpac#add('gpanders/base16-vim', {'type': 'opt'})
    endif
endfunction


D vim/.vim/plugin/wildignore.vim => vim/.vim/plugin/wildignore.vim +0 -180
@@ 1,180 0,0 @@
" Author: Tom Ryder

" Don't complete certain files that I'm not likely to want to manipulate from
" within Vim; this is kind of expensive to reload, so I've made it a plugin
" with a load guard
if &compatible || v:version < 700 || !has('wildignore')
  finish
endif
if exists('g:loaded_wildmenu')
  finish
endif
let g:loaded_wildmenu = 1

" Helper function for local scope
function! s:Wildignore() abort

  " New empty array
  let l:ignores = []

  " Archives
  let l:ignores += [
        \ '*.7z',
        \ '*.bz2',
        \ '*.gz',
        \ '*.jar',
        \ '*.rar',
        \ '*.tar',
        \ '*.xz',
        \ '*.zip',
        \ ]

  " Java
  let l:ignores += [
        \ '*.class',
        \ ]

  " Python
  let l:ignores += [
          \ '*.pyc',
          \ '__pycache__',
          \ ]

  " Databases
  let l:ignores += [
        \ '*.db',
        \ '*.dbm',
        \ '*.sdbm',
        \ '*.sqlite',
        \ ]

  " Disk
  let l:ignores += [
        \ '*.adf',
        \ '*.bin',
        \ '*.hdf',
        \ '*.iso',
        \ ]

  " Documents
  let l:ignores += [
        \ '*.docx',
        \ '*.djvu',
        \ '*.odp',
        \ '*.ods',
        \ '*.odt',
        \ '*.pdf',
        \ '*.ppt',
        \ '*.xls',
        \ '*.xlsx',
        \ ]

  " Encrypted
  let l:ignores += [
        \ '*.asc',
        \ '*.gpg',
        \ ]

  " Executables
  let l:ignores += [
        \ '*.exe',
        \ ]

  " Fonts
  let l:ignores += [
        \ '*.ttf',
        \ ]

  " Images
  let l:ignores += [
        \ '*.bmp',
        \ '*.gd2',
        \ '*.gif',
        \ '*.ico',
        \ '*.jpeg',
        \ '*.jpg',
        \ '*.pbm',
        \ '*.png',
        \ '*.psd',
        \ '*.tga',
        \ '*.xbm',
        \ '*.xcf',
        \ '*.xpm',
        \ ]

  " Incomplete
  let l:ignores += [
        \ '*.filepart',
        \ ]

  " Objects
  let l:ignores += [
        \ '*.a',
        \ '*.o',
        \ ]

  " Sound
  let l:ignores += [
        \ '*.au',
        \ '*.aup',
        \ '*.flac',
        \ '*.mid',
        \ '*.m4a',
        \ '*.mp3',
        \ '*.ogg',
        \ '*.opus',
        \ '*.s3m',
        \ '*.wav',
        \ ]

  " System-specific
  let l:ignores += [
        \ '.DS_Store',
        \ ]

  " Translation
  let l:ignores += [
        \ '*.gmo',
        \ ]

  " Version control
  let l:ignores += [
        \ '.git',
        \ '.hg',
        \ '.svn',
        \ ]

  " Video
  let l:ignores += [
        \ '*.avi',
        \ '*.gifv',
        \ '*.mp4',
        \ '*.ogv',
        \ '*.rm',
        \ '*.swf',
        \ '*.webm',
        \ ]

  " Vim
  let l:ignores += [
        \ '*~',
        \ '*.swp',
        \ ]

  " If on a system where case matters for filenames  for any that had
  " lowercase letters  add their uppercase analogues
  if has('fname_case')
    for l:ignore in l:ignores
      if l:ignore =~# '\l'
        call add(l:ignores, toupper(l:ignore))
      endif
    endfor
  endif

  " Return the completed setting
  return join(l:ignores, ',')

endfunction

" Run helper function just defined
let &wildignore = s:Wildignore()

M vim/.vim/vimrc => vim/.vim/vimrc +2 -2
@@ 1,5 1,4 @@
" Greg Anders (gpanders)'s vimrc <https://github.com/gpanders/dotfiles.git>
scriptencoding utf8

" Normalization {{{
if !has('nvim')


@@ 109,6 108,7 @@ highlight link TrailingWhitespace Error
" }}}

" Settings {{{
set backup
set confirm
set cursorline
set expandtab


@@ 161,7 161,7 @@ let &colorcolumn = '+' . join(range(1, 256), ',+')
" Indent wrapped lines
if has('linebreak')
  set breakindent
  set showbreak=↪\ 
  set showbreak=>\ 
endif

" Specify whitespace chars