-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.vimrc
More file actions
148 lines (114 loc) · 3.1 KB
/
base.vimrc
File metadata and controls
148 lines (114 loc) · 3.1 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
syntax on
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
colorscheme codeschool
set termguicolors
set number
set relativenumber
set cursorline
set laststatus=2
set virtualedit=all
set t_Co=256
set scrolloff=5
set tabpagemax=30
set switchbuf=usetab
set splitright
set splitbelow
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
set showcmd
set showmatch
set wildmenu
set hidden
set smartindent
set autoindent
set cindent
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set wrap
set colorcolumn=80
set textwidth=80
set ignorecase
set smartcase
set hlsearch
set incsearch
set backspace=indent,eol,start
set history=100 " keep 100 lines of command line history
set noundofile
set clipboard+=unnamed
"set sessionoptions-=curdir
set ssop-=curdir
"set sessionoptions+=sesdir
set ssop+=sesdir
let g:session_directory=getcwd()
let g:session_autosave='no'
set diffopt+=filler
set diffopt+=iwhite
set diffopt+=vertical
set encoding=utf-8
set spelllang=en
set foldcolumn=2
set foldmethod=indent
set foldlevel=0
" open all folds on file open
au BufRead * normal zR
set concealcursor=vin
set conceallevel=2
set completeopt=menu,menuone,longest
let g:airline_powerline_fonts = 1
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 10
if has('gui_running')
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 10
set guioptions=aMgh
endif
" Don't use Ex mode, use Q for formatting
map Q gq
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
inoremap <C-Space> <c-x><c-u>
inoremap <C-@> <c-x><c-u>
nnoremap <silent> <S-F3> :TagbarShowTag<CR>
nnoremap <silent> <F3> :TagbarToggle<CR>
nnoremap <silent> <F5> :TaskList<CR>
nnoremap <silent> <F8> :TMToggle<CR>
nnoremap <silent> <F9> :TMFocus<CR>
nnoremap <silent> <F11> :GundoToggle<CR>
nnoremap <silent> <F12> :ZoomWin<CR>
function CountEditors()
:Gblame
:set modifiable
:%s/.\{-} (\(.\{-}\)\s* 20.\{-}).*/\1/
:% !sort | uniq -c
endfunction
nnoremap <silent> <LEADER>who :call CountEditors()<CR>
set autoread
nnoremap <silent> <Leader>r :checktime<CR>
" Unite
nnoremap <C-p> :Unite<CR>
call unite#filters#matcher_default#use(['matcher_fuzzy'])
let g:unite_source_history_yank_enable = 1
map <C-PAGEUP> :bp<CR>
map <C-PAGEDOWN> :bn<CR>
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif