.vimrc_noplugin 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. " coding:utf-8
  2. " ζ*'ヮ')ζ ζ(*'ヮ'リ+
  3. "
  4. set ignorecase
  5. set smartcase
  6. set tabstop=2
  7. set expandtab
  8. set autoindent
  9. set backspace=2
  10. set wrapscan
  11. set showmatch
  12. set wildmenu
  13. set formatoptions+=mM
  14. set softtabstop=2
  15. set shiftwidth=4
  16. set fileencodings=utf-8,sjis,cp932,euc-jp,default,latin
  17. set number
  18. set ruler
  19. set nolist
  20. set wrap
  21. set laststatus=2
  22. set cmdheight=2
  23. set showcmd
  24. set title
  25. set hlsearch
  26. syntax on
  27. " ファイル名に大文字小文字の区別がないシステム用の設定:
  28. " (例: DOS/Windows/MacOS)
  29. "
  30. if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
  31. " tagsファイルの重複防止
  32. set tags=./tags,tags
  33. endif
  34. " コンソールでのカラー表示のための設定(暫定的にUNIX専用)
  35. if has('unix') && !has('gui_running')
  36. let uname = system('uname')
  37. if uname =~? "linux"
  38. set term=builtin_linux
  39. elseif uname =~? "freebsd"
  40. set term=builtin_cons25
  41. elseif uname =~? "Darwin"
  42. set term=beos-ansi
  43. else
  44. set term=builtin_xterm
  45. endif
  46. unlet uname
  47. endif
  48. " コンソール版で環境変数$DISPLAYが設定されていると起動が遅くなる件へ対応
  49. if !has('gui_running') && has('xterm_clipboard')
  50. set clipboard=exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen
  51. endif
  52. " タブページの切り替えをWindowsのように
  53. " CTRL+Tab SHIFT+Tabで行うように.
  54. if v:version >= 700
  55. nnoremap <C-Tab> gt
  56. nnoremap <C-S-Tab> gT
  57. endif
  58. if has('+regexpengine')
  59. set re=0
  60. endif
  61. set nocompatible
  62. set ww+=h,l,>,<,[,]
  63. set mouse=a
  64. set ttymouse=xterm2
  65. set clipboard=unnamedplus
  66. " ,vr: .vimrc
  67. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  68. nnoremap <silent> ,so :so ~/.vimrc<CR>
  69. nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
  70. "tabで補完候補の選択を行う
  71. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  72. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  73. let g:netrw_nogx = 1
  74. augroup vimrc
  75. autocmd!
  76. augroup END
  77. function! s:SID_PREFIX()
  78. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  79. endfunction
  80. set titlelen=100
  81. set guioptions-=e
  82. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  83. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  84. if exists('$TMUX') || exists('$WINDOW')
  85. set t_ts=k
  86. set t_fs=\
  87. endif
  88. function! s:titlestring()
  89. if &filetype =~ '^lingr'
  90. let &titlestring = 'lingr: ' . lingr#unread_count()
  91. else
  92. let &titlestring = bufname('')
  93. endif
  94. endfunction
  95. " tabline
  96. set showtabline=2 " always show tabline
  97. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  98. function! s:tabline()
  99. " show each tab
  100. let s = ''
  101. for i in range(1, tabpagenr('$'))
  102. let list = tabpagebuflist(i)
  103. let nr = tabpagewinnr(i)
  104. let current_tabnr = tabpagenr()
  105. "let title = bufname('')
  106. if i == current_tabnr
  107. let title = fnamemodify(getcwd(), ':t') . '/'
  108. "let title = bufname('')
  109. else
  110. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  111. endif
  112. let title = empty(title) ? '[No Name]' : title
  113. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  114. let s .= '%' . i . 'T[' . i . '] ' . title
  115. let s .= ' '
  116. endfor
  117. " show lingr unread count
  118. let lingr_unread = ""
  119. if exists('*lingr#unread_count')
  120. let lingr_unread_count = lingr#unread_count()
  121. if lingr_unread_count > 0
  122. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  123. elseif lingr_unread_count == 0
  124. let lingr_unread = "()"
  125. endif
  126. endif
  127. " build tabline
  128. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  129. return s
  130. endfunction