.vimrc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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. filetype off
  63. if has('vim_starting')
  64. set runtimepath+=~/.vim/neobundle.vim.git
  65. endif
  66. call neobundle#rc(expand('~/.bundle'))
  67. NeoBundle 'Shougo/echodoc', '', 'default'
  68. call neobundle#config('echodoc', {
  69. \ 'lazy' : 1,
  70. \ 'autoload' : {
  71. \ 'insert' : 1,
  72. \ }})
  73. NeoBundle 'Shougo/neocomplcache', '', 'default'
  74. call neobundle#config('neocomplcache', {
  75. \ 'lazy' : 1,
  76. \ 'autoload' : {
  77. \ 'commands' : 'NeoComplCacheEnable',
  78. \ }})
  79. NeoBundle 'Shougo/neocomplcache-rsense', '', 'default'
  80. call neobundle#config('neocomplcache-rsense', {
  81. \ 'lazy' : 1,
  82. \ 'depends' : 'Shougo/neocomplcache',
  83. \ 'autoload' : { 'filetypes' : 'ruby' }
  84. \ })
  85. NeoBundle 'Shougo/neobundle.vim'
  86. NeoBundle 'Shougo/unite.vim', '', 'default'
  87. call neobundle#config('unite.vim',{
  88. \ 'lazy' : 1,
  89. \ 'autoload' : {
  90. \ 'commands' : [{ 'name' : 'Unite',
  91. \ 'complete' : 'customlist,unite#complete_source'},
  92. \ 'UniteWithCursorWord', 'UniteWithInput']
  93. \ }})
  94. NeoBundle 'Shougo/vimfiler', '', 'default'
  95. call neobundle#config('vimfiler', {
  96. \ 'lazy' : 1,
  97. \ 'depends' : 'Shougo/unite.vim',
  98. \ 'autoload' : {
  99. \ 'commands' : [
  100. \ { 'name' : 'VimFiler',
  101. \ 'complete' : 'customlist,vimfiler#complete' },
  102. \ { 'name' : 'VimFilerExplorer',
  103. \ 'complete' : 'customlist,vimfiler#complete' },
  104. \ { 'name' : 'Edit',
  105. \ 'complete' : 'customlist,vimfiler#complete' },
  106. \ { 'name' : 'Write',
  107. \ 'complete' : 'customlist,vimfiler#complete' },
  108. \ 'Read', 'Source'],
  109. \ 'mappings' : ['<Plug>(vimfiler_switch)'],
  110. \ 'explorer' : 1,
  111. \ }
  112. \ })
  113. NeoBundle 'Shougo/vimshell', '', 'default'
  114. call neobundle#config('vimshell', {
  115. \ 'lazy' : 1,
  116. \ 'autoload' : {
  117. \ 'commands' : [{ 'name' : 'VimShell',
  118. \ 'complete' : 'customlist,vimshell#complete'},
  119. \ 'VimShellExecute', 'VimShellInteractive',
  120. \ 'VimShellTerminal', 'VimShellPop'],
  121. \ 'mappings' : ['<Plug>(vimshell_switch)']
  122. \ }})
  123. NeoBundle 'Shougo/vimproc', '', 'default'
  124. call neobundle#config('vimproc', {
  125. \ 'build' : {
  126. \ 'windows' : 'make -f make_mingw32.mak',
  127. \ 'cygwin' : 'make -f make_cygwin.mak',
  128. \ 'mac' : 'make -f make_mac.mak',
  129. \ 'unix' : 'make -f make_unix.mak',
  130. \ },
  131. \ })
  132. NeoBundleLazy 'thinca/vim-quickrun', { 'autoload' : {
  133. \ 'mappings' : [
  134. \ ['nxo', '<Plug>(quickrun)']],
  135. \ }}
  136. NeoBundle 'tsukkee/lingr-vim'
  137. call neobundle#config('lingr-vim', {
  138. \ 'lazy' : 1,
  139. \ 'autoload' : {
  140. \ 'commands' : 'LingrLaunch',
  141. \ },
  142. \ })
  143. NeoBundle 'Shougo/neosnippet', '', 'default'
  144. call neobundle#config('neosnippet', {
  145. \ 'lazy' : 1,
  146. \ 'autoload' : {
  147. \ 'insert' : 1,
  148. \ 'filetypes' : 'snippet',
  149. \ 'unite_sources' : ['snippet', 'neosnippet/user', 'neosnippet/runtime'],
  150. \ }})
  151. NeoBundle 'browser.vim'
  152. NeoBundle 'synmark.vim'
  153. NeoBundleLazy 'tyru/open-browser.vim', { 'autoload' : {
  154. \ 'mappings' : '<Plug>(open-browser-wwwsearch)',
  155. \ }}
  156. NeoBundle 'mattn/gist-vim'
  157. NeoBundle 'mattn/webapi-vim'
  158. NeoBundle 'mru.vim'
  159. NeoBundle 'thinca/vim-ft-clojure'
  160. NeoBundleLazy 'ujihisa/neco-ghc', { 'autoload' : {
  161. \ 'filetypes' : 'haskell',
  162. \ }}
  163. NeoBundle 'sudo.vim'
  164. NeoBundleLazy 'ujihisa/vimshell-ssh', { 'autoload' : {
  165. \ 'filetypes' : 'vimshell',
  166. \ }}
  167. NeoBundle 'Shougo/unite-ssh'
  168. NeoBundle 'ujihisa/neco-look'
  169. NeoBundle 'vim-jp/vital.vim', '', 'default'
  170. call neobundle#config('vital.vim', {
  171. \ 'lazy' : 1,
  172. \ 'autoload' : {
  173. \ 'commands' : ['Vitalize'],
  174. \ }})
  175. NeoBundleLazy 'dag/vim2hs', { 'autoload' : {
  176. \ 'filetypes' : 'haskell',
  177. \ }}
  178. NeoBundleLazy 'eagletmt/ghcmod-vim', { 'autoload' : {
  179. \ 'filetypes' : 'haskell',
  180. \ }}
  181. NeoBundle 'thinca/vim-ref'
  182. NeoBundle 'thinca/vim-singleton'
  183. NeoBundle 'mattn/benchvimrc-vim'
  184. NeoBundle 'ryutorion/vim-itunes'
  185. NeoBundle 'raa0121/vim-ulilith'
  186. NeoBundle 'mattn/libcallex-vim'
  187. NeoBundle 'thinca/vim-splash'
  188. NeoBundle 'mattn/sonictemplate-vim'
  189. NeoBundle 'raa0121/vim-eclim'
  190. NeoBundle 'thinca/vim-github'
  191. NeoBundle 'nosami/Omnisharp'
  192. NeoBundle 'jceb/vim-orgmode'
  193. "NeoBundle 'Lokaltog/powerline', { 'rtp' : 'powerline/bindings/vim'}
  194. "NeoBundle 'taichouchou2/alpaca_powertabline'
  195. "NeoBundle 'zhaocai/linepower.vim'
  196. NeoBundle 'osyo-manga/quickrun-hook-u-nya-'
  197. NeoBundle 'osyo-manga/unite-quickfix'
  198. NeoBundle 'basyura/J6uil.vim', '', 'default'
  199. call neobundle#config('J6uil.vim', {
  200. \ 'lazy' : 1,
  201. \ 'autoload' : {
  202. \ 'commands' : 'J6uil',
  203. \ },
  204. \ 'depends' : 'mattn/webapi-vim',
  205. \ })
  206. NeoBundle 'mattn/unite-rhythmbox'
  207. NeoBundleLazy 'rbtnn/vimconsole.vim', {
  208. \ 'depends' : 'thinca/vim-prettyprint',
  209. \ 'autoload' : {
  210. \ 'commands' : 'VimConsoleOpen'
  211. \ }}
  212. filetype plugin indent on
  213. if has('clientserver')
  214. call singleton#enable()
  215. end
  216. set ww+=h,l,>,<,[,]
  217. set mouse=a
  218. set ttymouse=xterm2
  219. set clipboard=unnamedplus
  220. " ,is: シェルを起動
  221. nnoremap <silent> ,is :VimShell<CR>
  222. " ,ipy: pythonを非同期で起動
  223. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  224. " ,irb: irbを非同期で起動
  225. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  226. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  227. vmap <silent> ,ss :VimShellSendString<CR>
  228. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  229. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  230. " ,vs: vimshell
  231. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  232. " ,vr: .vimrc
  233. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  234. nnoremap <silent> ,so :so ~/.vimrc<CR>
  235. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  236. nnoremap <silent> ,ll :tabnew +LingrLaunch<CR>
  237. nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
  238. " Disable AutoComplPop. Comment out this line if AutoComplPop is not
  239. " installed.
  240. let g:acp_enableAtStartup = 0
  241. " Launches neocomplcache automatically on vim startup.
  242. let g:neocomplcache_enable_at_startup = 1
  243. " Use smartcase.
  244. let g:neocomplcache_enable_smart_case = 1
  245. " Use camel case completion.
  246. let g:neocomplcache_enable_camel_case_completion = 1
  247. " Use underscore completion.
  248. let g:neocomplcache_enable_underbar_completion = 1
  249. " Sets minimum char length of syntax keyword.
  250. let g:neocomplcache_min_syntax_length = 3
  251. let g:vimfiler_as_default_explorer = 1
  252. let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  253. let g:neocomplcache_text_mode_filetypes = {
  254. \ 'tex': 1,
  255. \ 'plaintex': 1,
  256. \}
  257. "tabで補完候補の選択を行う
  258. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  259. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  260. let g:OmniSharp_host = 'http://localhost:2020'
  261. let g:OmniSharp_typeLookupInPreview = 1
  262. setlocal omnifunc=OmniSharp#Complete
  263. set noshowmatch
  264. let g:netrw_nogx = 1
  265. nmap gx <Plug>(openbrowser-smart-search)
  266. vmap gx <Plug>(openbrowser-smart-search)
  267. let g:quickrun_config = {}
  268. let g:quickrun_config['markdown'] = {
  269. \ 'outputter': 'browser'
  270. \ }
  271. let g:quickrun_config.ruby = {
  272. \ 'command': 'ruby',
  273. \ 'exec': '/usr/bin/env ruby %s',
  274. \ 'tempfile': '{tempname()}.rb'
  275. \ }
  276. let g:quickrun_config = {
  277. \ '_' : {
  278. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  279. \ 'hook/unite_quickfix/enable_failure' : 1,
  280. \ 'hook/close_quickfix/enable_exit' : 1,
  281. \ 'hook/close_buffer/enable_failure' : 1,
  282. \ 'hook/close_buffer/enable_empty_data' : 1,
  283. \ 'outputter' : 'multi:buffer:quickfix',
  284. \ 'hook/u_nya_/enable' : 1,
  285. \ 'hook/sweep/enable' : 0,
  286. \ 'outputter/buffer/split' : ':botright 15sp',
  287. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  288. \ 'runner' : 'vimproc',
  289. \ 'runner/vimproc/updatetime' : 40,
  290. \ 'runner/vimproc/sleep' : 0,
  291. \ }
  292. \ }
  293. let g:lingr_vim_user = 'raa0121'
  294. let g:J6uil_display_offline = 0
  295. let g:J6uil_display_online = 0
  296. let g:J6uil_echo_presence = 1
  297. let g:J6uil_display_icon = 0
  298. let g:J6uil_display_interval = 0
  299. let g:J6uil_updatetime = 1000
  300. augroup plugin-lingr-vim
  301. autocmd!
  302. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  303. autocmd FileType lingr-say let &syntax='clojure'
  304. augroup END
  305. augroup vimrc
  306. autocmd!
  307. augroup END
  308. function! s:SID_PREFIX()
  309. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  310. endfunction
  311. set titlelen=100
  312. set guioptions-=e
  313. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  314. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  315. if exists('$TMUX') || exists('$WINDOW')
  316. set t_ts=k
  317. set t_fs=\
  318. endif
  319. function! s:titlestring()
  320. if &filetype =~ '^lingr'
  321. let &titlestring = 'lingr: ' . lingr#unread_count()
  322. else
  323. let &titlestring = bufname('')
  324. endif
  325. endfunction
  326. " tabline
  327. set showtabline=2 " always show tabline
  328. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  329. function! s:tabline()
  330. " show each tab
  331. let s = ''
  332. for i in range(1, tabpagenr('$'))
  333. let list = tabpagebuflist(i)
  334. let nr = tabpagewinnr(i)
  335. let current_tabnr = tabpagenr()
  336. "let title = bufname('')
  337. if i == current_tabnr
  338. let title = fnamemodify(getcwd(), ':t') . '/'
  339. "let title = bufname('')
  340. else
  341. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  342. endif
  343. let title = empty(title) ? '[No Name]' : title
  344. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  345. let s .= '%' . i . 'T[' . i . '] ' . title
  346. let s .= ' '
  347. endfor
  348. " show lingr unread count
  349. let lingr_unread = ""
  350. if exists('*lingr#unread_count')
  351. let lingr_unread_count = lingr#unread_count()
  352. if lingr_unread_count > 0
  353. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  354. elseif lingr_unread_count == 0
  355. let lingr_unread = "()"
  356. endif
  357. endif
  358. " build tabline
  359. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  360. return s
  361. endfunction
  362. let g:github_user = 'raa0121'
  363. let g:github_token = 'e3ded9cf6669cc31dbca'
  364. let g:github#user = 'raa0121'