-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
99 lines (96 loc) · 2.83 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
" Load Pathogen to automatically load modules from ../bundle
filetype off
call pathogen#infect()
call pathogen#helptags()
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
" 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
if has("autocmd")
autocmd BufReadPost fugitive://* set bufhidden=delete
autocmd User fugitive
\ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' |
\ nnoremap <buffer> .. :edit %:h<CR> |
\ endif
endif
set number
set ignorecase
set autoindent
set showmatch
set tabstop=4
set shiftwidth=4
nnoremap <c-n> :w<cr>n<cr>
nnoremap <F3> :buffers<cr>:edit #
nnoremap <S-F3> :w<cr>e#<cr>
hi clear LineNr
" Tabs
nnoremap <F6> :tabe
nnoremap <F7> :tabp<cr>
nnoremap <F8> :tabn<cr>
nnoremap <F9> :mksession! ~/.vim.session
let loaded_matchparen = 1
" For python compatibility:
set smarttab
set expandtab
set softtabstop=4
syntax on
set background=dark
filetype indent plugin on
" Some window shortcuts:
nnoremap <F4> :86vsplit<cr>
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l
nnoremap <c-h> <c-w>h
" NerdTree Browser
nnoremap <leader>b :NERDTreeToggle<cr>
" TaskList plugin (map \td to activate instead of default \t)
nnoremap <leader>td <Plug>TaskList
" Tab Completion and Documentation
au FileType python set omnifunc=pythoncomplete#Complete
let g:SuperTabDefaultCompletionType = "context"
set completeopt=menuone,longest,preview
" Toggle Gundo code diffs:
:map <leader>g :GundoToggle<CR>
" Pyflakes quickfix window off:
let g:pyflakes_use_quickfix = 0
" Pep8 activation:
let g:pep8_map='<leader>8'
" RopeVim activation:
nnoremap <leader>j :RopeGotoDefinition<CR>
nnoremap <leader>r :RopeRename<CR>
" Ack plugin:
nmap <leader>a <Esc>:Ack!
" Git integration:
" set statusline=%f\ [%4l/%2c]\ %{fugitive#statusline()}\ %m
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
set scrolloff=5
set hlsearch