-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
151 lines (116 loc) · 3.29 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
set nocompatible
set backupskip=/tmp/*,/private/tmp/*"
" Vundle
filetype off
set rtp+=~/.vim/vundle.git/
call vundle#rc()
" Only tab-complete the non-unique part of the file
set wildmenu
set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,*.jpg,*.gif,*.png
set wildmode=list:longest
" Incremental search. Shows results as you type.
set incsearch
" Show all matches for a search
set hlsearch
" Don't add additional pixels in between lines
set linespace=0
" Reserve 5 spaces for numbers along the left
set number
set numberwidth=5
set backspace=indent,eol,start
" Auto-wrap text and comments after 120 characters (ct)
" Insert comment leader after hitting enter while already in a comment (r)
set formatoptions=ctr
" set textwidth=120
set colorcolumn=80,120
" Four space tabs, four space tab stops, use soft tabs.
set shiftround
set softtabstop=4
set tabstop=4
set shiftwidth=4
set expandtab
" Fold around indentations
" set foldmethod=indent
" Highlight tabs and trailing spaces
set list
set listchars=tab:>-,trail:-
" Enable the mouse
set mouse=a
" Some things.
syntax on
filetype on
filetype plugin on
filetype plugin indent on
filetype indent on
colorscheme anotherdark
" StatusLine
set ruler
set showcmd
" Enable and configure a useful status line.
set laststatus=2
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]%{fugitive#statusline()}
" PHP Bits
let php_sql_query = 1
let php_htmlInStrings=1
" let php_folding=1
"run file with PHP CLI (CTRL-M)
autocmd FileType php noremap <C-M> :w!<CR>:!/usr/bin/php %<CR>
" Learn how to use HJKL
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
" Trim all whitespace at the end of lines
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Sort CSS properties
:command! SortCSSBraceContents :g#\({\n\)\@<=#.,/}/sort
" Format CSS Documents, example: :gg=G
autocmd filetype css setlocal equalprg=csstidy\ -\ --sort_properties=true\ --sort_selectors=false\ --template=low\ --silent=true
autocmd BufNewFile,BufRead *.coffee set filetype=coffee tabstop=2 ts=2
au BufRead,BufNewFile *.go set filetype=go tabstop=2 ts=2
" Magic:
" Sort the CSS brace contents
" Format it with csstidy
" Add a space after the :
" Be merry
fu! Css()
SortCSSBraceContents
exe "normal gg=G<Esc>"
exe "%s/:/: /"
retab
endf
command Css call Css()
map <F2> :retab
Bundle 'scrooloose/nerdcommenter'
Bundle 'SirVer/ultisnips'
Bundle 'bingaman/vim-sparkup'
Bundle 'tpope/vim-git'
Bundle 'tpope/vim-fugitive'
Bundle "tpope/vim-cucumber"
Bundle 'ap/vim-css-color'
Bundle 'mattn/webapi-vim'
Bundle 'mattn/gist-vim'
let g:gist_clip_command = 'pbcopy'
Bundle 'kchmck/vim-coffee-script'
Bundle 'Lokaltog/vim-powerline'
let g:Powerline_symbols = 'fancy'
Bundle "kien/ctrlp.vim"
let mapleader = ","
Bundle 'vim-scripts/XDebug-DBGp-client-for-PHP'
Bundle 'beyondwords/vim-twig'
Bundle 'uggedal/jinja-vim'
Bundle 'groenewege/vim-less'
Bundle 'wavded/vim-stylus'
" Handy numbers
Bundle "myusuf3/numbers.vim"
" Bundle 'kana/vim-fakeclip'
Bundle 'rantenki/vim-openscad'
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent execute "!chmod a+x <afile>" | endif | endif
autocmd BufWritePre * :%s/\s\+$//e
let g:UltiSnipsJumpForwardTrigger="<tab>"