Skip to content

Instantly share code, notes, and snippets.

@844196
Created January 17, 2015 04:13
Show Gist options
  • Save 844196/1cdff35afc617daabedf to your computer and use it in GitHub Desktop.
Save 844196/1cdff35afc617daabedf to your computer and use it in GitHub Desktop.
solarizedのdarkとlightをトグルできるやつ
function! s:Toggle_iTerm_BG(bg)
if !has('gui_running')
let s:command = '/usr/bin/osascript ~/Library/Application\ Support/iTerm/Scripts/Solarized\ ' . a:bg . '.scpt'
call vimproc#system_bg('/usr/bin/osascript ~/Library/Application\ Support/iTerm/Scripts/Toggle\ Solarized.scpt')
call vimproc#system_bg(s:command)
endif
endfunction
function! Toggle_BG()
if &background =~# 'light'
set bg=dark
call s:Toggle_iTerm_BG('dark')
else
set bg=light
call s:Toggle_iTerm_BG('light')
endif
endfunction
nnoremap <silent><space>so :<C-u>call Toggle_BG()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment