Selaa lähdekoodia

Use `[[` in setup, Add `t_Co` vim config

`[[` supports more types of flags than `test` and `[` builtins. `t_Co`
option is put in, but commented out for when first using terminal
emulators without a solarized palette setup.
Weiyi Lou 10 vuotta sitten
vanhempi
commit
3b5620a323
2 muutettua tiedostoa jossa 20 lisäystä ja 19 poistoa
  1. 1 1
      setup.sh
  2. 19 18
      vim/settings/colorscheme-statusline.vim

+ 1 - 1
setup.sh

@@ -7,7 +7,7 @@ IFS=$'\n\t'
 
 # Backup a given file.
 backup() {
-  [ -e "$1" ] && mv "$1" "$backup_dir" || true
+  [[ -e "$1" ]] && mv "$1" "$backup_dir" || true
 }
 
 # Create links after backing up.

+ 19 - 18
vim/settings/colorscheme-statusline.vim

@@ -1,33 +1,38 @@
 " Colour Scheme & Status Line
 "
 " Available colour schemes:
-" - flattened_dark
+" - flattened (solarized clone)
 " - neonwave
 
-" Fix wrong background colour in tmux.
+" Fix wrong background colour in tmux, when using 256 colours, and when vim
+" changes the background colour.
 " http://sunaku.github.io/vim-256color-bce.html
 set t_ut=
 
+" Uncomment this to use proper solarized colours, after the terminal emulator
+" palette is properly set up.
+"set t_Co=16
+
 " Status line defaults.
 let g:airline_powerline_fonts = 1
 set laststatus=2 " always show the status line.
 set noshowmode   " hide modes e.g. --INSERT-- with themed status lines.
 set showcmd      " display partial commands on the last line
 
-function! NormalPower()
-  set background=dark
+function! Dark()
   colorscheme flattened_dark
   call SetTheme('powerlineish')
-  call MuteSpellCheckHighlights()
-  " fix sign column colour in flattened_dark (for vim-signature, syntastic).
   highlight SignColumn ctermbg=235
 endfunction
 
-function! UltraPower()
-  set background=dark
+function! Light()
+  colorscheme flattened_light
+  call SetTheme('powerlineish')
+endfunction
+
+function! Neon()
   colorscheme neonwave
   call SetTheme('surarken')
-  call MuteSpellCheckHighlights()
 endfunction
 
 function! SetTheme(name)
@@ -40,15 +45,11 @@ function! SetTheme(name)
 endfunction
 
 function! MuteSpellCheckHighlights()
-  hi clear SpellBad
-  hi SpellBad cterm=underline
+  hi clear SpellBad   | hi SpellBad cterm=underline
   " Highlights must be cleared first, or linking will fail.
-  hi clear SpellCap
-  hi link SpellCap SpellBad
-  hi clear SpellLocal
-  hi link SpellLocal SpellBad
-  hi clear SpellRare
-  hi link SpellRare SpellBad
+  hi clear SpellCap   | hi link SpellCap SpellBad
+  hi clear SpellLocal | hi link SpellLocal SpellBad
+  hi clear SpellRare  | hi link SpellRare SpellBad
 endfunction
 
-call NormalPower()
+call Dark()