-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
154 lines (123 loc) · 4.14 KB
/
.vimrc
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
scriptencoding utf-8
set encoding=utf-8
if has('gui_running')
source $VIMRUNTIME/mswin.vim
behave mswin
endif
" General " {{{
set nocompatible
set noswapfile
set hlsearch " Highlight search
set ignorecase " Ignore case
set smartcase " Be case sensitive when input has a capital letter
set incsearch " Incremental search
set backspace=indent,eol,start " Allow backspace on any character
" " }}}
" Formatting " {{{
set tabstop=4 " Tell how many columns a tab counts for
set shiftwidth=4 " Tell how many columns text is indented with the reindent operations (<< and >>)
set softtabstop=4 " Tell how many spaces a <Tab> or a <BS> counts for
set expandtab " Expand tab to spaces
set autoindent " Auto indent depending on the file type
set textwidth=0 " Prevent auto-line break
" " }}}
" Visual " {{{
set ruler
set linebreak
set showbreak=>
set laststatus=2
set wildmenu
set listchars=eol:$,trail:·
" " }}}
" Scripts and Bundles " {{{
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" Programming
Bundle 'ctrlpvim/ctrlp.vim'
Bundle 'klen/python-mode'
" Python-mode
" Activate rope
" Keys:
" K Show python docs
" <Ctrl-Space> Rope autocomplete
" <Ctrl-c>g Rope goto definition
" <Ctrl-c>d Rope show documentation
" <Ctrl-c>f Rope find occurrences
" <Leader>b Set, unset breakpoint (g:pymode_breakpoint enabled)
" [[ Jump on previous class or function (normal, visual, operator modes)
" ]] Jump on next class or function (normal, visual, operator modes)
" [M Jump on previous class or method (normal, visual, operator modes)
" ]M Jump on next class or method (normal, visual, operator modes)
let g:pymode_rope = 0
" Set default pymode python options
let g:pymode_options = 1
" Documentation
let g:pymode_doc = 1
let g:pymode_doc_key = 'K'
" Linting
let g:pymode_lint = 1
let g:pymode_lint_checker = "pyflakes,pep8"
let g:pymode_lint_write = 1 " Auto check on save
let g:pymode_lint_ignore = "E501" " E501 line too long (137 > 79 characters) [pep8]
let g:pymode_lint_ignore .= ",E302" " E302 expected 2 blank lines, found 0 [pep8]
" Support virtualenv
let g:pymode_virtualenv = 1
" Enable breakpoints plugin
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_key = '<leader>b'
" Syntax highlighting
let g:pymode_syntax = 1
let g:pymode_syntax_all = 1
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
let g:pymode_syntax_space_errors = g:pymode_syntax_all
" Don't autofold code
let g:pymode_folding = 1
" Autoremove unused whitespaces
let g:pymode_utils_whitespaces = 0
Bundle 'nathanaelkane/vim-indent-guides'
let g:indent_guides_guide_size = 1
let g:indent_guides_start_level = 2
let g:indent_guides_enable_on_vim_startup = 1
" Utility
Bundle 'scrooloose/nerdtree'
map <F2> :NERDTreeToggle<CR>
" Colorscheme
Bundle 'altercation/vim-colors-solarized'
if has('gui_running')
set guifont=DejaVu\ Sans\ Mono\ 9
set background=dark
colorscheme solarized
hi cursor guifg=yellow guibg=red
hi comment guifg=#80a0ff
hi todo gui=bold guibg=purple4
hi error guibg=red4
hi visual guifg=NONE guibg=NONE
else
colorscheme default
set background=dark
" Disable the indent guides that cause black columns in console
let g:indent_guides_enable_on_vim_startup = 0
endif
filetype plugin indent on " Automatically detect file types.
syntax on
" " }}}
" Fine tuning for file type
autocmd BufRead,BufNewFile *.conf setfiletype conf
autocmd FileType gitcommit setlocal textwidth=80
autocmd FileType python setlocal textwidth=120
autocmd FileType python set wrap
autocmd FileType css,html,htmlcheetah,htmldjango,rst,xhtml setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType yaml setlocal tabstop=2 shiftwidth=2 softtabstop=2 indentexpr=
" Key mappings " {{{
nnoremap <silent> <C-H> :tabprevious<CR>
nnoremap <silent> <C-L> :tabnext<CR>
" move tab to left/right
nnoremap <silent> <A-Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
nnoremap <silent> <A-Right> :execute 'silent! tabmove ' . tabpagenr()<CR>
map ]} ]M
map [{ [M
nnoremap <leader>= :call pymode#TrimWhiteSpace()<CR>
" " }}}
set nofoldenable