forked from tjacobs2/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc_bak
70 lines (61 loc) · 1.64 KB
/
vimrc_bak
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
" set tabstops and auto-indent to be 2 spaces
set tabstop=2
" set sw=2
" set expandtab
" allow mouse scrolling
set mouse=a
" prevent dark blue on black background
set bg=dark
" allow bash-like completion of characters
set wildmode=longest,list,full
set wildmenu
" change current dir to be dir of buffer
set autochdir
" enable syntax highlighting
syntax on
" allow w!! to write files that I forgot to open as 'sudo'
cmap w!! %!sudo tee > /dev/null %
set backspace=2
set nu
set nowrap
set ai
set hlsearch
set viminfo='1000,f1,:1000,/1000
" map <C-\> to open function definition in a new tab
map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
"set F7 and F8 to change tabs
map <F7> :tabp<CR>
map <F8> :tabn<CR>
map :sh :ConqueTermSplit bash
nmap <C-N><C-N> :set invnumber<CR>
set history=500
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
filetype plugin on
set ofu=syntaxcomplete#Complete
" when we reload, tell vim to restore the cursor to the saved position
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
\ if expand("<afile>:p:h") !=? $TEMP |
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ let JumpCursorOnEdit_foo = line("'\"") |
\ let b:doopenfold = 1 |
\ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
\ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
\ let b:doopenfold = 2 |
\ endif |
\ exe JumpCursorOnEdit_foo |
\ endif |
\ endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
\ if exists("b:doopenfold") |
\ exe "normal zv" |
\ if(b:doopenfold > 1) |
\ exe "+".1 |
\ endif |
\ unlet b:doopenfold |
\ endif
augroup END