syntax on set t_Co=256 colorscheme hybrid hi LineNr ctermfg=3 hi CursorLineNr ctermbg=4 ctermfg=0 set cursorline hi clear CursorLine set guifont=Ricty\ for\ Powerline:h24 set relativenumber set number set expandtab set tabstop=4 set shiftwidth=4 set ruler set title set autoindent set showmatch set nocompatible set printoptions=number:y set incsearch set iminsert=0 set imsearch=0 set smarttab set ignorecase set smartcase set wildmenu set encoding=utf-8 set fileencodings=iso-2022-jp,euc-jp,sjis,utf-8,cp932 set fileformats=unix,dos,mac let g:seiya_auto_enable=1 let &t_SI = "\]50;CursorShape=1\x7" let &t_EI = "\]50;CursorShape=0\x7" " statusline表示 set laststatus=2 noremap noremap noremap noremap inoremap inoremap inoremap inoremap " 画面分割 nnoremap s nnoremap sj j nnoremap sk k nnoremap sl l nnoremap sh h nnoremap sJ J nnoremap sK K nnoremap sL L nnoremap sH H nnoremap sn gt nnoremap sp gT nnoremap sr r nnoremap s= = nnoremap sw w nnoremap so _| nnoremap sO = nnoremap sN :bn nnoremap sP :bp nnoremap st :tabnew nnoremap sT :Unite tab nnoremap ss :sp nnoremap sv :vs nnoremap sq :q nnoremap sQ :bd nnoremap sb :Unite buffer_tab -buffer-name=file nnoremap sB :Unite buffer -buffer-name=file nnoremap :setlocal relativenumber! nnoremap い i nnoremap あ a nnoremap お o nnoremap っd dd nnoremap う u nnoremap :wq :wq set nocompatible filetype plugin indent off if has('vim_starting') set runtimepath+=~/.vim/bundle/neobundle.vim call neobundle#begin(expand('~/.vim/bundle')) NeoBundleFetch 'Shougo/neobundle.vim' NeoBundle 'scrooloose/nerdtree' NeoBundle 'Shougo/neosnippet' NeoBundle 'Shougo/neosnippet-snippets' NeoBundle 'Shougo/unite.vim' " NeoBundle 'auther/pluginname' NeoBundle 'Shougo/neocomplete.vim' NeoBundle 'Shougo/vimproc.vim', { \ 'build' : { \ 'windows' : 'make -f make_mingw32.mak', \ 'cygwin' : 'make -f make_cygwin.mak', \ 'mac' : 'make -f make_mac.mak', \ 'unix' : 'make -f make_unix.mak', \ }, \ } NeoBundle 'justmao945/vim-clang' NeoBundle 'thinca/vim-quickrun' NeoBundle 'Shougo/neoinclude.vim' NeoBundle 'Shougo/vimshell' NeoBundle 'kovisoft/slimv' NeoBundle 'miyakogi/seiya.vim' NeoBundle 'itchyny/lightline.vim' NeoBundle 'cocopon/lightline-hybrid.vim' NeoBundle 'tpope/vim-fugitive' NeoBundle 'airblade/vim-gitgutter' NeoBundle 'elixir-lang/vim-elixir' NeoBundle 'eagletmt/ghcmod-vim' NeoBundle 'ujihisa/neco-ghc' NeoBundle 'dan-t/vim-hsimport' NeoBundle 'dag/vim2hs' NeoBundle 'eagletmt/ghcmod-vim' call neobundle#end() endif "Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)! " Disable AutoComplPop. let g:acp_enableAtStartup = 0 " Use neocomplete. let g:neocomplete#enable_at_startup = 1 " Use smartcase. let g:neocomplete#enable_smart_case = 1 " Set minimum syntax keyword length. let g:neocomplete#sources#syntax#min_keyword_length = 3 let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' " Define dictionary. let g:neocomplete#sources#dictionary#dictionaries = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } " Define keyword. if !exists('g:neocomplete#keyword_patterns') let g:neocomplete#keyword_patterns = {} endif let g:neocomplete#keyword_patterns['default'] = '\h\w*' " Plugin key-mappings. inoremap neocomplete#undo_completion() inoremap neocomplete#complete_common_string() " Recommended key-mappings. " : close popup and save indent. inoremap =my_cr_function() function! s:my_cr_function() return (pumvisible() ? "\" : "" ) . "\" " For no inserting key. "return pumvisible() ? "\" : "\" endfunction " : completion. inoremap pumvisible() ? "\" : "\" " , : close popup and delete backword char. inoremap neocomplete#smart_close_popup()."\" inoremap neocomplete#smart_close_popup()."\" " Close popup by . "inoremap pumvisible() ? "\" : "\" " AutoComplPop like behavior. "let g:neocomplete#enable_auto_select = 1 " Shell like behavior(not recommended). "set completeopt+=longest "let g:neocomplete#enable_auto_select = 1 "let g:neocomplete#disable_auto_complete = 1 "inoremap pumvisible() ? "\" : "\\" " 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:neocomplete#sources#omni#input_patterns') let g:neocomplete#sources#omni#input_patterns = {} endif "let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' "let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' "let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' " For perlomni.vim setting. " https://github.com/c9s/perlomni.vim let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' " 'Shougo/neocomplete.vim' {{{ let g:neocomplete#enable_at_startup = 1 if !exists('g:neocomplete#force_omni_input_patterns') let g:neocomplete#force_omni_input_patterns = {} endif let g:neocomplete#force_overwrite_completefunc = 1 let g:neocomplete#force_omni_input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplete#force_omni_input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' """}}} " 'justmao945/vim-clang' {{{ " disable auto completion for vim-clanG let g:clang_auto = 0 let g:clang_complete_auto = 0 let g:clang_auto_select = 0 let g:clang_use_library = 1 " default 'longest' can not work with neocomplete let g:clang_c_completeopt = 'menuone' let g:clang_cpp_completeopt = 'menuone' if executable('clang-3.6') let g:clang_exec = 'clang-3.6' elseif executable('clang-3.5') let g:clang_exec = 'clang-3.5' elseif executable('clang-3.4') let g:clang_exec = 'clang-3.4' else let g:clang_exec = 'clang' endif if executable('clang-format-3.6') let g:clang_format_exec = 'clang-format-3.6' elseif executable('clang-format-3.5') let g:clang_format_exec = 'clang-format-3.5' elseif executable('clang-format-3.4') let g:clang_format_exec = 'clang-format-3.4' else let g:clang_exec = 'clang-format' endif let g:clang_c_options = '-std=c11' let g:clang_cpp_options = '-std=c++11 -stdlib=libc++' " }}} nnoremap :NERDTreeToggle filetype plugin indent on " vim-gitgutter let g:gitgutter_sign_added = '✚' let g:gitgutter_sign_modified = '➜' let g:gitgutter_sign_removed = '✘' " lightline.vim let g:lightline = { \ 'colorscheme': 'hybrid', \ 'mode_map': {'c': 'NORMAL'}, \ 'active': { \ 'left': [ \ ['mode', 'paste'], \ ['fugitive', 'gitgutter', 'filename'], \ ], \ 'right': [ \ ['lineinfo', 'syntastic'], \ ['percent'], \ ['charcode', 'fileformat', 'fileencoding', 'filetype'], \ ] \ }, \ 'component_function': { \ 'modified': 'MyModified', \ 'readonly': 'MyReadonly', \ 'fugitive': 'MyFugitive', \ 'filename': 'MyFilename', \ 'fileformat': 'MyFileformat', \ 'filetype': 'MyFiletype', \ 'fileencoding': 'MyFileencoding', \ 'mode': 'MyMode', \ 'syntastic': 'SyntasticStatuslineFlag', \ 'charcode': 'MyCharCode', \ 'gitgutter': 'MyGitGutter', \ }, \ 'separator': {'left': '⮀', 'right': '⮂'}, \ 'subseparator': {'left': '⮁', 'right': '⮃'} \ } function! MyModified() return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-' endfunction function! MyReadonly() return &ft !~? 'help\|vimfiler\|gundo' && &ro ? '⭤' : '' endfunction function! MyFilename() return ('' != MyReadonly() ? MyReadonly() . ' ' : '') . \ (&ft == 'vimfiler' ? vimfiler#get_status_string() : \ &ft == 'unite' ? unite#get_status_string() : \ &ft == 'vimshell' ? substitute(b:vimshell.current_dir,expand('~'),'~','') : \ '' != expand('%:t') ? expand('%:t') : '[No Name]') . \ ('' != MyModified() ? ' ' . MyModified() : '') endfunction function! MyFugitive() try if &ft !~? 'vimfiler\|gundo' && exists('*fugitive#head') let _ = fugitive#head() return strlen(_) ? '⭠ '._ : '' endif catch endtry return '' endfunction function! MyFileformat() return winwidth('.') > 70 ? &fileformat : '' endfunction function! MyFiletype() return winwidth('.') > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : '' endfunction function! MyFileencoding() return winwidth('.') > 70 ? (strlen(&fenc) ? &fenc : &enc) : '' endfunction function! MyMode() return winwidth('.') > 60 ? lightline#mode() : '' endfunction function! MyGitGutter() if ! exists('*GitGutterGetHunkSummary') \ || ! get(g:, 'gitgutter_enabled', 0) \ || winwidth('.') <= 90 return '' endif let symbols = [ \ g:gitgutter_sign_added . ' ', \ g:gitgutter_sign_modified . ' ', \ g:gitgutter_sign_removed . ' ' \ ] let hunks = GitGutterGetHunkSummary() let ret = [] for i in [0, 1, 2] if hunks[i] > 0 call add(ret, symbols[i] . hunks[i]) endif endfor return join(ret, ' ') endfunction " https://github.com/Lokaltog/vim-powerline/blob/develop/autoload/Powerline/Functions.vim function! MyCharCode() if winwidth('.') <= 70 return '' endif " Get the output of :ascii redir => ascii silent! ascii redir END if match(ascii, 'NUL') != -1 return 'NUL' endif " Zero pad hex values let nrformat = '0x%02x' let encoding = (&fenc == '' ? &enc : &fenc) if encoding == 'utf-8' " Zero pad with 4 zeroes in unicode files let nrformat = '0x%04x' endif " Get the character and the numeric value from the return value of :ascii " This matches the two first pieces of the return value, e.g. " " 70" => char: 'F', nr: '70' let [str, char, nr; rest] = matchlist(ascii, '\v\<(.{-1,})\>\s*([0-9]+)') " Format the numeric value let nr = printf(nrformat, nr) return "'". char ."' ". nr endfunction let g:quickrun_config = { \ "_" : { \ 'runner' : 'vimproc', \ 'runner/vimproc/updatetime' : 60, \ 'outputter' : 'error', \ 'outputter/error/success' : 'buffer', \ 'outputter/error/error' : 'quickfix', \ 'outputter/buffer/split' : ':rightbelow 8sp', \ 'outputter/buffer/close_on_empty' : 1, \ }, \ 'haskell' : { 'type' : 'haskell/stack' }, \ 'haskell/stack' : { \ 'command' : 'stack', \ 'exec' : '%c %o %s %a', \ 'cmdopt' : 'runghc', \ }, \} let g:quickrun_config = { \ "_" : { \ 'runner' : 'vimproc', \ 'runner/vimproc/updatetime' : 60, \ 'outputter' : 'error', \ 'outputter/error/success' : 'buffer', \ 'outputter/error/error' : 'quickfix', \ 'outputter/buffer/split' : ':rightbelow 8sp', \ 'outputter/buffer/close_on_empty' : 1, \ }, \ 'haskell' : { 'type' : 'haskell/stack' }, \ 'haskell/stack' : { \ 'command' : 'stack', \ 'exec' : '%c %o %s %a', \ 'cmdopt' : 'runghc', \ }, \} let g:quickrun_no_default_key_mappings = 1 nnoremap r :write:QuickRun -mode n xnoremap r :writegv:QuickRun -mode v nnoremap quickrun#is_running() ? quickrun#sweep_sessions() : "\" let g:haskell_quasi = 0 let g:haskell_interpolation = 0 let g:haskell_regex = 0 let g:haskell_jmacro = 0 let g:haskell_shqq = 0 let g:haskell_sql = 0 let g:haskell_json = 0 let g:haskell_xml = 0