-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
100 lines (86 loc) · 1.86 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
set pastetoggle=<F2>
syntax on
colorscheme sublimemonokai
au BufNewFile,BufRead *.pp setlocal ft=ruby
call pathogen#infect()
call pathogen#helptags()
if has("mouse")
set mouse=a
endif
syntax enable
filetype plugin indent on
set sw=2 ts=2 sts=2
set expandtab
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
cabbr hardtabs call Hardtabs()
fun Hardtabs()
set tabstop=8
set shiftwidth=8
set softtabstop=0
set noexpandtab
endfu
cabbr wp call Wp()
fun! Wp()
set lbr
source $HOME/.vim/not-bundle/vim-autocorrect/autocorrect.vim
set guifont=Consolas:h14
nnoremap j gj
nnoremap k gk
nnoremap 0 g0
nnoremap $ g$
set nonumber
set spell spelllang=en_us
endfu
function MoveToPrevTab()
"there is only one window
if tabpagenr('$') == 1 && winnr('$') == 1
return
endif
"preparing new window
let l:tab_nr = tabpagenr('$')
let l:cur_buf = bufnr('%')
if tabpagenr() != 1
close!
if l:tab_nr == tabpagenr('$')
tabprev
endif
sp
else
close!
exe "0tabnew"
endif
"opening current buffer in new window
exe "b".l:cur_buf
endfunc
function MoveToNextTab()
"there is only one window
if tabpagenr('$') == 1 && winnr('$') == 1
return
endif
"preparing new window
let l:tab_nr = tabpagenr('$')
let l:cur_buf = bufnr('%')
if tabpagenr() < tab_nr
close!
if l:tab_nr == tabpagenr('$')
tabnext
endif
sp
else
close!
tabnew
endif
"opening current buffer in new window
exe "b".l:cur_buf
endfunc
nnoremap <C-W>. :call MoveToNextTab()<CR>
nnoremap <C-W>, :call MoveToPrevTab()<CR>
nnoremap <C-u> :GundoToggle<CR>
set number
" POWERLINE
set nocompatible " Disable vi-compatibility
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show unicode glyphs
set t_Co=256 " Explicitly tell vim that the terminal supports 256 colors
let g:Powerline_symbols = 'fancy'