-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
132 lines (107 loc) · 4.31 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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Pathogen inclusion
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call pathogen#infect()
call pathogen#helptags()
if has("autocmd")
augroup module
" Drupal *.module and *.install files.
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
autocmd BufRead,BufNewFile *.inc set filetype=php
autocmd BufRead,BufNewFile *.tpl set filetype=html
autocmd BufRead,BufNewFile *.dust set filetype=html
autocmd BufRead,BufNewFile *.wsgi set filetype=python
autocmd BufRead,BufNewFile *.json set filetype=javascript
autocmd BufRead,BufNewFile *.hbs set filetype=html
autocmd BufNewFile,BufRead *.ccss set filetype=sass
augroup END
endif
syntax on
let mapleader=","
set expandtab " tabs become spaces
set tabstop=2 " width of tabs
set shiftwidth=2
set autoindent " auto indentation
set smartindent
set fdm=syntax
set hlsearch "highlight search terms
set incsearch " highlight and search to while typing
" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>
set showmatch "Show matching bracets when text indicator is over them
set ruler " show current position
set nocompatible
nnoremap <leader>ev :vsplit $MYVIMRC<cr> " map ,ev to oedit my vimrc file
" Set backspace config
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set nu "show line numbers
set nobackup " don't create backup files or swap files - they annoy my version control
set nowb
set noswapfile
set hid " change buffer without save
map <C-B> :NERDTreeToggle<cr> " open nerdtree file browser
let NERDTreeIgnore = ['\.pyc$']
" Use the arrows to switch buffers
map <right> :bn<cr>
map <left> :bp<cr>
" alt left right for buffer switching
nnoremap <A-Left> :tabprevious<CR>
nnoremap <A-Right> :tabnext<CR>
filetype plugin on
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Omni complete functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <leader>z <C-Y>,
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Omni complete functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType scss set omnifunc=csscomplete#CompleteCSS
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType python set omnifunc=pythoncomplete#Complete " no worky neither
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Auto complete drupal
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"set dict +=~/.vim/dictionaries/drupal6.dict
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Parentheses
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:hi MatchParen cterm=bold ctermbg=none ctermfg=none "embolden matching parentheses
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Syntastic
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" from https://github.com/spf13/spf13-vim/blob/master/.vimrc
if has('statusline')
set laststatus=2
" Broken down into easily includeable segments
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
set statusline+=\ [%{&ff}/%Y] " filetype
set statusline+=%#warningmsg#
set statusline+=%{fugitive#statusline()}
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Stuff that no work
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" When vimrc is edited, reload it - doesn't seem to work always
autocmd! bufwritepost .vimrc source ~/.vimrc
set pastetoggle=<F2>
iabbrev adn and
iabbrev tehn then
iabbrev waht what
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => macvim colors
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set t_Co=256
:colorscheme koehler
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => json formatting
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>j :%!python -m json.tool<CR>