-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrcmin
185 lines (150 loc) · 5.24 KB
/
vimrcmin
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
" Initialize: "{{{
" Vim not vi.
set nocompatible
"We need a coolest (and useful) mapleader.
let g:mapleader = ','
" Define Augroup as good practice to prevent double code execution on reload
" vimrc
augroup VIMRC
autocmd!
augroup END
" Default bundle directory. .vim directory must exist. (NeoBundle must be
" installed
set runtimepath+=~/.vim/bundle/neobundle.vim/
"Now, initializes Neobundle.
call neobundle#begin(expand('~/.vim/bundle/'))
"}}}
"Plugins, plugins everywhere {{{
"Let Neobundle manage Neobundle
NeoBundleFetch 'Shougo/neobundle.vim'
"Highly recomended. For asynchronous plugins.
NeoBundle 'Shougo/vimproc', {'build': {'unix': 'make -f make_unix.mak'}}
"A decent syntax colours
NeoBundle 'w0ng/vim-hybrid'
" For web. Front-end {{{
NeoBundleLazy 'wavded/vim-stylus', {'autoload': {'filetypes': 'stylus'}}
NeoBundleLazy 'othree/yajs.vim', { 'autoload' : {'filetypes' : 'javascript' }}
" }}}
" Utils {{{
NeoBundle 'christoomey/vim-tmux-navigator'
NeoBundle 'tpope/vim-sensible'
NeoBundle 'jszakmeister/vim-togglecursor'
NeoBundle 'tpope/vim-vinegar'
NeoBundle 'tpope/vim-unimpaired'
NeoBundle 'tpope/vim-surround'
NeoBundle 'ajkaanbal/autoswap.vim'
NeoBundle 'wakatime/vim-wakatime'
NeoBundle 'Valloric/YouCompleteMe'
NeoBundle 'ntpeters/vim-better-whitespace'
NeoBundleLazy 'Shougo/unite.vim', { 'autoload': {'commands': ['Unite']} }
"}}}
"end plugin list }}}
call neobundle#end()
" Plugins by filetype and enable indent. Required for Neobundle.
filetype plugin indent on
" Coloritos
syntax enable
" Terminal setting to allow to use `muchos coloritos`
set t_Co=256
"Check if every bundle listing is installed.
NeoBundleCheck
" end-initialization }}}
" Encoding {{{
set encoding=utf8
" }}}
" Edit {{{
"options needed for whitespaces instead tabs
set tabstop=4
set shiftwidth=4
set expandtab
" end-edit}}}
" View {{{
set number
set nowrap
set showcmd
set list
set listchars=tab:▸\ ,trail:·,extends:»,precedes:«,nbsp:%,eol:¬
set splitbelow
set splitright
set foldlevel=5
" end-view}}}
" Utils {{{
set path+=**
" }}}
" mapings {{{
" Remove all trailing whitespace:
nnoremap <silent> d<space> :StripWhitespace<esc>
" Useful save mappings.
nnoremap <silent> <CR> :<C-u>w<CR>
map ' `
"# Change to paste mode to avoid akward indentation
nnoremap <F12> :set invpaste paste?<CR>
set pastetoggle=<F12>
" }}}
" Syntax {{{
augroup VIMRC
autocmd FileType vim setlocal foldmethod=marker tabstop=2 shiftwidth=2
autocmd FileType html setlocal foldmethod=indent tabstop=2 shiftwidth=2
autocmd FileType javascript setlocal omnifunc=tern#Complete | setlocal completeopt-=preview
augroup END
" }}}
" Plugins settings: {{{
" vim-hybrid {{{
let bundle = neobundle#get('vim-hybrid')
function! bundle.hooks.on_post_source(bundle)
colorscheme hybrid
" Custom colors for this color scheme
"highlight Comment ctermfg=242
endfunction
" }}}
" unite {{{
" Variables.
let g:unite_source_history_yank_enable = 1
let g:unite_enable_split_vertically = 0
let g:unite_winheight = 12
let g:unite_enable_short_source_names = 1
let g:unite_source_file_mru_filename_format = ':~:.'
let g:unite_source_file_mru_limit = 300
let g:unite_source_directory_mru_limit = 300
let g:unite_split_rule = 'botright'
" Like Textmate icons.
let g:unite_marked_icon = '✗'
let g:unite_prompt = '» '
let g:unite_enable_start_insert = 1
if executable('ag')
" Directory partial match.
call unite#custom#default_action('directory', 'narrow')
" Use ag in unite grep source.
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts =
\ '--line-numbers --nocolor --nogroup --all-text'
let g:unite_source_grep_recursive_opt = ''
"ignore what there is in .gitignore or .hgignore
let g:unite_source_rec_async_command='ag --follow --nocolor --nogroup -g ""'
endif
nnoremap <C-@>f :<C-u>Unite file_rec/async:! -prompt-direction=top<CR>
nnoremap <C-@>p :<C-u>Unite file_rec/async -prompt-direction=top<cr>
nnoremap <C-@>b :<C-u>Unite buffer -prompt-direction=top<cr>
nnoremap <C-@>t :<C-u>Unite tab -prompt-direction=top<cr>
nnoremap <C-@>r :<C-u>Unite file_mru -prompt-direction=top<CR>
nnoremap <C-@>m :<C-u>Unite mark -prompt-direction=top<CR>
nnoremap <C-@>k :<C-u>Unite bookmark -prompt-direction=top<CR>
nnoremap <C-@>j :<C-u>Unite jump -prompt-direction=top<CR>
nnoremap <C-@>c :<C-u>Unite change -prompt-direction=top<CR>
nnoremap <C-@>o :<C-u>Unite outline -prompt-direction=top<CR>
nnoremap <C-@>/ :<C-u>Unite grep:. -prompt-direction=top<CR>
nnoremap <C-@>a :<C-u>Unite buffer file_mru bookmark -prompt-direction=top<CR>
nnoremap <C-@>* :<C-u>UniteWithCursorWord grep:. -prompt-direction=top<cr>
autocmd VIMRC FileType unite call s:unite_my_settings()
function! s:unite_my_settings() "{{{
"Split-right with C-v
imap <silent><buffer><expr> <C-v> unite#do_action('right')
" Clear searching highlight
let @/ = ""
nmap <buffer> <ESC> <Plug>(unite_exit)
endfunction
" }}}
" end-plugins-settings}}}
" HELP {{
" ]p - to paste with indent
" }}}