-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc.local
199 lines (166 loc) · 4.19 KB
/
vimrc.local
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
" no compatibilty with legacy vim
set nocompatible
""""""""""
" Vundle "
""""""""""
" required for vundle
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
"""""""""""
" Bundles "
"""""""""""
" github repos
Bundle 'vim-scripts/YankRing.vim'
Bundle 'regedarek/ZoomWin'
Bundle 'ervandew/supertab'
Bundle 'scrooloose/nerdcommenter'
Bundle 'scrooloose/nerdtree'
Bundle 'gregsexton/gitv'
Bundle 'godlygeek/tabular'
Bundle 'kien/ctrlp.vim'
Bundle 'sjl/gundo.vim'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'hallison/vim-markdown'
Bundle 'duwanis/tomdoc.vim'
Bundle 'rking/ag.vim'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'zerowidth/vim-copy-as-rtf'
Bundle 'chriskempson/base16-vim'
Bundle 'wikitopian/hardmode'
Bundle 'pangloss/vim-javascript'
Bundle 'bling/vim-airline'
Bundle 'Raimondi/delimitMate'
Bundle 'elixir-lang/vim-elixir'
" make html edition work in a sane way
Bundle 'tristen/vim-sparkup'
" work with handlebars
Bundle 'nono/vim-handlebars'
"""""""""""""""""""""""""""""""""
" Tim Pope is teh vim superhero "
""""""""""""""""""""""""""""""""""
Bundle "tpope/vim-fugitive"
Bundle "tpope/vim-surround"
Bundle "tpope/vim-repeat"
Bundle "tpope/vim-haml"
"""""""""""
" /Vundle "
"""""""""""
" load file type plugins + indentation
filetype plugin indent on
" set ',' as leader
let mapleader = ","
" disable arrow keys because they make 'O' unusably slow
set noesckeys
syntax enable
set encoding=utf-8
" display incomplete commands
set showcmd
" load new files per default (e.q when git-branch was switched)
set autoread
" make backspace work like most other apps
set backspace=2
" Base 16
" don't use a 256 color terminal theme
" also install macvim
set t_Co=256 " 256 color mode
set background=dark
colorscheme base16-bright
""""""""""""""
" Whitespace "
""""""""""""""
" a tab is two spaces
set tabstop=2 shiftwidth=2
" use spaces, not tabs
set expandtab
" wrap lines
set wrap
set textwidth=79
set formatoptions=qrn1
set colorcolumn=79
" show end of lines
set list
set listchars=tab:\ \ ,trail:·,eol:~
" show linenumbers
set number
"""""""""""""
" Searching "
"""""""""""""
" highlight matches
set hlsearch
" to show matches while typing
set incsearch
" ignore case on search
set ignorecase
" unless they contain at least one capital letter
set smartcase
"""""""""""""""""""""
" window navigation "
"""""""""""""""""""""
" ease up window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" nice moving inside of tex files
map j gj
map k gk
map [Up] gk
map [Down] gj
" Resize splits when the window is resized
au VimResized * exe "normal! \<c-w>="
" make it easy to resize windows
map + <C-W>+
map - <C-W>-
map ö <C-W><
map ä <C-W>>
""""""""
" misc "
""""""""
" save when focus is lost
au FocusLost * :wa
" dismiss highlighted search items on leader+space
nnoremap <leader><space> :noh<cr>
" no need for swapfiles¬
set noswapfile
" f9 to turn on/off highlighting of the current line
noremap <silent><f9> :set cursorline!<cr>
""""""""""""""""""""""""
" plugin customization "
""""""""""""""""""""""""
" graphical vim undo gundo
nnoremap <F4> :GundoToggle<CR>
" close Gundo on revert
let g:gundo_close_on_revert = 1
" NERDTree customization
map <leader><TAB> :<C-U>NERDTreeToggle<CR>
let g:NERDTreeQuitOnOpen = 1
" NERDCommenter - always use one space between comment and code
let NERDSpaceDelims = 1
" show YankRing history
nnoremap <silent> <F1> :YRShow<cr>
inoremap <silent> <F1> <ESC>:YRShow<cr>
" remap ctrlp to <leader>t
let g:ctrlp_map = '<leader>t'
" ignore tmp directory for ctrlp
set wildignore+=*/tmp/*,tmp,node_modules,*/dist
" map `;` to open ctrlp in buffermode
nnoremap ; :CtrlPBuffer<CR>
" make ZoomWin work on <leader>0
map <leader>0 :ZoomWin<CR>
" align selected lines on '='
map <leader>9 :Tabularize/=<cr>
" Hard Mode
nnoremap <leader>h <Esc>:call ToggleHardMode()<CR>
" Hard Mode per default
" autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode()
" make pasting from clipboard work (no indents etc.)
" set paste
" yanking should save to system clipboard (only works with macvim)
set clipboard=unnamed
" to toggle when pasting from clipboard
set pastetoggle=<F10>
" Use powerline symbols
let g:airline_powerline_fonts = 1