diff --git a/all/.vimrc b/all/.vimrc new file mode 100644 index 0000000..0b8d5af --- /dev/null +++ b/all/.vimrc @@ -0,0 +1,304 @@ +" バックスペースキーで削除を有効にする " +set backspace=indent,eol,start + +" ================================================== +" START: NeoBundle +" ================================================== + +" Note: Skip initialization for vim-tiny or vim-small. +if !1 | finish | endif + +if has('vim_starting') +set nocompatible " Be iMproved + +" Required: +set runtimepath+=~/.vim/bundle/neobundle.vim/ +endif + +" Required: +call neobundle#begin(expand('~/.vim/bundle/')) + + +" Let NeoBundle manage NeoBundle +" Required: +NeoBundleFetch 'Shougo/neobundle.vim' + +" My Bundles here: +" Refer to |:NeoBundle-examples|. +" Note: You don't set neobundle setting in .gvimrc! + +" ColorScheme +NeoBundle 'w0ng/vim-hybrid' + +NeoBundle 'Lokaltog/powerline', {'rtp' : 'powerline/bindings/vim'} + +" Fonts +NeoBundle 'Lokaltog/powerline-fonts' + +" lightline.vim - StatusLineCustmize +"NeoBundle 'itchyny/lightline.vim' + +" vim-airline +NeoBundle 'bling/vim-airline' + +" NERDTree +NeoBundle 'scrooloose/nerdtree' + +" GitHub操作 +NeoBundle 'tpope/vim-fugitive' + +" 入力補完 +NeoBundle 'Shougo/neocomplete.vim' + +" Scalaシンタックス +NeoBundle 'derekwyatt/vim-scala' + +" RustSyntax +NeoBundle 'rust-lang/rust.vim' + +" ElixirSyntax +NeoBundle 'elixir-lang/vim-elixir' + +" ElmSyntax +NeoBundle 'ElmCast/elm-vim' + +" ctags auto +NeoBundle 'szw/vim-tags' + +" auto-ctags +NeoBundle 'soramugi/auto-ctags.vim' + +" Tagbar +NeoBundle 'majutsushi/tagbar' + +call neobundle#end() + +" Required: +filetype plugin indent on + +" If there are uninstalled bundles found on startup, +" this will conveniently prompt you to install them. +NeoBundleCheck + +" ================================================== +" END: NeoBundle +" ================================================== + + +" ================================================== +" START: neocomplete.vim +" ================================================== + +"Note: This option must set it 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 neocomplete#close_popup() . "\" + " For no inserting key. + "return pumvisible() ? neocomplete#close_popup() : "\" +endfunction +" : completion. +inoremap pumvisible() ? "\" : "\" +" , : close popup and delete backword char. +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#close_popup() +inoremap neocomplete#cancel_popup() +" Close popup by . +"inoremap pumvisible() ? neocomplete#close_popup() : "\" + +" For cursor moving in insert mode(Not recommended) +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +" Or set this. +"let g:neocomplete#enable_cursor_hold_i = 1 +" Or set this. +"let g:neocomplete#enable_insert_char_pre = 1 + +" 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*::' + +" ================================================== +" END: neocomplete.vim +" ================================================== + + +" ================================================== +" START: lightline.vim +" ================================================== + +set laststatus=2 + +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'fugitive', 'filename' ] ] + \ }, + \ 'component_function': { + \ 'fugitive': 'MyFugitive', + \ 'readonly': 'MyReadonly', + \ 'modified': 'MyModified', + \ 'filename': 'MyFilename' + \ }, + \ 'separator': { 'left': '', 'right': ' ' }, + \ 'subseparator': { 'left': '', 'right': ' ' } + \ } + +function! MyModified() + if &filetype == "help" + return "" + elseif &modified + return "+" + elseif &modifiable + return "" + else + return "" + endif +endfunction + +function! MyReadonly() + if &filetype == "help" + return "" + elseif &readonly + return "" + else + return "" + endif +endfunction + +function! MyFugitive() + return exists('*fugitive#head') ? fugitive#head() : '' +endfunction + +function! MyFilename() + return ('' != MyReadonly() ? MyReadonly() . ' ' : '') . + \ ('' != expand('%:t') ? expand('%:t') : '[No Name]') . + \ ('' != MyModified() ? ' ' . MyModified() : '') +endfunction + +function! MyFugitive() + if exists("*fugitive#head") + let _ = fugitive#head() + return strlen(_) ? ' '._ : '' + endif + return '' +endfunction + +" ================================================== +" END: lightline.vim +" ================================================== + + +" ================================================== +" START: vim-airline +" ================================================== + +let g:airline_powerline_fonts = 1 + +" ================================================== +" END: vim-airline +" ================================================== +" + +" ================================================== +" ENABLE: plugins +" ================================================== + +" ColorScheme +syntax on +let g:hybrid_use_Xresources = 1 +if has("mac") + colorscheme hybrid +endif + +" カレント行をハイライト +set cursorline +" 行番号表示 +set number +" が置き換わるspace数 +set softtabstop=2 +" インデントの際タブでなくスペースを挿入 +set expandtab +" 自動インデントの際のずれはば +set shiftwidth=2 + +" 引数なしの場合のみNERDTreeを有効 +let file_name = expand('%') +if has('vim_starting') && file_name == '' + autocmd VimEnter * execute 'NERDTree ./' +endif + +" NERDTreeを右側に表示 +let g:NERDTreeWinPos="right" + +" Tagbar +nmap :TagbarToggle +let g:tagbar_width = 30 +if has("mac") + let g:tagbar_ctags_bin="/usr/local/bin/ctags" +endif + +" インデント数調整 +augroup fileTypeIndent + autocmd! + autocmd BufNewFile,BufRead *.c setlocal tabstop=4 softtabstop=4 shiftwidth=4 + autocmd BufNewFile,BufRead *.cpp setlocal tabstop=2 softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufRead *.ino setlocal tabstop=2 softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufRead *.py setlocal tabstop=2 softtabstop=2 shiftwidth=2 +augroup END diff --git a/mac/.vimrc b/mac/.vimrc new file mode 100644 index 0000000..0b8d5af --- /dev/null +++ b/mac/.vimrc @@ -0,0 +1,304 @@ +" バックスペースキーで削除を有効にする " +set backspace=indent,eol,start + +" ================================================== +" START: NeoBundle +" ================================================== + +" Note: Skip initialization for vim-tiny or vim-small. +if !1 | finish | endif + +if has('vim_starting') +set nocompatible " Be iMproved + +" Required: +set runtimepath+=~/.vim/bundle/neobundle.vim/ +endif + +" Required: +call neobundle#begin(expand('~/.vim/bundle/')) + + +" Let NeoBundle manage NeoBundle +" Required: +NeoBundleFetch 'Shougo/neobundle.vim' + +" My Bundles here: +" Refer to |:NeoBundle-examples|. +" Note: You don't set neobundle setting in .gvimrc! + +" ColorScheme +NeoBundle 'w0ng/vim-hybrid' + +NeoBundle 'Lokaltog/powerline', {'rtp' : 'powerline/bindings/vim'} + +" Fonts +NeoBundle 'Lokaltog/powerline-fonts' + +" lightline.vim - StatusLineCustmize +"NeoBundle 'itchyny/lightline.vim' + +" vim-airline +NeoBundle 'bling/vim-airline' + +" NERDTree +NeoBundle 'scrooloose/nerdtree' + +" GitHub操作 +NeoBundle 'tpope/vim-fugitive' + +" 入力補完 +NeoBundle 'Shougo/neocomplete.vim' + +" Scalaシンタックス +NeoBundle 'derekwyatt/vim-scala' + +" RustSyntax +NeoBundle 'rust-lang/rust.vim' + +" ElixirSyntax +NeoBundle 'elixir-lang/vim-elixir' + +" ElmSyntax +NeoBundle 'ElmCast/elm-vim' + +" ctags auto +NeoBundle 'szw/vim-tags' + +" auto-ctags +NeoBundle 'soramugi/auto-ctags.vim' + +" Tagbar +NeoBundle 'majutsushi/tagbar' + +call neobundle#end() + +" Required: +filetype plugin indent on + +" If there are uninstalled bundles found on startup, +" this will conveniently prompt you to install them. +NeoBundleCheck + +" ================================================== +" END: NeoBundle +" ================================================== + + +" ================================================== +" START: neocomplete.vim +" ================================================== + +"Note: This option must set it 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 neocomplete#close_popup() . "\" + " For no inserting key. + "return pumvisible() ? neocomplete#close_popup() : "\" +endfunction +" : completion. +inoremap pumvisible() ? "\" : "\" +" , : close popup and delete backword char. +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#close_popup() +inoremap neocomplete#cancel_popup() +" Close popup by . +"inoremap pumvisible() ? neocomplete#close_popup() : "\" + +" For cursor moving in insert mode(Not recommended) +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +" Or set this. +"let g:neocomplete#enable_cursor_hold_i = 1 +" Or set this. +"let g:neocomplete#enable_insert_char_pre = 1 + +" 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*::' + +" ================================================== +" END: neocomplete.vim +" ================================================== + + +" ================================================== +" START: lightline.vim +" ================================================== + +set laststatus=2 + +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'fugitive', 'filename' ] ] + \ }, + \ 'component_function': { + \ 'fugitive': 'MyFugitive', + \ 'readonly': 'MyReadonly', + \ 'modified': 'MyModified', + \ 'filename': 'MyFilename' + \ }, + \ 'separator': { 'left': '', 'right': ' ' }, + \ 'subseparator': { 'left': '', 'right': ' ' } + \ } + +function! MyModified() + if &filetype == "help" + return "" + elseif &modified + return "+" + elseif &modifiable + return "" + else + return "" + endif +endfunction + +function! MyReadonly() + if &filetype == "help" + return "" + elseif &readonly + return "" + else + return "" + endif +endfunction + +function! MyFugitive() + return exists('*fugitive#head') ? fugitive#head() : '' +endfunction + +function! MyFilename() + return ('' != MyReadonly() ? MyReadonly() . ' ' : '') . + \ ('' != expand('%:t') ? expand('%:t') : '[No Name]') . + \ ('' != MyModified() ? ' ' . MyModified() : '') +endfunction + +function! MyFugitive() + if exists("*fugitive#head") + let _ = fugitive#head() + return strlen(_) ? ' '._ : '' + endif + return '' +endfunction + +" ================================================== +" END: lightline.vim +" ================================================== + + +" ================================================== +" START: vim-airline +" ================================================== + +let g:airline_powerline_fonts = 1 + +" ================================================== +" END: vim-airline +" ================================================== +" + +" ================================================== +" ENABLE: plugins +" ================================================== + +" ColorScheme +syntax on +let g:hybrid_use_Xresources = 1 +if has("mac") + colorscheme hybrid +endif + +" カレント行をハイライト +set cursorline +" 行番号表示 +set number +" が置き換わるspace数 +set softtabstop=2 +" インデントの際タブでなくスペースを挿入 +set expandtab +" 自動インデントの際のずれはば +set shiftwidth=2 + +" 引数なしの場合のみNERDTreeを有効 +let file_name = expand('%') +if has('vim_starting') && file_name == '' + autocmd VimEnter * execute 'NERDTree ./' +endif + +" NERDTreeを右側に表示 +let g:NERDTreeWinPos="right" + +" Tagbar +nmap :TagbarToggle +let g:tagbar_width = 30 +if has("mac") + let g:tagbar_ctags_bin="/usr/local/bin/ctags" +endif + +" インデント数調整 +augroup fileTypeIndent + autocmd! + autocmd BufNewFile,BufRead *.c setlocal tabstop=4 softtabstop=4 shiftwidth=4 + autocmd BufNewFile,BufRead *.cpp setlocal tabstop=2 softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufRead *.ino setlocal tabstop=2 softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufRead *.py setlocal tabstop=2 softtabstop=2 shiftwidth=2 +augroup END diff --git a/win/.vimrc b/win/.vimrc new file mode 100644 index 0000000..a3b07a8 --- /dev/null +++ b/win/.vimrc @@ -0,0 +1,308 @@ +" バックスペースキーで削除を有効にする " +set backspace=indent,eol,start + +" ================================================== +" START: NeoBundle +" ================================================== + +" Note: Skip initialization for vim-tiny or vim-small. +if !1 | finish | endif + +if has('vim_starting') +set nocompatible " Be iMproved + +" Required: +set runtimepath+=~/.vim/bundle/neobundle.vim/ +endif + +" Required: +call neobundle#begin(expand('~/.vim/bundle/')) + + +" Let NeoBundle manage NeoBundle +" Required: +NeoBundleFetch 'Shougo/neobundle.vim' + +" My Bundles here: +" Refer to |:NeoBundle-examples|. +" Note: You don't set neobundle setting in .gvimrc! + +" ColorScheme +NeoBundle 'w0ng/vim-hybrid' + +NeoBundle 'Lokaltog/powerline', {'rtp' : 'powerline/bindings/vim'} + +" Fonts +NeoBundle 'Lokaltog/powerline-fonts' + +" lightline.vim - StatusLineCustmize +"NeoBundle 'itchyny/lightline.vim' + +" vim-airline +NeoBundle 'bling/vim-airline' + +" NERDTree +NeoBundle 'scrooloose/nerdtree' + +" GitHub操作 +NeoBundle 'tpope/vim-fugitive' + +" 入力補完 +NeoBundle 'Shougo/neocomplete.vim' + +" Scalaシンタックス +NeoBundle 'derekwyatt/vim-scala' + +" ctags auto +NeoBundle 'szw/vim-tags' + +" auto-ctags +NeoBundle 'soramugi/auto-ctags.vim' + +" tagbar +NeoBundleLazy 'majutsushi/tagbar' + +call neobundle#end() + +" Required: +filetype plugin indent on + +" If there are uninstalled bundles found on startup, +" this will conveniently prompt you to install them. +NeoBundleCheck + +" ================================================== +" END: NeoBundle +" ================================================== + + +" ================================================== +" START: neocomplete.vim +" ================================================== + +"Note: This option must set it 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 neocomplete#close_popup() . "\" + " For no inserting key. + "return pumvisible() ? neocomplete#close_popup() : "\" +endfunction +" : completion. +inoremap pumvisible() ? "\" : "\" +" , : close popup and delete backword char. +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#close_popup() +inoremap neocomplete#cancel_popup() +" Close popup by . +"inoremap pumvisible() ? neocomplete#close_popup() : "\" + +" For cursor moving in insert mode(Not recommended) +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +"inoremap neocomplete#close_popup() . "\" +" Or set this. +"let g:neocomplete#enable_cursor_hold_i = 1 +" Or set this. +"let g:neocomplete#enable_insert_char_pre = 1 + +" 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*::' + +" ================================================== +" END: neocomplete.vim +" ================================================== + + +" ================================================== +" START: lightline.vim +" ================================================== + +set laststatus=2 + +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'fugitive', 'filename' ] ] + \ }, + \ 'component_function': { + \ 'fugitive': 'MyFugitive', + \ 'readonly': 'MyReadonly', + \ 'modified': 'MyModified', + \ 'filename': 'MyFilename' + \ }, + \ 'separator': { 'left': '', 'right': ' ' }, + \ 'subseparator': { 'left': '', 'right': ' ' } + \ } + +function! MyModified() + if &filetype == "help" + return "" + elseif &modified + return "+" + elseif &modifiable + return "" + else + return "" + endif +endfunction + +function! MyReadonly() + if &filetype == "help" + return "" + elseif &readonly + return "" + else + return "" + endif +endfunction + +function! MyFugitive() + return exists('*fugitive#head') ? fugitive#head() : '' +endfunction + +function! MyFilename() + return ('' != MyReadonly() ? MyReadonly() . ' ' : '') . + \ ('' != expand('%:t') ? expand('%:t') : '[No Name]') . + \ ('' != MyModified() ? ' ' . MyModified() : '') +endfunction + +function! MyFugitive() + if exists("*fugitive#head") + let _ = fugitive#head() + return strlen(_) ? ' '._ : '' + endif + return '' +endfunction + +" ================================================== +" END: lightline.vim +" ================================================== + + +" ================================================== +" START: vim-airline +" ================================================== + +let g:airline_powerline_fonts = 1 + +" ================================================== +" END: vim-airline +" ================================================== +" + +" ================================================== +" ENABLE: plugins +" ================================================== + +" ColorScheme +syntax on +let g:hybrid_use_Xresources = 1 +"colorscheme hybrid + +" カレント行をハイライト +set cursorline +" 行番号表示 +set number +" が置き換わるspace数 +set softtabstop=2 +" インデントの際タブでなくスペースを挿入 +set expandtab +" 自動インデントの際のずれはば +set shiftwidth=2 + +" 引数なしの場合のみNERDTreeを有効 +let file_name = expand('%') +if has('vim_starting') && file_name == '' + autocmd VimEnter * execute 'NERDTree ./' +endif + +" NERDTreeを右側に表示 +let g:NERDTreeWinPos="right" + +" auto-ctags +" Create at a Writing the file +let g:auto_ctags = 1 + +" tagbar +nmap :TagbarToggle +let g:tagbar_width = 30 +"let g:tagbar_autoshowtag = 1 ":TagbarShowTag を叩かなくても有効にする +"if has("win32") +" let g:tagbar_ctags_bin = "[/usr/bin/ctags.exe]" +"endif + +" インデント数調整 +augroup fileTypeIndent + autocmd! + autocmd BufNewFile,BufRead *.c setlocal tabstop=4 softtabstop=4 shiftwidth=4 + autocmd BufNewFile,BufRead *.cpp setlocal tabstop=2 softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufRead *.ino setlocal tabstop=2 softtabstop=2 shiftwidth=2 + autocmd BufNewFile,BufRead *.py setlocal tabstop=2 softtabstop=2 shiftwidth=2 +augroup END + +" highlighting from tags +noremap :sp tags:%s/^\([^ :]*:\)\=\([^ ]*\).*/syntax keyword Tag \2/:wq! tags.vim/^ +noremap :so tags.vim + +" load the types.vim highlighting file, if it exists +autocmd BufRead,BufNewFile *.[ch] let fname = expand(':p:h') . '/types.vim' +autocmd BufRead,BufNewFile *.[ch] if filereadable(fname) +autocmd BufRead,BufNewFile *.[ch] exe 'so ' . fname +autocmd BufRead,BufNewFile *.[ch] endif