Procházet zdrojové kódy

Remove more vim plugins and solarized theme

More pruning of the dotfiles. Some of the plugins have been moved to our
local extra-configs as context specific things.

We also take the `papercolor` theme out of the `vim-airline` repository,
as we really don't use any of the others. Current `:Light` colour
scheme is provisional, and subject to change later, when we find
something as fantastic as Neonwave/Suraken.

Sadly, the ultimate/lightest completion system is yet to be found.
cinaeco před 6 roky
rodič
revize
5bba618d97

+ 4 - 10
README.md

@@ -14,13 +14,12 @@ Heavy preference for Vim-like bindings.
 
 ## Installation
 
-Clone to a home folder and run `make install` or `./install`.
-
-Restart the terminal session.
+Clone to a home folder and run `make install` or `./install`. Restart the
+terminal session.
 
 ## Usage
 
-Below is a non-exhaustive list of dotfiles usage.
+Below is a non-exhaustive list of dotfiles features.
 
 ### Bash/Zsh
 
@@ -46,15 +45,12 @@ Below is a non-exhaustive list of dotfiles usage.
 - `<Leader>q` closes.
 - `<Leader>l` lists loaded buffers and allows jumping to them by number.
 - `<Leader>p` fuzzy-finds files.
-- `<Leader>f` fuzzy-finds functions in the current file.
-- `<Leader>t` opens a function/variable list for the current file.
 - `<Leader>n` toggles line numbers.
 - `<Leader>c` finds VCS conflict markers.
 - `-` opens a file browser.
 - Additional text objects exist (see `'Text Objects'` in [plugins.vim][]).
-- Saving `.pandoc` files also outputs `.docx` versions.
 - `:Goyo` for distraction-free writing.
-- `:Alduin`, `:Dark`, `:Light` and `:Neon` colour schemes available.
+- `:Dark`, `:Light` colour schemes available.
 - Custom plugins can be listed in `~/.vim/plugins.vim.local`.
 - Custom settings can be put in `.vim.local` files in `~/.vim/settings/`, or in
   a `~/.vim/settings/local/` directory.
@@ -91,14 +87,12 @@ These dotfiles provide a dark theme and the following binding changes:
 
 ## Recommended
 
-- Colour palette: [Solarized][].
 - Font: [Meslo for Powerline][] (works well with [Rainbarf][]).
 - Vim with Ruby/Python support, or Neovim: for [Vim-Plug][] parallel downloads.
 - [Ripgrep][] - fast text search ([Ack][] included as fallback).
 - [Pandoc][] - Vim creates documents from `.pandoc` files ([Pandoc Markdown][]).
 - [pandoc-citeproc][] - bibliographical assistance when using Pandoc.
 
-[Solarized]: http://ethanschoonover.com/solarized
 [Meslo for Powerline]: https://github.com/powerline/fonts
 [Rainbarf]: https://github.com/creaktive/rainbarf
 [Vim-Plug]: https://github.com/junegunn/vim-plug

+ 1 - 0
bin/v

@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+# Copyright (c) 2011 rupa deadwyler. Licensed under the WTFPL license, Version 2
 
 [ "$vim" ] || vim=vim
 [ $viminfo ] || viminfo=~/.viminfo

+ 65 - 0
vim/autoload/airline/themes/papercolor.vim

@@ -0,0 +1,65 @@
+let g:airline#themes#papercolor#palette = {}
+
+let g:airline#themes#papercolor#palette.accents = {
+      \ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
+      \ }
+
+" Normal Mode:
+let s:N1 = [ '#585858' , '#e4e4e4' , 240 , 254 ] " Mode
+let s:N2 = [ '#e4e4e4' , '#0087af' , 254 , 31  ] " Info
+let s:N3 = [ '#eeeeee' , '#005f87' , 255 , 24  ] " StatusLine
+
+
+let g:airline#themes#papercolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
+let g:airline#themes#papercolor#palette.normal_modified = {
+      \ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] ,
+      \ }
+
+
+" Insert Mode:
+let s:I1 = [ '#585858' , '#e4e4e4' , 240 , 254 ] " Mode
+let s:I2 = [ '#e4e4e4' , '#0087af' , 254 , 31  ] " Info
+let s:I3 = [ '#eeeeee' , '#005f87' , 255 , 24  ] " StatusLine
+
+
+let g:airline#themes#papercolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
+let g:airline#themes#papercolor#palette.insert_modified = {
+      \ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] ,
+      \ }
+
+
+" Replace Mode:
+let g:airline#themes#papercolor#palette.replace = copy(g:airline#themes#papercolor#palette.insert)
+let g:airline#themes#papercolor#palette.replace.airline_a = [ '#d7005f'   , '#e4e4e4' , 161 , 254, ''     ]
+let g:airline#themes#papercolor#palette.replace_modified = {
+      \ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] ,
+      \ }
+
+
+" Visual Mode:
+let s:V1 = [ '#005f87', '#e4e4e4', 24,  254 ]
+let s:V2 = [ '',        '#0087af', '',  31  ]
+let s:V3 = [ '#e4e4e4', '#005f87', 254, 24  ]
+
+let g:airline#themes#papercolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
+let g:airline#themes#papercolor#palette.visual_modified = {
+      \ 'airline_c': [ '#e4e4e4', '#005f87', 254, 24  ] ,
+      \ }
+
+" Inactive:
+let s:IA = [ '#585858' , '#e4e4e4' , 240 , 254 , '' ]
+let g:airline#themes#papercolor#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
+let g:airline#themes#papercolor#palette.inactive_modified = {
+      \ 'airline_c': [ '#585858' , '#e4e4e4' , 240 , 254 , '' ] ,
+      \ }
+
+
+" CtrlP:
+if !get(g:, 'loaded_ctrlp', 0)
+  finish
+endif
+let g:airline#themes#papercolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
+      \ [ '#e4e4e4' , '#005f87' , 254 , 24  , ''     ] ,
+      \ [ '#e4e4e4' , '#0087af' , 254 , 31  , ''     ] ,
+      \ [ '#585858' , '#e4e4e4' , 240 , 254 , 'bold' ] )
+

+ 9 - 11
vim/autoload/plug.vim

@@ -434,8 +434,8 @@ endfunction
 
 function! s:dobufread(names)
   for name in a:names
-    let path = s:rtp(g:plugs[name]).'/**'
-    for dir in ['ftdetect', 'ftplugin']
+    let path = s:rtp(g:plugs[name])
+    for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin']
       if len(finddir(dir, path))
         if exists('#BufRead')
           doautocmd BufRead
@@ -794,9 +794,7 @@ endfunction
 
 function! s:chsh(swap)
   let prev = [&shell, &shellcmdflag, &shellredir]
-  if s:is_win
-    set shell=cmd.exe shellcmdflag=/c shellredir=>%s\ 2>&1
-  elseif a:swap
+  if !s:is_win && a:swap
     set shell=sh shellredir=>%s\ 2>&1
   endif
   return prev
@@ -811,7 +809,7 @@ function! s:bang(cmd, ...)
     if s:is_win
       let batchfile = tempname().'.bat'
       call writefile(["@echo off\r", cmd . "\r"], batchfile)
-      let cmd = batchfile
+      let cmd = s:shellesc(expand(batchfile))
     endif
     let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%')
     execute "normal! :execute g:_plug_bang\<cr>\<cr>"
@@ -1210,7 +1208,7 @@ function! s:spawn(name, cmd, opts)
   let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd
   if !empty(job.batchfile)
     call writefile(["@echo off\r", cmd . "\r"], job.batchfile)
-    let cmd = job.batchfile
+    let cmd = s:shellesc(expand(job.batchfile))
   endif
   let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd)
 
@@ -2037,9 +2035,9 @@ function! s:system(cmd, ...)
     if s:is_win
       let batchfile = tempname().'.bat'
       call writefile(["@echo off\r", cmd . "\r"], batchfile)
-      let cmd = batchfile
+      let cmd = s:shellesc(expand(batchfile))
     endif
-    return system(s:is_win ? '('.cmd.')' : cmd)
+    return system(cmd)
   finally
     let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd]
     if s:is_win
@@ -2224,7 +2222,7 @@ function! s:upgrade()
   let new = tmp . '/plug.vim'
 
   try
-    let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp))
+    let out = s:system(printf('git clone --depth 1 %s %s', s:shellesc(s:plug_src), s:shellesc(tmp)))
     if v:shell_error
       return s:err('Error upgrading vim-plug: '. out)
     endif
@@ -2371,7 +2369,7 @@ function! s:preview_commit()
     if s:is_win
       let batchfile = tempname().'.bat'
       call writefile(["@echo off\r", cmd . "\r"], batchfile)
-      let cmd = batchfile
+      let cmd = expand(batchfile)
     endif
     execute 'silent %!' cmd
   finally

+ 2 - 19
vim/plugins.vim

@@ -8,12 +8,10 @@ silent! call plug#begin('~/dotfiles/vim/plugged')
 " General {{{
 Plug 'Raimondi/delimitMate'
 Plug 'adelarsq/vim-matchit'
-Plug 'dkprice/vim-easygrep'
 Plug 'haya14busa/vim-asterisk'
 Plug 'junegunn/vim-easy-align'
 Plug 'mbbill/undotree'
 Plug 'scrooloose/nerdcommenter'
-Plug 'terryma/vim-multiple-cursors'
 Plug 'tpope/vim-endwise'
 Plug 'tpope/vim-fugitive'
 Plug 'tpope/vim-repeat'
@@ -25,24 +23,17 @@ endif
 " }}}
 
 " Visual {{{
-Plug 'AlessandroYorba/Alduin'
-Plug 'altercation/vim-colors-solarized'
 Plug 'cinaeco/airline-surarken'
 Plug 'cinaeco/neonwave.vim'
+Plug 'sainnhe/vim-color-vanilla-cake'
 Plug 'junegunn/goyo.vim'
 Plug 'junegunn/limelight.vim'
 Plug 'vim-airline/vim-airline'
-Plug 'vim-airline/vim-airline-themes'
 " }}}
 
 " Text Objects {{{
-" `,` to work with camel/snake case e.g. `ci,w`
-" `e` to work with whole files e.g. `=ae`
 " `s` to work with surrounds e.g. `cs{[`
 " `a` to work with arguments e.g. `cia`
-Plug 'bkad/CamelCaseMotion'
-Plug 'kana/vim-textobj-entire'
-Plug 'kana/vim-textobj-user'
 Plug 'tpope/vim-surround'
 Plug 'vim-scripts/argtextobj.vim'
 " }}}
@@ -59,11 +50,7 @@ endif
 " }}}
 
 " Completion and Snippets {{{
-if v:version >= 704 || (v:version == 703 && has('insert_expand') && has('menu'))
-  Plug 'lifepillar/vim-mucomplete'
-else
-  Plug 'ajh17/VimCompletesMe'
-endif
+Plug 'ajh17/VimCompletesMe'
 " }}}
 
 " Coding Language Support {{{
@@ -74,10 +61,6 @@ if v:version > 700 || (v:version == 700 && has('patch175'))
 endif
 " }}}
 
-" Language Support {{{
-Plug 'reedes/vim-wordy'
-" }}}
-
 " Local Plugins {{{
 if filereadable(expand("~/dotfiles/vim/plugins.vim.local"))
   source ~/dotfiles/vim/plugins.vim.local

+ 5 - 33
vim/settings/colorscheme-statusline.vim

@@ -12,44 +12,21 @@ set t_ut=
 " The colour command that was last run.
 let g:current_colour = expand('~/dotfiles/vim/current-colour')
 
-" Mark if the proper solarized colour palette mode should be used.
-let g:solarized_palette = expand('~/dotfiles/vim/use-solarized-palette')
-
 " Status line defaults.
 let g:airline#extensions#wordcount#filetypes = '\vhelp|markdown|rst|org|pandoc'
 set noshowmode   " hide modes e.g. --INSERT-- with themed status lines.
 
 " Toggle colour schemes.
-command! Alduin let g:alduin_Contract_Vampirism = 1
-      \| colorscheme alduin
-      \| call StatusTheme('ubaryd')
-      \| call writefile(['Alduin'], g:current_colour)
-
-command! Dark set background=dark
-      \| colorscheme solarized
-      \| call StatusTheme('powerlineish')
-      \| highlight SignColumn ctermbg=235
+command! Dark set background=light
+      \| colorscheme neonwave
+      \| call StatusTheme('surarken')
       \| call writefile(['Dark'], g:current_colour)
 
 command! Light set background=light
-      \| colorscheme solarized
+      \| colorscheme vanilla-cake
       \| call StatusTheme('papercolor')
       \| call writefile(['Light'], g:current_colour)
 
-command! Neon set background=light
-      \| colorscheme neonwave
-      \| call StatusTheme('surarken')
-      \| call writefile(['Neon'], g:current_colour)
-
-" Toggle Solarized Colour Palette Degradation.
-command! SolarizedColourProper execute 'silent !touch' g:solarized_palette
-      \| let g:solarized_termcolors=16
-      \| execute 'source' g:current_colour
-
-command! SolarizedColourDegraded execute 'silent !rm' g:solarized_palette
-      \| let g:solarized_termcolors=256
-      \| execute 'source' g:current_colour
-
 function! StatusTheme(name)
   " Airline functions are not available at vim start.
   if exists(':AirlineTheme')
@@ -70,14 +47,9 @@ function! CustomHighlights()
   highlight clear SpellRare  | highlight link SpellRare SpellBad
 endfunction
 
-" Default to degraded solarized to avoid bad colours on new machines.
-if !filereadable(g:solarized_palette)
-  let g:solarized_termcolors=256
-endif
-
 " Use the last chosen colour scheme or default to a dark colorscheme.
 if filereadable(expand(g:current_colour))
   execute 'source' g:current_colour
 else
-  Alduin
+  Dark
 endif

+ 0 - 14
vim/settings/mucomplete.vim

@@ -1,14 +0,0 @@
-if v:version >= 704 || (v:version == 703 && has('insert_expand') && has('menu'))
-  " Suggested settings.
-  " Use menus always. No messages for insert mode completion menu.
-  set completeopt+=menu,menuone
-  if v:version >= 704 && has('patch314')
-    set shortmess+=c
-  endif
-
-  " Automatic Completion for 7.4+.
-  if v:version >= 704 && has('patch775')
-    set completeopt+=noinsert,noselect
-    let g:mucomplete#enable_auto_at_startup = 1
-  endif
-endif

+ 0 - 2
vim/settings/textobjects.vim

@@ -1,2 +0,0 @@
-" Use ',' instead of '<leader>' for camel/snake case
-execute camelcasemotion#CreateMotionMappings(',')