Created
March 20, 2015 14:11
-
-
Save smallfield/e3258c6083b750b25263 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" auto reload .vimrc"{{{ | |
augroup source-vimrc | |
autocmd! | |
autocmd BufWritePost *vimrc source $MYVIMRC | set foldmethod=marker | |
autocmd BufWritePost *gvimrc if has('gui_running') source $MYGVIMRC | |
augroup END"}}} | |
" カラースキームの設定 | |
colorscheme desert | |
"---タイムスタンプのやつ | |
inoremap <F5> <ESC>i<C-R>=strftime("%H:%M ")<CR> | |
inoremap <F6> <ESC>i<C-R>=strftime("%Y/%m/%d (%a)")<CR><CR> | |
nnoremap <F2> <ESC>:o D:\memo\<C-R>=strftime("%Y%m")<CR><CR> | |
inoremap <F9> □ <ESC>$a | |
nnoremap <F12> <ESC>:s/□/■/g<CR>:noh<CR>$ | |
"nnoremap <leader> da ggV/^---y<ESC><ESC>ggO<ESC>pddi<C-R>=strftime("%Y/%m/%d (%a)")<CR><CR> | |
nnoremap <ESC><ESC> <ESC>:noh<CR> | |
" キー入れ替え | |
nnoremap k gk | |
nnoremap j gj | |
vnoremap k gk | |
vnoremap j gj | |
nnoremap gk k | |
nnoremap gj j | |
vnoremap gk k | |
vnoremap gj j | |
inoremap <C-d> <Delete> | |
inoremap <C-l> <Right> | |
inoremap <C-h> <Left> | |
inoremap <C-j> <Down> | |
inoremap <C-k> <Up> | |
inoremap <C-a> <Home> | |
inoremap <C-e> <End> | |
inoremap <C-d> <BS> | |
nnoremap <C-a> <Home> | |
nnoremap <C-e> <End> | |
" Escapeするキー | |
inoremap jk <Esc> | |
set background=dark | |
set number | |
set ruler | |
set list | |
syntax on | |
set nocompatible | |
set backspace=start,eol,indent | |
set whichwrap=b,s,[,],<,>,~ | |
set listchars=tab:>-,nbsp:%,extends:>,precedes:< | |
set incsearch | |
set hlsearch | |
set ignorecase | |
set wildmenu wildmode=list:full | |
set autoindent | |
set autoread | |
set nobackup | |
set noswapfile | |
" Alignを日本語環境で使用するための設定 | |
let g:Align_xstrlen = 3 | |
" golang | |
au BufWritePre *.go Fmt | |
au FileType go nmap <leader>r <Plug>(go-run) | |
if $GOROOT != '' | |
set rtp+=$GOROOT/misc/vim | |
endif | |
autocmd FileType go compiler go | |
" quickrun設定"{{{ | |
" 垂直分割にする | |
let g:quickrun_config={'*': {'split': ''}} | |
let g:quickrun_config._={ 'runner':'vimproc', | |
\ "runner/vimproc/updatetime" : 10, | |
\ "outputter/buffer/close_on_empty" : 1, | |
\ }"}}} | |
" ステータスバー | |
set laststatus=2 | |
set statusline=%{expand('%:p:t')}\ %<\(%{expand('%:p:h')}\)%=\ %m%r%y%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}[%3l,%3c] | |
" クリップボードにyankをコピー | |
set clipboard=unnamed | |
" 自動改行を止める奴 | |
set tw=0 | |
" neobundle"{{{ | |
if has('vim_starting') | |
set nocompatible | |
" neobundle をインストールしていない場合は自動インストール {{{ | |
if !isdirectory(expand("~/.vim/bundle/neobundle.vim/")) | |
echo "install neobundle..." | |
" vim からコマンド呼び出しているだけ neobundle.vim のクローン | |
:call system("git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim") | |
endif | |
" }}} | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif | |
call neobundle#begin(expand('~/.vim/bundle')) | |
let g:neobundle_default_git_protocol='https' | |
" neobundle#begin - neobundle#end の間に導入するプラグインを記載します。 | |
NeoBundleFetch 'Shougo/neobundle.vim' | |
NeoBundle 'Shougo/neocomplete.vim' | |
NeoBundle 'scrooloose/nerdtree' | |
NeoBundle 'Shougo/neomru.vim' | |
NeoBundle 'thinca/vim-quickrun' | |
NeoBundle 'vim-ruby/vim-ruby' | |
NeoBundle 'Align' | |
NeoBundleLazy 'edsono/vim-matchit', { 'autoload' : { | |
\ 'filetypes': 'ruby', | |
\ 'mappings' : ['nx', '%'] }} | |
NeoBundle 'tomtom/tcomment_vim' | |
NeoBundle 'Shougo/vimshell.vim' | |
NeoBundle 'itchyny/lightline.vim' | |
NeoBundle 't9md/vim-textmanip' | |
NeoBundle 'mattn/gist-vim', {'depends': 'mattn/webapi-vim'} | |
NeoBundle 'timcharper/textile.vim' | |
"行末スペース奴 | |
NeoBundle 'bronson/vim-trailing-whitespace' | |
" unite | |
NeoBundle 'Shougo/unite.vim' | |
NeoBundle 'ujihisa/unite-colorscheme' | |
" color schema | |
NeoBundle 'altercation/vim-colors-solarized' | |
NeoBundle 'croaker/mustang-vim' | |
NeoBundle 'jeffreyiacono/vim-colors-wombat' | |
NeoBundle 'nanotech/jellybeans.vim' | |
NeoBundle 'vim-scripts/Lucius' | |
NeoBundle 'vim-scripts/Zenburn' | |
NeoBundle 'mrkn/mrkn256.vim' | |
NeoBundle 'jpo/vim-railscasts-theme' | |
NeoBundle 'therubymug/vim-pyte' | |
NeoBundle 'tomasr/molokai' | |
" vimrc に記述されたプラグインでインストールされていないものがないかチェックする | |
NeoBundleCheck | |
call neobundle#end()"}}} | |
" NerdTree Settings {{{ | |
nnoremap <silent><C-t> :NERDTreeToggle<CR> | |
" }}} | |
"Unite Settings"{{{ | |
"インサートモードで開始 | |
let g:unite_enable_start_insert=1 | |
"ヒストリー/ヤンク機能を有効化 | |
let g:unite_source_history_yank_enable =1 | |
"prefix keyの設定 | |
nmap <Space> [unite] | |
" デフォルトをタブオープンに | |
call unite#custom_default_action('file', 'tabopen') | |
"スペースキーとaキーでカレントディレクトリを表示 | |
nnoremap <silent> [unite]a :<C-u>UniteWithBufferDir -buffer-name=files file<CR> | |
"スペースキーとfキーでバッファと最近開いたファイル一覧を表示 | |
nnoremap <silent> [unite]f :<C-u>Unite<Space>buffer file_mru<CR> | |
"スペースキーとdキーで最近開いたディレクトリを表示 | |
nnoremap <silent> [unite]d :<C-u>Unite<Space>directory_mru<CR> | |
"スペースキーとbキーでバッファを表示 | |
nnoremap <silent> [unite]b :<C-u>Unite<Space>buffer<CR> | |
"スペースキーとrキーでレジストリを表示 | |
nnoremap <silent> [unite]r :<C-u>Unite<Space>register<CR> | |
"スペースキーとtキーでタブを表示 | |
nnoremap <silent> [unite]t :<C-u>Unite<Space>tab<CR> | |
"スペースキーとhキーでヒストリ/ヤンクを表示 | |
nnoremap <silent> [unite]h :<C-u>Unite<Space>history/yank<CR> | |
"スペースキーとoキーでoutline | |
nnoremap <silent> [unite]o :<C-u>Unite<Space>outline<CR> | |
"スペースキーとENTERキーでfile_rec:! | |
nnoremap <silent> [unite]<CR> :<C-u>Unite<Space>file_rec:!<CR> | |
"unite.vimを開いている間のキーマッピング | |
autocmd FileType unite call s:unite_my_settings() | |
" search a file in the filetree | |
nnoremap <space><space> :split<cr> :<C-u>Unite -start-insert file_rec/async<cr> | |
function! s:unite_my_settings()"{{{ | |
" ESCでuniteを終了 | |
nmap <buffer> <ESC> <Plug>(unite_exit) | |
endfunction"}}}"}}} | |
" vim-trailing-whitespace 設定 | |
let g:extra_whitespace_ignored_filetypes = ['unite', 'mkd'] | |
" tabな設定"{{{ | |
" 一例 | |
nnoremap [TABCMD] <nop> | |
nmap <leader>t [TABCMD] | |
"nnoremap <silent> [TABCMD]f :<c-u>tabfirst<cr> | |
"nnoremap <silent> [TABCMD]l :<c-u>tablast<cr> | |
"nnoremap <silent> [TABCMD]n :<c-u>tabnext<cr> | |
"nnoremap <silent> [TABCMD]N :<c-u>tabNext<cr> | |
"nnoremap <silent> [TABCMD]p :<c-u>tabprevious<cr> | |
nnoremap <silent> [TABCMD]e :<c-u>tabedit<cr> | |
nnoremap <silent> [TABCMD]c :<c-u>tabclose<cr> | |
nnoremap <silent> [TABCMD]o :<c-u>tabonly<cr> | |
nnoremap <silent> [TABCMD]s :<c-u>tabs<cr>"}}} | |
" カラースキームの設定 | |
colorscheme desert | |
" 折りたたみ | |
set foldmethod=marker | |
" this should be last whatever... | |
filetype plugin indent on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment