forked from qiao/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
141 lines (111 loc) · 3.22 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
" Don't be compatible with vi
set nocompatible
" Set code folding
set foldmethod=indent
set foldlevel=99
" Set gundo
let g:gundo_preview_bottom=1
let g:gundo_right=1
" Set pep8
let g:pep8_map='<Leader>8'
" Set search highlight
set hlsearch
" Set file type
filetype on
filetype plugin on
filetype plugin indent on
" Set encoding
set fencs=utf-8,gbk
" Load pathogen to manage plugins
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
call pathogen#infect()
" More powerful backspacing
set backspace=indent,eol,start
" Larger history storage
set history=1000
" Enalbe syntax highlighting
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark
" Color settings
set t_Co=256
color tir_black
" Highlight at column 80 and highlight cursor line and column
set cc=80
hi ColorColumn ctermbg=lightblue guibg=lightgrey
set cursorline
set cursorcolumn
" Extra syntax highlighting for Lisp and variants
autocmd Syntax lisp,scheme,clojure runtime plugin/RainbowParenthsis.vim
" JQuery syntax support
autocmd Syntax javascript set syntax=jquery
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
" Matching
set showmatch " Show matching brackets.
set smartcase " Do smart case matching
set incsearch " Incremental search
set ignorecase " Do case insensitive matching
" Status
set showcmd " Show (partial) command in status line.
set laststatus=2 " Always show status bar
set ruler " Show cursor position
set number " Show line number
" Indentation
set autoindent
set expandtab
set tabstop=4
set shiftwidth=4
set linespace=4
autocmd Syntax html,css,ruby,javascript,coffee set tabstop=2 shiftwidth=2 linespace=2
" Indent guides (default toggle key is <leader>ig)
let g:indent_guides_auto_colors=0
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=239
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=242
" NeoComplCache
let g:neocomplcache_enable_at_startup=1
let g:neocomplcache_enable_smart_case=1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
autocmd Syntax html let g:neocomplcache_disable_auto_complete=1
" set completeopt-=preview
set completeopt=menuone,longest,preview
" SuperTab
let g:SuperTabDefaultCompletionType="<c-n>"
au FileType python set omnifunc=pythoncomplete#Complete
" Zen-coding
let g:user_zen_expandabbr_key='<c-j>'
let g:user_zen_settings={
\ 'indentation': ' ',
\}
" Nerd Tree
let NERDChristmasTree=1
let NERDTreeWinSize=45
" Tagbar
let g:tagbar_left=0
let g:tagbar_width=50
" Key mappings
nmap <F3> :set hlsearch!<cr>
nmap <F4> :IndentGuidesToggle<cr>
nmap <F5> :NERDTreeToggle<cr>
nmap <F6> :TagbarToggle<cr>
map <leader>td <Plug>TaskList
map <leader>g :GundoToggle<cr>
" Extra commands
command W w
command WQ wq
command Wq wq
command Q q
command Qa qa
command QA qa