Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
ujihisa
file 190 lines (172 sloc) 5.739 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
" if has('xim') && has('GUI_GTK')
" let $GTK_IM_MODULE = 'xim'
" set imactivatekey=Zenkaku_Hankaku
" set iminsert=0 imsearch=0
" endif

function! s:gvimrc_colorscheme(colors_name)
  if a:colors_name == 'luna'
    "highlight vimshellError gui=underline
    highlight vimshellError gui=undercurl
    "highlight! link vimshellError Constant
  elseif a:colors_name == 'mustang'
    highlight vimshellError gui=undercurl
  endif
endfunction

command! -nargs=1 GvimrcColorscheme colorscheme <args> | call <SID>gvimrc_colorscheme(<q-args>)
let g:unite_colorscheme_command = 'GvimrcColorscheme'

" GvimrcColorscheme koehler
" GvimrcColorscheme mrkn256
" GvimrcColorscheme lucius
GvimrcColorscheme neverland2-darker
" GvimrcColorscheme xoria256
" GvimrcColorscheme aldmeris
" GvimrcColorscheme neverland-darker
" GvimrcColorscheme luna
" GvimrcColorscheme newspaper
" GvimrcColorscheme monokai

if g:V.is_mac()
  GvimrcColorscheme macvim
  " for macvim.vim
  hi! link Error WarningMsg
  hi VertSplit gui=NONE guifg=DarkSlateGray guibg=NONE
  hi StatusLineNC gui=NONE guifg=SlateGray guibg=Gray5
  hi Pmenu guibg=LightSteelBlue1 guibg=DarkSlateGray
  hi MatchParen guifg=White guibg=Gray25
endif


"hi StatusLineNC term=underline cterm=underline gui=undercurl guibg=NONE
"hi VertSplit ctermbg=0 guifg=DarkSlateGray guibg=NONE
hi Folded guibg=NONE guifg=GRAY ctermfg=0

if g:V.is_mac()
  "set guifont=Andale\ Mono:h14
  set guifont=Menlo:h16
  "set guifontwide=Septmber-M-MonoKyohkan:h18
elseif vimproc#system('hostname') =~ '^mbr'
  let &guifont = 'Menlo Bold 9'
  let &guifontwide = 'Hiragino Kaku Gothic Pro Bold 9'
else
  "let &guifont = 'Anonymous Pro Bold 14'
  "let &guifontwide = 'Hiragino Kaku Gothic Pro Bold 12'
  let &guifont = 'Menlo Bold 10'
  let &guifontwide = 'Hiragino Kaku Gothic Pro Bold 10'
endif
let s:gvimrc_default_fonts = {
      \ 'guifont': &guifont,
      \ 'guifontwide': &guifontwide}
function! s:set_default_guifonts()
  let &guifont = s:gvimrc_default_fonts.guifont
  let &guifontwide = s:gvimrc_default_fonts.guifontwide
endfunction
nnoremap <D-0> :<C-u>call <SID>set_default_guifonts()<Cr>

if g:V.is_mac()
  set transparency=10
  let g:transparency = &transparency
endif
"set guioptions-=e
set guioptions-=T " no icons on the top of window
set guioptions-=r " no right-hand scrollbar at any time
set guioptions-=l " no left-hand scrollbar at any time
set guioptions-=L " no left-hand scrollbar at any time
set guioptions-=m " no gui menu (not for MacVim?)
set guioptions+=c " console dialogs. no popup allowed

function! s:relative_tranparency(diff)
  let &transparency = a:diff + &transparency
  let g:transparency = &transparency
endfunction

if g:V.is_mac()
  nnoremap <up> :<C-u>call <SID>relative_tranparency(5)<Cr>
  nnoremap <down> :<C-u>call <SID>relative_tranparency(-5)<Cr>
  inoremap <up> <C-o>:call <SID>relative_tranparency(5)<Cr>
  inoremap <down> <C-o>:call <SID>relative_tranparency(-5)<Cr>

  nnoremap <swipeup> :<C-u>call <SID>relative_tranparency(5)<Cr>
  nnoremap <swipedown> :<C-u>call <SID>relative_tranparency(-5)<Cr>
  inoremap <swipeup> <C-o>:call <SID>relative_tranparency(5)<Cr>
  inoremap <swipedown> <C-o>:call <SID>relative_tranparency(-5)<Cr>
endif


" http://vim-users.jp/2010/01/hack120/ {{{
let g:save_window_file = expand('~/.vimwinpos')
augroup SaveWindow
  autocmd!
  autocmd VimLeavePre * call s:save_window()
  function! s:save_window()
    let options = [
      \ 'set columns=' . &columns,
      \ 'set lines=' . &lines,
      \ 'winpos ' . getwinposx() . ' ' . getwinposy(),
      \ ]
    call writefile(options, g:save_window_file)
  endfunction
augroup END

if filereadable(g:save_window_file)
  execute 'source' g:save_window_file
endif
" }}}
" macvim specific {{{
if g:V.is_mac()
  nnoremap <SwipeLeft> gT
  nnoremap <SwipeRight> gt
  set fullscreen
  WindowsizeMaximize13
endif
if has('gui')
  " termtter {{{
  if 0
    VimShellInteractive termtter
    wincmd W
  endif
  " }}}
  VimShell
  normal! <C-u>
  redraw!
endif
" }}}
" for vimshell {{{
function! GvimrcVimshellColor()
  hi! link Error WarningMsg
endfunction
" }}}
" transparency adjustment based on window focus {{{
augroup dualvim
  autocmd!
  if has('mac')
    autocmd FocusGained * set transparency=10
    autocmd FocusLost * set transparency=50
  endif
augroup END
" }}}
" scala syntax tweaks {{{
"highlight scalaNameDefinition gui=underline
highlight scalaNameDefinition gui=italic
"hi scalaType gui=underline
"hi scalaTypeCase gui=underline
" }}}
" tabline for gui {{{
function GuiTabLabel()
  "return printf("%s/%s", expand('%:p:h:h:t'), expand('%:p:h:t'))

  " depends on kana's tabpagecd
  let cwd = get(t:, 'cwd', getcwd())
  let tmp = printf("%s/%s",
        \ fnamemodify(cwd, ':p:h:h:t'),
        \ fnamemodify(cwd, ':p:h:t'))
  return tmp . repeat(' ', 20 - len(tmp))
endfunction

set guitablabel=%!GuiTabLabel()
" }}}
" fullscreen {{{

" install winctrl for gentoo
nnoremap <M-f> :<C-u>call vimproc#system("wmctrl -r :ACTIVE: -b toggle,fullscreen")<Cr>
inoremap <M-f> <Esc>:call vimproc#system("wmctrl -r :ACTIVE: -b toggle,fullscreen")<Cr>a

if 0
  augroup gvimrc-fullscreen
    autocmd!
    autocmd VimEnter *
          \ let s:window_number =
          \ g:V.import('Data.String').chomp(matchstr(
          \ vimproc#system('wmctrl -a :ACTIVE: -v'),
          \ 'Using window: \zs0x.*'))
    autocmd VimEnter * call vimproc#system(printf("wmctrl -i -r %s -b add,fullscreen", s:window_number))
    autocmd FocusGained * echo vimproc#system(printf("wmctrl -i -r %s -b add,fullscreen", s:window_number))
    autocmd FocusLost * echo vimproc#system(printf("wmctrl -i -r %s -b remove,fullscreen", s:window_number))
  augroup END
endif
" }}}
" vim: foldmethod=marker
Something went wrong with that request. Please try again.