vimfiles / _vimrc

The default branch has multiple heads

" ============================================================================
" Common Settings
" ============================================================================
set background=dark
colorscheme Tomorrow-Night-Eighties
syntax on
set nu " 行番号表示
" set ruler " Powerlineを使うので不要
set nowrap " 折り返し無し
set shiftwidth=4
set tabstop=4
set expandtab
set hlsearch
set visualbell t_vb=
set nobackup
set encoding=utf-8
scriptencoding utf-8
set fileencodings=utf-8,iso-2022-jp,cp932,euc-jp,default,latin
set nocompatible
set cursorline
set cursorcolumn
set autoread    " Vim外で更新された場合に自動で読み込む
set virtualedit=block " 矩形選択のモード
set guioptions-=r "右スクロールバーを非表示
set guioptions-=L "左スクロールバーを非表示
set guioptions-=T "メニューバーを非表示
set formatoptions+=mM
set shellslash " Windowsでもパスを/で扱えるように
set laststatus=2
set showtabline=1 " タブバーを必要なときだけ表示

let g:Powerline_symbols = 'fancy'

let howm_dir            =   '~/Dropbox/howm'
let howm_fileencoding   =   'utf-8'
let howm_fileformat     =   'unix'

" ============================================================================
" Plugins
" ============================================================================
"
filetype off

if has("win32") || has("win64")
    set rtp+=~/vimfiles/vundle/
    set rtp+=~/vimfiles/qfixapp/
    call vundle#rc('~/vimfiles/bundle/')
else
    " errormarker icon定義
    let g:errormarker_erroricon = expand("~/.vim/icons/error.png")
    let g:errormarker_warningicon = expand("~/.vim/icons/warning.png")
    set rtp+=~/.vim/vundle/
    set rtp+=~/.vim/qfixapp/
    call vundle#rc()
    inoremap <silent> <C-j> <C-^>
endif


Bundle 'Shougo/neocomplcache'
Bundle 'Shougo/unite.vim'
Bundle 'Shougo/vimshell'
Bundle 'Shougo/vimproc'
Bundle 'thinca/vim-ref'
Bundle 'thinca/vim-quickrun'
Bundle 'mattn/zencoding-vim'
Bundle 'sjl/gundo.vim'
Bundle 'Lokaltog/vim-powerline'
Bundle 'msanders/cocoa.vim'

filetype plugin indent on

" ============================================================================
" Key maps
" ============================================================================

nmap <ESC><ESC> :nohlsearch<CR><ESC>
nmap <F2> :Unite buffer file file_mru<CR>
nmap <F3> :GundoToggle<CR>
nmap <CR> :<C-u>call append(expand('.'), '')<CR>j
nmap <silent> <Leader>P <Plug>ToggleProject
nmap <silent> <Leader>p :Project<CR>
nmap <S-F12> <C-W>v :set scrollbind<CR> <C-W><C-W> L zt j :set scrollbind<CR>

" ============================================================================
" Debug Key Setting
" ============================================================================

if has('win32') || has('win64')
    au FileType python nmap <F8> :!timeit python %<CR>
else
    au FileType python nmap <F8> :!time python %<CR>
endif

" ============================================================================
" Startup
" ============================================================================
if getcwd() != $HOME
    if filereadable(getcwd(). '/.vimprojects')
        Project .vimprojects
    endif
endif

" ============================================================================
" My Customize
" ============================================================================

:let g:proj_flags = "imstc"

" ============================================================================
" neocomplcache
" ============================================================================
	" Disable AutoComplPop.
	let g:acp_enableAtStartup = 0
	" Use neocomplcache.
	let g:neocomplcache_enable_at_startup = 1
	" Use smartcase.
	let g:neocomplcache_enable_smart_case = 1
	" Use camel case completion.
	let g:neocomplcache_enable_camel_case_completion = 1
	" Use underbar completion.
	let g:neocomplcache_enable_underbar_completion = 1
	" Set minimum syntax keyword length.
	let g:neocomplcache_min_syntax_length = 3
	let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
	
	" Define dictionary.
	let g:neocomplcache_dictionary_filetype_lists = {
	    \ 'default' : '',
	    \ 'vimshell' : $HOME.'/.vimshell_hist',
	    \ 'scheme' : $HOME.'/.gosh_completions',
        \ 'ps1' : $HOME.'/.vim/dictionary/powershell.dict'
	        \ }
		
	" Define keyword.
	if !exists('g:neocomplcache_keyword_patterns')
	    let g:neocomplcache_keyword_patterns = {}
	endif
	let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
	
	" Plugin key-mappings.
	imap <C-k>     <Plug>(neocomplcache_snippets_expand)
	smap <C-k>     <Plug>(neocomplcache_snippets_expand)
	inoremap <expr><C-g>     neocomplcache#undo_completion()
	inoremap <expr><C-l>     neocomplcache#complete_common_string()
	
	" SuperTab like snippets behavior.
	"imap <expr><TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>"
	
	" Recommended key-mappings.
	" <CR>: close popup and save indent.
	inoremap <expr><CR>  neocomplcache#smart_close_popup() . "\<CR>"
	" <TAB>: completion.
	inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
	" <C-h>, <BS>: close popup and delete backword char.
	inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
	inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
	inoremap <expr><C-y>  neocomplcache#close_popup()
	inoremap <expr><C-e>  neocomplcache#cancel_popup()
	
	" AutoComplPop like behavior.
	"let g:neocomplcache_enable_auto_select = 1
	
	" Shell like behavior(not recommended).
	"set completeopt+=longest
	"let g:neocomplcache_enable_auto_select = 1
	"let g:neocomplcache_disable_auto_complete = 1
	"inoremap <expr><TAB>  pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
	"inoremap <expr><CR>  neocomplcache#smart_close_popup() . "\<CR>"
	
	" Enable omni completion.
	autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
	autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
	autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
	autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
	autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
	
	" Enable heavy omni completion.
	if !exists('g:neocomplcache_omni_patterns')
		let g:neocomplcache_omni_patterns = {}
	endif
	let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
	"autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
	let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
	let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*'
	let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.