-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
84 lines (66 loc) · 1.93 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
call pathogen#infect()
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set showmatch
set incsearch
set number
set nofoldenable " disable folding
set modeline
set ls=2
set t_Co=256
set listchars=tab:▸\ ,eol:¬
syntax on
set shell=bash
colorscheme aloe
set background=dark
" gitgutter
let g:gitgutter_enabled = 1
" markdown
let g:vim_markdown_folding_disabled=1
" airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_left_sep='▶'
let g:airline_right_sep='◀'
let g:airline_theme='sol'
highlight ColorColumn ctermbg=255
map ,t :w\|:!mocha %
map ,tr :w\|:!browserify -t reactify -e % > foo.js && mocha foo.js
map ,p :w\|:!python %
map ,y :w\|:!node %
map ,c :w\|:!echo % \| pbcopy \<cr>
map ,b :w\|:!gulp bundle
map ,bw :w\|:!gulp bundle-web
map ,ba :w\|:!gulp bundle-app
map ,gb :Gblame<cr>
map ,gg :Ggrep<cr>
map ,gl :Glog<cr>
" go to last cursor postion if there was one
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
au BufNewFile,BufRead *.less set filetype=css
au BufNewFile,BufRead *.json set filetype=js
au BufNewFile,BufRead *.md set filetype=markdown
au BufEnter *.js vmap ,c <esc>:'<, '>:w !highlight --syntax=js --style=seashell --line-numbers -O rtf \| pbcopy<CR>
au BufEnter *.html vmap ,ht <esc>:'<, '>:w !highlight --syntax=html --style=zenburn --line-numbers -O rtf \| pbcopy<CR>
au BufEnter *.css vmap ,c <esc>:'<, '>:w !highlight --syntax=css --style=zenburn --line-numbers -O rtf \| pbcopy<CR>
" Show syntax highlighting groups for word under cursor
nmap <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
augroup PatchDiffHighlight
autocmd!
autocmd BufEnter *.patch,*.rej,*.diff syntax enable
augroup END