forked from emilis/emilis-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
91 lines (77 loc) · 2.03 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
" Tabs:
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
" Indenting:
set autoindent
filetype plugin indent on
set pastetoggle=<F12>
" Colors:
set t_Co=256
colorscheme morning
set foldcolumn=4
au ColorScheme * highlight FoldColumn ctermbg=bg guibg=bg
au ColorScheme * highlight StatusLineNC ctermfg=bg guifg=bg
" Top padding:
function! TopPadding()
silent! leftabove 1 split __TopPadding__
silent! setlocal buftype=nofile
silent! setlocal nobuflisted
silent! setlocal noswapfile
setlocal noma
setlocal nocursorline
setlocal nonumber
silent! setlocal norelativenumber
wincmd j
au BufEnter __TopPadding__ nested call TopPaddingClose()
endfunction
function! TopPaddingClose()
if winnr() == winbufnr(bufnr("__TopPadding__"))
bdelete
endif
endfunction
command TopPadding call TopPadding()
au VimEnter * nested call TopPadding()
" Convenient options:
syntax on
set wildmenu
set mouse=a
" Custom filetypes:
filetype on
au BufNewFile,BufRead *.ejs set filetype=javascript
au BufNewFile,BufRead *.less set filetype=less
au BufNewFile,BufRead *.cshtml set filetype=html
" Key maps:
map <F6> :bp!<CR>
imap <F6> <esc>:bp!<CR>
map <F7> :bn!<CR>
imap <F7> <esc>:bn!<CR>
map <C-PageUp> :bp!<CR>
imap <C-PageUp> <esc>:bp!<CR>
map <C-PageDown> :bn!<CR>
imap <C-PageDown> :bn!<CR>
map <A-Right> :sh<CR>
map <A-Left> :q<CR>
com! Kwbd enew|bw #
com! WM w|make
command -nargs=+ WMB w|!make <q-args> % > /dev/null &
com! WJ w|jake
" write, commit with message
command -nargs=+ Wcm w|!git commit -m <q-args> %
" Backups go to:
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp
" TagList plugin options:
let tlist_php_settings = 'php;c:class;d:constant;f:function'
let Tlist_Auto_Open = 1
let Tlist_Compact_Format = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Show_One_File = 1
let Tlist_Show_Menu = 1
let Tlist_Highlight_Tag_On_BufEnter = 0
let Tlist_Auto_Highlight_Tag = 0
" Abbreviations:
iab <expr> date» strftime("%FT%T%z")
iab <expr> time» strftime("%T")
iab <expr> now» strftime("%FT%T%z")