-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
125 lines (100 loc) · 3.01 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
" Manage plugins with pathogen
call pathogen#infect()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("gui_macvim")
set background=dark
colorscheme base16-eighties
endif
"set background=light
"colorscheme base16-solarized-light
"colorscheme solarized
"Toggle solarized bkg
"call togglebg#map("<F5>")
"colorscheme desert
"colorscheme base16-ocean
set guifont=Source_Code_Pro_for_Powerline:h14
if has("gui_macvim")
set transparency=3
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on
filetype plugin indent on
set nu!
set spell
set lbr!
set autoindent
set smartindent
set cursorline
set hid
" 4 Spaces, not 1 tab
set tabstop=4
set shiftwidth=4
set expandtab
set laststatus=2
" Highlight search results
set hlsearch
" Turn off error bells
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
" Turn off brace matching for cursor legibility
let loaded_matchparen=1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Editing mappings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Ergonomic shortcut for Esc
:imap kj <Esc>
" Toggle NERDTree
:nmap \e :NERDTreeToggle<CR>
" Move to the next buffer
nmap <leader>] :bnext<CR>
" Move to the previous buffer
nmap <leader>[ :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <leader>- :bp <BAR> bd #<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Misc Plugin Settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
imap <expr> <tab> emmet#expandAbbrIntelligent("\<tab>")
let g:indent_guides_enable_on_vim_startup = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='base16_eighties'
" Hide path in tabs
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline_powerline_fonts = 1
autocmd vimenter * NERDTree "| wincmd p
let NERDTreeShowBookmarks=1
" close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" MatchTagAlways
let g:mta_filetypes = {
\ 'html' : 1,
\ 'xhtml' : 1,
\ 'xml' : 1,
\ 'php' : 1,
\}
" javascript-libraries-syntax.vim
let g:used_javascript_libs = 'angularjs,jquery'
"" setup SyntaxComplete for every filetype that does not already have a language specific OMNI script
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\ if &omnifunc == "" |
\ setlocal omnifunc=syntaxcomplete#Complete |
\ endif
endif
" Ignore angular directives
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
"" Tagbar
" Show Tagbar on PHP by default
"autocmd FileType php call SetPHPOptions()
"function! SetPHPOptions()
" :call tagbar#autoopen(0)
"endfunction
"
"
" Autoformat hotkey
noremap <F6> :Autoformat<CR>