-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
135 lines (112 loc) · 4.29 KB
/
Copy path.vimrc
File metadata and controls
135 lines (112 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
" vim-python-jedi で動作することを確認しています
" sudo apt-get install vim-python-jedi
"
" Note: Skip initialization for vim-tiny or vim-small.
if 0 | endif
if has('vim_starting')
if &compatible
set nocompatible " Be iMproved
endif
" 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!
" NeoBundle 'scrooloose/syntastic'
" Lint
NeoBundle 'Flake8-vim'
" インデントに色を付けて見やすくする
NeoBundle 'nathanaelkane/vim-indent-guides'
"
" " vimを立ち上げたときに、自動的にvim-indent-guidesをオンにする
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
" autopep8 の設定
" http://ton-up.net/technote/2013/11/26/vim-python-style-check-and-fix/
" original http://stackoverflow.com/questions/12374200/using-uncrustify-with-vim/15513829#15513829
function! Preserve(command)
" Save the last search.
let search = @/
" Save the current cursor position.
let cursor_position = getpos('.')
" Save the current window position.
normal! H
let window_position = getpos('.')
call setpos('.', cursor_position)
" Execute the command.
execute a:command
" Restore the last search.
let @/ = search
" Restore the previous window position.
call setpos('.', window_position)
normal! zt
" Restore the previous cursor position.
call setpos('.', cursor_position)
endfunction
function! Autopep8()
call Preserve(':silent %!autopep8 --ignore=E501 -')
endfunction
" Shift + F で Pythonコードのインデントとか 自動修正
autocmd FileType python nnoremap <S-f> :call Autopep8()<CR>
" let g:syntastic_python_checkers = ['flake8', 'pep8']
" vim-indent-guides
" Vim 起動時 vim-indent-guides を自動起動
let g:indent_guides_enable_on_vim_startup=1
" ガイドをスタートするインデントの量
let g:indent_guides_start_level=1
" 自動カラー無効
let g:indent_guides_auto_colors=0
" 奇数番目のインデントの色
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#444433 ctermbg=black
" 偶数番目のインデントの色
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#333344 ctermbg=darkgray
" ガイドの幅
let g:indent_guides_guide_size = 4
" F5で実行
nmap <F5> :!python %
nmap <F2> :!sh ../sh/lambdaUp.sh
syntax enable
set ruler
set listchars=tab:>-,trail:-,nbsp:%,extends:>
set matchpairs& matchpairs+=<:> " 対応カッコ追加
set incsearch
set hlsearch
" Swapファイル 邪魔
set nowritebackup
set nobackup
set noswapfile
set t_vb= " ベルとかうるさい
set novisualbell
set listchars=tab:»-,trail:-,extends:»,precedes:«,nbsp:%,eol:↲
set list " 不可視文字の可視化
set number " 行番号の表示
set wrap " 長いテキストの折り返し
set textwidth=0 " 自動的に改行が入るのを無効化
set colorcolumn=120 " その代わり120文字目にラインを入れる
set whichwrap=h,l
set nowrapscan
set history=2000
set ignorecase " 大文字小文字を区別しない
set smartcase " 検索文字に大文字がある場合は大文字小文字を区別
set shiftround " '<'や'>'でインデントする際に'shiftwidth'の倍数に丸める
set infercase " 補完時に大文字小文字を区別しない
set virtualedit=all " カーソルを文字が存在しない部分でも動けるようにする
set hidden " バッファを閉じる代わりに隠す(Undo履歴を残すため)
set switchbuf=useopen " 新しく開く代わりにすでに開いてあるバッファを開く
set showmatch " 対応する括弧などをハイライト表示する
set matchtime=3 " 対応括弧のハイライト表示を3秒にする
set backspace=indent,eol,start " バックスペースでなんでも消せるようにする
set expandtab
set tabstop=4
set shiftwidth=4
colorscheme elflord