-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
156 lines (131 loc) · 3.24 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
155
execute pathogen#infect()
syntax enable
filetype plugin indent on
" Fish stuff
autocmd FileType fish compiler fish
autocmd FileType fish setlocal textwidth=79
" turn vi compatibility off
set tags=./tags;,~/.vimtags
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files =2
let g:easytags_resolve_links = 1
let g:easytags_supress_ctags_warning = 1
set nocompatible
set showmode
set nowrap
set tabstop=4
set ruler
set hlsearch
set incsearch
set lazyredraw
set showmatch
set ffs=unix,dos,mac
set nobackup
set nowb
set noswapfile
set smarttab
set tags=tags
set softtabstop=4
set expandtab
set shiftwidth=4
set shiftround
set backspace=indent,eol,start
set autoindent
set copyindent
set number
set ignorecase
set smartcase
set visualbell
set noerrorbells
set autowrite
set smarttab
set ai
set si
set guioptions-=T
set guioptions-=r
set background=dark
set linespace=25
set guifont=Anonymous\ Pro\ for\ Powerline\ 14
autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd BufRead,BufNewFile /etc/nginx/sites-*/* setfiletype nginx
if has('autocmd')
autocmd bufwritepost .vimrc source $MYVIMRC
autocmd BufWritePre *.php,*.js,*.css,*.html :call <SID>StripTrailingWhitespaces()
endif
let g:airline_powerline_fonts=1
let g:airline_theme="dark"
let NERDTreeShowHidden=1
vnoremap <silent> * :call VisualSelection('f')<CR>
vnoremap <silent> # :call VisualSelection('b')<CR>
set laststatus=2
set encoding=utf-8
set noshowmode
" set leader to comma
let mapleader = ","
let g:mapleader = ","
nmap <leader>w :w!<cr>
nnoremap j gj
nnoremap k gk
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Tab shortcuts
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove<cr>
nmap <C-j> :tabprev<CR>
nmap <C-h> :tabnext<CR>
map <C-n> <Esc>:tabnew
" Escape shortcut
imap jj <esc>
nnoremap ,cd :cd %:p:h<CR>:pwd<CR>
" map nerdtree command to ctrl + b
nmap <C-b> :NERDTreeTabsToggle<CR>
nmap <leader>t :TagbarToggle<CR>
highlight Search cterm=underline
"Bubble lines
" http://vimcasts.org/episodes/bubbling-text/
nmap <C-Up> ddkP
nmap <C-Down> ddp
" Visual bubble lines
nmap <C-Up> xkP`[V`]
nmap <C-Down> xp`[V`]
if has('gui_running')
let g:airline_theme="solarized"
colorscheme solarized
:set guioptions -=m
:set guioptions -=T
endif
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and curor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
"Clean up: Restory prev search history and cursor position.
let @/=_s
call cursor(l,c)
endfunction
set listchars=tab:▸\ ,eol:¬
"Invisible character colors
highlight NonText guifg=#4a4a59
highlight SpecialKey guifg=#4a4a59
map <F7> mzgg=G`z<CR>
set runtimepath^=~/.vim/bundle/ctrlp.vim
set mouse=a
set spell spelllang=en_us
set spell spellfile=~/.vim/spell/security.utf-8.add
" syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_php_phpcs_args='--standard=PSR2'