vimrc 15.5 KB
Newer Older
Adrián Ribao's avatar
Adrián Ribao committed
1
set nocompatible               " be iMproved
2
set hidden
Adrián Ribao's avatar
Adrián Ribao committed
3 4
filetype off                   " required!

Adrián Ribao's avatar
Adrián Ribao committed
5 6 7 8 9 10 11
set encoding=utf-8
set fileencoding=utf-8

" I'm prefer spaces to tabs
set tabstop=4
set shiftwidth=4
set expandtab
Adrián Ribao's avatar
Adrián Ribao committed
12
set number
13 14 15 16
" Highlight search
set hlsearch
" Set incremental search
set incsearch
17 18 19
" Default textwidth to 0
set textwidth=0

Adrián Ribao's avatar
Adrián Ribao committed
20 21 22 23 24
set ignorecase " ignore case when searching
set smartcase  " Si la expresión a buscar tiene una mayúscula, busca con noignorecase, sino con ignorecase
""set wrap " set wrap for lines
set nowrap " stop lines from wrapping
set title " show title in the console title bar
25 26
set nobackup
set noswapfile
Adrián Ribao's avatar
Adrián Ribao committed
27

28

29 30 31
" Color scheme
colorscheme jellybeans

Adrián Ribao's avatar
Adrián Ribao committed
32 33 34
" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
set nocompatible
Adrián Ribao's avatar
Adrián Ribao committed
35

Adrián Ribao's avatar
Adrián Ribao committed
36 37
set t_Co=256

Adrián Ribao's avatar
Adrián Ribao committed
38 39 40 41
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
42
" required!
Adrián Ribao's avatar
Adrián Ribao committed
43 44 45 46 47 48 49
Bundle 'gmarik/vundle'

" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Adrián Ribao's avatar
Adrián Ribao committed
50
" Sparkup is for writting fast html
51
" Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Adrián Ribao's avatar
Adrián Ribao committed
52
" Bundle 'wincent/Command-T'
Adrián Ribao's avatar
Adrián Ribao committed
53 54
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
55
" Bundle 'corntrace/bufexplorer'
Adrián Ribao's avatar
Adrián Ribao committed
56
Bundle 'vim-scripts/django.vim'
Adrián Ribao's avatar
Adrián Ribao committed
57
" Bundle 'vim-scripts/simple-pairs'
Adrián Ribao's avatar
Adrián Ribao committed
58 59 60
Bundle 'tpope/vim-surround'
Bundle 'vim-scripts/DrawIt'
Bundle 'othree/xml.vim'
Adrián Ribao's avatar
Adrián Ribao committed
61
"Bundle 'tsaleh/vim-matchit'
Adrián Ribao's avatar
Adrián Ribao committed
62 63
Bundle 'majutsushi/tagbar'
Bundle 'jcf/vim-latex'
Adrián Ribao's avatar
Adrián Ribao committed
64
Bundle 'othree/html5.vim'
Adrián Ribao's avatar
Adrián Ribao committed
65 66
Bundle 'vim-scripts/Align'
Bundle 'vim-scripts/SQLUtilities'
Adrián Ribao's avatar
Adrián Ribao committed
67
" emmet is for writting fast html
Adrián Ribao's avatar
Adrián Ribao committed
68 69
Bundle "mattn/emmet-vim"
Bundle 'chase/vim-ansible-yaml'
Adrián Ribao's avatar
Adrián Ribao committed
70
Plugin 'scrooloose/syntastic'
71
" Plugin 'ctrlpvim/ctrlp.vim'
Adrián Ribao's avatar
Adrián Ribao committed
72 73
Plugin 'Glench/Vim-Jinja2-Syntax'
Bundle 'Valloric/MatchTagAlways'
Adrián Ribao's avatar
Adrián Ribao committed
74
Plugin 'bling/vim-bufferline'
Adrián Ribao's avatar
Adrián Ribao committed
75
Plugin 'bling/vim-airline'
76
Plugin 'vim-airline/vim-airline-themes'
Adrián Ribao's avatar
Adrián Ribao committed
77
Plugin 'airblade/vim-gitgutter'
Adrián Ribao's avatar
Adrián Ribao committed
78
" Plugin 'tpope/vim-ragtag'
Adrián Ribao's avatar
Adrián Ribao committed
79
Plugin 'Valloric/YouCompleteMe'
80 81 82 83 84 85 86
" Bundle 'SirVer/ultisnips'
" Plugin 'honza/vim-snippets'
" autoclose brackets
Plugin 'raimondi/delimitmate'

" Ctrl space to navigate in buffers windows...
Plugin 'vim-ctrlspace/vim-ctrlspace'
Adrián Ribao's avatar
Adrián Ribao committed
87

Adrián Ribao's avatar
Adrián Ribao committed
88 89 90 91 92
" Text editor
Plugin 'junegunn/goyo.vim'
Plugin 'reedes/vim-pencil'
Plugin 'junegunn/limelight.vim'

Adrián Ribao's avatar
Adrián Ribao committed
93
" Elm
Adrián Ribao's avatar
Adrián Ribao committed
94
Plugin 'elmcast/elm-vim'
Adrián Ribao's avatar
Adrián Ribao committed
95

96 97 98
" Javascript
Plugin 'pangloss/vim-javascript'

Adrián Ribao's avatar
Adrián Ribao committed
99 100
" Elixir
Plugin 'elixir-lang/vim-elixir'
Adrián Ribao's avatar
Adrián Ribao committed
101
Plugin 'slashmili/alchemist.vim'
Adrián Ribao's avatar
Adrián Ribao committed
102

Adrián Ribao's avatar
Adrián Ribao committed
103
" Snipmate
Adrián Ribao's avatar
Adrián Ribao committed
104 105 106
" Bundle "MarcWeber/vim-addon-mw-utils"
" Bundle "tomtom/tlib_vim"
" Bundle "garbas/vim-snipmate"
Adrián Ribao's avatar
Adrián Ribao committed
107

Adrián Ribao's avatar
Adrián Ribao committed
108 109 110
" Tables
Plugin 'dhruvasagar/vim-table-mode'

Adrián Ribao's avatar
Adrián Ribao committed
111 112
" Other
Plugin 'trevordmiller/nova-vim'
Adrián Ribao's avatar
Adrián Ribao committed
113
"Bundle "robhudson/snipmate_for_django"
Adrián Ribao's avatar
Adrián Ribao committed
114

Adrián Ribao's avatar
Adrián Ribao committed
115
"Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Adrián Ribao's avatar
Adrián Ribao committed
116 117

" colorscheme nova
118

Adrián Ribao's avatar
Adrián Ribao committed
119 120
" Python
Plugin 'tell-k/vim-autopep8'
121
"Bundle 'klen/python-mode'
Adrián Ribao's avatar
Adrián Ribao committed
122
Bundle 'davidhalter/jedi-vim'
Adrián Ribao's avatar
Adrián Ribao committed
123 124 125 126 127 128
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
" Bundle 'git://git.wincent.com/command-t.git'
" ...
129 130
Plugin 'Chiel92/vim-autoformat'
Plugin 'hynek/vim-python-pep8-indent'
Adrián Ribao's avatar
Adrián Ribao committed
131 132 133 134 135 136 137 138 139 140 141

filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
142

Adrián Ribao's avatar
Adrián Ribao committed
143
" Powerline setup
Adrián Ribao's avatar
Adrián Ribao committed
144 145
"set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
"set laststatus=2
146

Adrián Ribao's avatar
Adrián Ribao committed
147 148 149 150 151 152 153 154 155 156
"Paste
set pastetoggle=<F2>

" Window movements
map <C-A-Right> <C-W>l
map <C-A-Left> <C-W>h
map <C-A-Down> <C-W>j
map <C-A-Up> <C-W>k

"" " NERDTree
Adrián Ribao's avatar
Adrián Ribao committed
157
"nnoremap <silent> <F9> :NERDTreeToggle<CR>
Adrián Ribao's avatar
Adrián Ribao committed
158 159
"nnoremap <silent> <F9> :NERDTreeTabsToggle<CR>
nnoremap <silent> <F9> :NERDTreeToggle<CR>
Adrián Ribao's avatar
Adrián Ribao committed
160 161 162 163
let NERDTreeIgnore=['.pyc$', '\~$']

" NERDCommenter
map <F3> <leader>c<space>
164
let g:NERDSpaceDelims = 1
165

Adrián Ribao's avatar
Adrián Ribao committed
166 167
"Buffer explorer
map <f4> \be
Adrián Ribao's avatar
Adrián Ribao committed
168

Adrián Ribao's avatar
Adrián Ribao committed
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
" 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)

" Disable python rope
Adrián Ribao's avatar
Adrián Ribao committed
184
let g:pymode_rope = 0
185
" Enable ROPE
Adrián Ribao's avatar
Adrián Ribao committed
186
" let g:pymode_rope = 1
Adrián Ribao's avatar
Adrián Ribao committed
187

188
" See https://github.com/klen/python-mode/issues/525
189
" let g:pymode_rope_autoimport = 0
190

Adrián Ribao's avatar
Adrián Ribao committed
191
" Syntastic
192 193 194
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
Adrián Ribao's avatar
Adrián Ribao committed
195 196 197

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
198
let g:syntastic_check_on_open = 0
Adrián Ribao's avatar
Adrián Ribao committed
199
let g:syntastic_check_on_wq = 0
200 201 202
let g:syntastic_mode_map = { 'mode': 'active',
                           \ 'active_filetypes': [],
                           \ 'passive_filetypes': [] }
Adrián Ribao's avatar
Adrián Ribao committed
203 204
let g:syntastic_javascript_checkers = ['jshint']

Adrián Ribao's avatar
Adrián Ribao committed
205
" Documentation
206 207
" let g:pymode_doc = 1
" let g:pymode_doc_key = 'K'
Adrián Ribao's avatar
Adrián Ribao committed
208

Adrián Ribao's avatar
Adrián Ribao committed
209
" Refactoring
210
" let g:pymode_rope_rename_bind = '<C-c>rr'
Adrián Ribao's avatar
Adrián Ribao committed
211

Adrián Ribao's avatar
Adrián Ribao committed
212 213
"Linting
let g:pymode_lint = 1
214
let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe']
Adrián Ribao's avatar
Adrián Ribao committed
215 216 217

" Skip errors and warnings
" E.g. "E501,W002", "E2,W" (Skip all Warnings and Errors startswith E2) and etc
218
"let g:pymode_lint_ignore = "E501,E128"
Adrián Ribao's avatar
Adrián Ribao committed
219 220
" Ignore errors related to lines longer than 80 characters: E501
let g:pymode_lint_ignore = ""
Adrián Ribao's avatar
Adrián Ribao committed
221

Adrián Ribao's avatar
Adrián Ribao committed
222
" Auto check on save
Adrián Ribao's avatar
Adrián Ribao committed
223 224
let g:pymode_lint_on_write = 1
"let g:pymode_lint_write = 1
Adrián Ribao's avatar
Adrián Ribao committed
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240

" 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 = 0
Adrián Ribao's avatar
Adrián Ribao committed
241

242 243
" Maximum allowed mccabe complexity
let g:pymode_lint_mccabe_complexity = 8
Adrián Ribao's avatar
Adrián Ribao committed
244 245

" automatically change window's cwd to file's dir
Adrián Ribao's avatar
Adrián Ribao committed
246
" set autochdir
247

Adrián Ribao's avatar
Adrián Ribao committed
248 249
"Abbreviation
ab putf # -*- coding: utf-8 -*-
Adrián Ribao's avatar
Adrián Ribao committed
250

Adrián Ribao's avatar
Adrián Ribao committed
251 252 253 254 255 256 257 258 259 260 261 262 263
" Tag bar - Remplaces taglist
nmap <F8> :TagbarToggle<CR>
autocmd FileType python map <buffer> <F8> :TagbarToggle<CR>
let g:tagbar_autoclose = 1
let g:tagbar_autofocus = 1
let g:tagbar_sort = 0
let g:tagbar_foldlevel = 0
let g:tagbar_autoshowtag = 1
"" If you want to open it only if you're opening Vim with a supported file/files  use this instead:
"autocmd VimEnter * nested :call tagbar#autoopen(1)
"" For opening Tagbar also if you open a supported file in an already running Vim:
""autocmd FileType * nested :call tagbar#autoopen(0)

Adrián Ribao's avatar
Adrián Ribao committed
264 265 266 267 268
" Autopep8
autocmd FileType python map <buffer> <F10> :call Autopep8()<CR>
let g:autopep8_disable_show_diff=0

" END PYTHON
269

Adrián Ribao's avatar
Adrián Ribao committed
270 271
" Thesaurus
set thesaurus+=~/.vim/Thesaurus_es_ES.txt
272

Adrián Ribao's avatar
Adrián Ribao committed
273
"Command_t
274 275
set wildignore+=*.o,*.obj,.git,*.pyc,env/**,_gen**,containers_data

Adrián Ribao's avatar
Adrián Ribao committed
276 277
" RST Files
autocmd Filetype rst set textwidth=75
Adrián Ribao's avatar
Adrián Ribao committed
278
autocmd Filetype rst set spell spelllang=es,en
Adrián Ribao's avatar
Adrián Ribao committed
279

Adrián Ribao's avatar
Adrián Ribao committed
280
" htmldjango
Adrián Ribao's avatar
Adrián Ribao committed
281
au BufRead,BufNewFile *.html set ft=htmldjango
282
autocmd Filetype htmldjango.html set textwidth=0
Adrián Ribao's avatar
Adrián Ribao committed
283

Adrián Ribao's avatar
Adrián Ribao committed
284
" Jinja2
Adrián Ribao's avatar
Adrián Ribao committed
285
au BufRead,BufNewFile *.j2,*.jinja2 set ft=jinja
Adrián Ribao's avatar
Adrián Ribao committed
286

Adrián Ribao's avatar
Adrián Ribao committed
287 288 289 290 291 292 293 294 295 296 297
"XML plugin
let xml_use_xhtml = 1

" Surrounding for Django
let g:surround_{char2nr("b")} = "{% block\1 \r..*\r &\1%}\r{% endblock %}"
let g:surround_{char2nr("i")} = "{% if\1 \r..*\r &\1%}\r{% endif %}"
let g:surround_{char2nr("w")} = "{% with\1 \r..*\r &\1%}\r{% endwith %}"
let g:surround_{char2nr("c")} = "{% comment\1 \r..*\r &\1%}\r{% endcomment %}"
let g:surround_{char2nr("f")} = "{% for\1 \r..*\r &\1%}\r{% endfor %}"

" CoffeeScript
298
"au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
Adrián Ribao's avatar
Adrián Ribao committed
299 300 301 302 303 304 305 306

" HTML
autocmd FileType html setlocal shiftwidth=2 tabstop=2

" Matching braces
set sm " show matching braces

"SnipMate
Adrián Ribao's avatar
Adrián Ribao committed
307 308 309
" autocmd FileType python set ft=python.django " For SnipMate
" autocmd FileType html set ft=htmldjango.html " For SnipMate
" autocmd FileType xhtml set ft=htmldjango.html " For SnipMate
Adrián Ribao's avatar
Adrián Ribao committed
310

Adrián Ribao's avatar
Adrián Ribao committed
311 312 313 314 315 316 317 318 319
"LATEX
"" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
320
let g:tex_flavor='latex'
Adrián Ribao's avatar
Adrián Ribao committed
321
autocmd Filetype tex set textwidth=120
Adrián Ribao's avatar
Adrián Ribao committed
322
autocmd Filetype tex set spell spelllang=es,en
Adrián Ribao's avatar
Adrián Ribao committed
323 324
"autocmd Filetype rst set textwidth=150
let g:Tex_DefaultTargetFormat='pdf'
325
"let g:Tex_CompileRule_pdf = 'xelatex --interaction=nonstopmode $*'
Adrián Ribao's avatar
Adrián Ribao committed
326 327


Adrián Ribao's avatar
Adrián Ribao committed
328 329 330 331 332 333 334 335 336
" SQL Formatter
" Disable sqlutil default maps
let g:sqlutil_load_default_maps = 0
"vmap <silent>sf        <Plug>SQLU_Formatter<CR>
"nmap <silent>scl       <Plug>SQLU_CreateColumnList<CR>
"nmap <silent>scd       <Plug>SQLU_GetColumnDef<CR>
"nmap <silent>scdt      <Plug>SQLU_GetColumnDataType<CR>
"nmap <silent>scp       <Plug>SQLU_CreateProcedure<CR>

Adrián Ribao's avatar
Adrián Ribao committed
337
" Python files
Adrián Ribao's avatar
Adrián Ribao committed
338 339
autocmd BufRead *.py set textwidth=79
"autocmd BufRead *.py set textwidth=99
Adrián Ribao's avatar
Adrián Ribao committed
340 341 342 343
autocmd BufRead *.py set colorcolumn=+1
" automatic text wrapping enabled
autocmd BufRead *.py set fo+=t

Adrián Ribao's avatar
Adrián Ribao committed
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
" Ignore
" See: https://github.com/tony/vim-config/blob/master/ignore.vim
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc     " MacOSX/Linux"
set wildignore+=.git
set wildignore+=.tmp
set wildignore+=.vagrant
set wildignore+=.gitmodules
set wildignore+=.ropeproject
set wildignore+=.ropeproject
set wildignore+=log/**
set wildignore+=tmp/**
set wildignore+=.tox/**
set wildignore+=.idea/**
set wildignore+=.vagrant/**
set wildignore+=.coverage/**
set wildignore+=*.egg,*.egg-info
set wildignore+=.sass-cache/
set wildignore+=__pycache__/
set wildignore+=.webassets-cache/
set wildignore+=vendor/rails/**
set wildignore+=vendor/cache/**
set wildignore+=*.gem
Adrián Ribao's avatar
Adrián Ribao committed
366
set wildignore+=*.gem
Adrián Ribao's avatar
Adrián Ribao committed
367

Adrián Ribao's avatar
Adrián Ribao committed
368 369
" CtrlP
" View https://github.com/kien/ctrlp.vim
370 371
" let g:ctrlp_map = '<c-p>'
" let g:ctrlp_cmd = 'CtrlPMixed'
Adrián Ribao's avatar
Adrián Ribao committed
372 373 374 375
" 'c' - the directory of the current file.
" 'r' - the nearest ancestor that contains one of these directories or files: .git .hg .svn .bzr _darcs
" 'a' - like c, but only if the current working directory outside of CtrlP is not a direct ancestor of the directory of the current file.
" 0 or '' (empty string) - disable this feature.
376
let g:ctrlp_working_path_mode = 'c' " The default was ra
Adrián Ribao's avatar
Adrián Ribao committed
377 378 379 380 381 382 383 384
" let g:ctrlp_working_path_mode = 0 " The default was ra
" let g:ctrlp_custom_ignore = {
  " \ 'dir':  '\v[\/]\.(git|hg|svn)$',
  " \ 'file': '\v\.(exe|so|dll)$',
  " \ 'link': 'some_bad_symbolic_links',
  " \ }
" Ignore files in .gitignore
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
Adrián Ribao's avatar
Adrián Ribao committed
385

Adrián Ribao's avatar
Adrián Ribao committed
386
" YouCompleteMe
Adrián Ribao's avatar
Adrián Ribao committed
387 388 389 390 391
let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
let g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']
let g:ycm_semantic_triggers = {
     \ 'elm' : ['.'],
     \}
Adrián Ribao's avatar
Adrián Ribao committed
392 393

" Utilsnips
394 395 396 397
" let g:UltiSnipsExpandTrigger       = "<c-j>"
" let g:UltiSnipsJumpForwardTrigger  = "<c-j>"
" let g:UltiSnipsJumpBackwardTrigger = "<c-p>"
" let g:UltiSnipsListSnippets        = "<c-k>" "List possible snippets based on current file
Adrián Ribao's avatar
Adrián Ribao committed
398

Adrián Ribao's avatar
Adrián Ribao committed
399
" Other
Adrián Ribao's avatar
Adrián Ribao committed
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
" set statusline=
" set statusline+=%<\
" set statusline+=\%#Character#%t       "tail of the filename
" set statusline+=\ %#String#Buffer:%#Number#%n       "tail of the filename
" function! BufferCount()
"     let s:statline_n_buffers = len(filter(range(1,bufnr('$')), 'buflisted(v:val)'))
"     return s:statline_n_buffers
" endfunction
" set statusline+=%#Delimiter#/%#Number#%{BufferCount()} " number of buffers
" set statusline+=\ %#Typedef#[%{strlen(&fenc)?&fenc:'none'}, "file encoding
" set statusline+=%{&ff}] "file format
" set statusline+=%h      "help file flag
" set statusline+=%m      "modified flag
" set statusline+=%r      "read only flag
" set statusline+=\ %#String#Filetype:%#Typedef#%y      "filetype
" set statusline+=\ %#String#Git\ branch:%#Typedef#%{fugitive#statusline()} " Fugitive git branch
" set statusline+=\ %#String#Current\ tag:%#Typedef#%{tagbar#currenttag('[%s]\ ','','f')} " Current tag
" set statusline+=%=      "left/right separator
" set statusline+=%#Define#%l/%L   "cursor line/total lines
" set statusline+=\ %c,     "cursor column
" set statusline+=\ %P    "percent through file
421 422 423
" Enable the statusline
set laststatus=2 " To display the status line always

Adrián Ribao's avatar
Adrián Ribao committed
424

425 426 427 428 429
" This is set at the end of the file in order to make plugins work as
" expected.
" http://stackoverflow.com/questions/5602767/why-is-vim-not-detecting-my-coffescript-filetype
syntax on

Adrián Ribao's avatar
Adrián Ribao committed
430 431 432 433 434 435 436 437 438 439 440
" Matchit plugin
runtime macros/matchit.vim

" Match tag always
let g:mta_filetypes = {
    \ 'html' : 1,
    \ 'xhtml' : 1,
    \ 'xml' : 1,
    \ 'jinja' : 1,
    \ 'htmldjango.html' : 1,
    \}
Adrián Ribao's avatar
Adrián Ribao committed
441 442 443 444 445

" Text edition
" Goyo
" The expected format of a dimension expression is
" [WIDTH][XOFFSET][x[HEIGHT][YOFFSET]]
446
"
Adrián Ribao's avatar
Adrián Ribao committed
447 448
" g:goyo_width (default: 80)
" g:goyo_height (default: 85%)
Adrián Ribao's avatar
Adrián Ribao committed
449
"g:goyo_linenr (default: 0)
Adrián Ribao's avatar
Adrián Ribao committed
450 451 452
let g:goyo_width = "90%"
let g:goyo_height = "85%"

Adrián Ribao's avatar
Adrián Ribao committed
453 454

" Pencil
Adrián Ribao's avatar
Adrián Ribao committed
455
let g:pencil#wrapModeDefault = 'soft'   " default is 'hard'
Adrián Ribao's avatar
Adrián Ribao committed
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
augroup pencil
  autocmd!
  autocmd FileType markdown,mkd call pencil#init()
  autocmd FileType rst,rest call pencil#init()
  autocmd FileType text         call pencil#init()
augroup END

" Limelight
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!

" Color name (:help cterm-colors) or ANSI code
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240

" Color name (:help gui-colors) or RGB color
let g:limelight_conceal_guifg = 'DarkGray'
let g:limelight_conceal_guifg = '#777777'

" Default: 0.5
" let g:limelight_default_coefficient = 0.7

" Number of preceding/following paragraphs to include (default: 0)
" let g:limelight_paragraph_span = 1

" Beginning/end of paragraph
"   When there's no empty line between the paragraphs
"   and each paragraph starts with indentation
" let g:limelight_bop = '^\s'
" let g:limelight_eop = '\ze\n^\s'

" Highlighting priority (default: 10)
"   Set it to -1 not to overrule hlsearch
" let g:limelight_priority = -1
" END Text edition
491

Adrián Ribao's avatar
Adrián Ribao committed
492
" Elm
Adrián Ribao's avatar
Adrián Ribao committed
493 494 495 496 497 498 499 500 501
let g:elm_jump_to_error = 0
" let g:elm_make_output_file = "elm.js"
let g:elm_make_show_warnings = 1
let g:elm_syntastic_show_warnings = 1
let g:elm_browser_command = ""
let g:elm_detailed_complete = 0
let g:elm_format_autosave = 1
let g:elm_format_fail_silently = 0
let g:elm_setup_keybindings = 1
Adrián Ribao's avatar
Adrián Ribao committed
502
" END Elm
Adrián Ribao's avatar
Adrián Ribao committed
503 504 505 506

" Tables
let g:table_mode_corner_corner="+"
let g:table_mode_header_fillchar="="
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522

" Removes trailing spaces
function! TrimWhiteSpace()
    %s/\s\+$//e
endfunction
nnoremap <silent> <Leader>rts :call TrimWhiteSpace()<CR>
autocmd FileWritePre    * :call TrimWhiteSpace()
autocmd FileAppendPre   * :call TrimWhiteSpace()
autocmd FilterWritePre  * :call TrimWhiteSpace()
autocmd BufWritePre     * :call TrimWhiteSpace()
" You can also enable that mapping on a per-filetype basis with:
" autocmd FileType python,java autocmd FileWritePre    * :call TrimWhiteSpace()
" autocmd FileType python,java autocmd FileAppendPre   * :call TrimWhiteSpace()
" autocmd FileType python,java autocmd FilterWritePre  * :call TrimWhiteSpace()
" autocmd FileType python,java autocmd BufWritePre     * :call TrimWhiteSpace()

Adrián Ribao's avatar
Adrián Ribao committed
523 524 525 526
" Airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='papercolor'

527 528 529 530 531 532 533 534 535
" Ctrlspace
let g:CtrlSpaceSearchTiming = 500
if executable("ag")
	let g:CtrlSpaceGlobCommand = 'ag -l --nocolor --ignore="src" --ignore="*.png" --ignore="*.jpg" --ignore="*.pyc" -g ""'
endif
nnoremap <silent><C-p> :CtrlSpace O<CR>
nnoremap <silent><F4> :CtrlSpace<CR>
" hide the tabline
set showtabline=0