-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim.bak
200 lines (159 loc) · 5.33 KB
/
init.vim.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
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
200
" configuration for NeoVim and vim
" =================== settings ===============================================
let isneovim = (v:progname =~? "nvim")
if isneovim
" reproduce what defaults.vim does in vim
set ruler
set showcmd
set scrolloff=5
map Q gq
inoremap <C-U> <C-G>u<C-U>
let c_comment_strings=1
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
else
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
set incsearch
set history=10000
set display=lastline
set nolangremap
endif
" general
set splitbelow
set splitright
set hidden
" visuals
set number
if has('termguicolors')
set termguicolors
endif
set list " show non-printable characters
if has('multi_byte') && &encoding ==# 'utf-8'
let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±'
endif
" search and replace
set ignorecase " ignore case, but only if ...
set smartcase " ... the search string is all lower-case
" input
set ttimeout
set ttimeoutlen=10
" cscope
set cscopetagorder=1
set cscopetag
if filereadable("cscope.out")
set nocscopeverbose
cscope add cscope.out
set cscopeverbose
endif
" =================== plugins ================================================
set runtimepath+=~/.dotfiles/dein/repos/github.com/Shougo/dein.vim
if dein#load_state("~/.dotfiles/dein/repos/github.com/Shougo/dein.vim")
call dein#begin("~/.dotfiles/dein/plugins")
call dein#add("~/.dotfiles/dein/repos/github.com/Shougo/dein.vim")
" working with projects
call dein#add('embear/vim-localvimrc')
" interface
call dein#add('Shougo/denite.nvim')
" call dein#add('atelierbram/Base2Tone-vim')
call dein#add('morhetz/gruvbox')
" completion
if isneovim
call dein#add('Shougo/deoplete.nvim')
call dein#add('Rip-Rip/clang_complete',
\ {'on_ft': ['c', 'cpp']})
endif
" navigation
call dein#add('farmergreg/vim-lastplace')
call dein#add('christoomey/vim-tmux-navigator')
call dein#add('derekwyatt/vim-fswitch',
\ {'on_ft': ['c', 'cpp']})
call dein#add('majutsushi/tagbar',
\ {'on_ft': ['c', 'cpp']})
" editing
call dein#add('tpope/vim-commentary')
call dein#add('tpope/vim-surround')
call dein#add('tpope/vim-repeat')
call dein#add('vim-scripts/ReplaceWithRegister')
" language support
call dein#add('keith/tmux.vim')
" mappings
call dein#add('tpope/vim-unimpaired')
call dein#end()
call dein#save_state()
endif
filetype plugin indent on
syntax on
" configure deoplete
let g:deoplete#enable_at_startup = 1
" configure clang_complete
let g:clang_complete_auto = 0
let g:clang_auto_select = 0
let g:clang_omnicppcomplete_compliance = 0
let g:clang_make_default_keymappings = 0
let g:clang_use_library = 1
let g:clang_library_path='/usr/local/opt/llvm/lib/'
" configure denite file_rec source
if executable('ag')
call denite#custom#var('file_rec', 'command',
\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
endif
" configure denite grep source
if executable('ag')
call denite#custom#var('grep', 'command', ['ag'])
call denite#custom#var('grep', 'default_opts',
\ ['-i', '--vimgrep', '--follow'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', [])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
elseif executable('ack')
call denite#custom#var('grep', 'command', ['ack'])
call denite#custom#var('grep', 'default_opts',
\ ['--ackrc', $HOME.'/.ackrc', '-H',
\ '--nopager', '--nocolor', '--nogroup', '--column'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', ['--match'])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
endif
" configure localvimrc
let g:localvimrc_sandbox=0
let g:localvimrc_whitelist=$HOME.'/Projekte/scratch/\(sherpa\|hej\)/.*'
let g:localvimrc_event=[ "BufEnter" ] " otherwise 'vim <dir>' does not trigger
" =================== color scheme ===========================================
" colorscheme Base2Tone_MorningLight
set background=light
let g:gruvbox_italic=1
if !has('termguicolors')
let g:gruvbox_termcolors=16
endif
colorscheme gruvbox
" =================== mappings ===============================================
" use space and alt-space as leaders
let mapleader = "\<Space>"
let maplocalleader = "\<Space>"
" Quickly open fuzzy file finder
nnoremap <silent> <leader>f :Denite file_rec<CR>
nnoremap <silent> <leader>g :Denite grep<CR>
" toggle header/implementation file
nnoremap <silent> <Leader>t :FSHere<cr>
" toggle tag bar
nmap <silent> <Leader>r :TagbarToggle<CR>
" Quickly edit/reload the vimrc file
nnoremap <silent> <leader>ve :e $MYVIMRC<CR>
nnoremap <silent> <leader>vs :so $MYVIMRC<CR>
" use Ctrl-hjkl to move between windows, cf.
" http://stackoverflow.com/questions/33833642/ctrl-h-mapping-in-neovims-terminal-emulator
" for fixing C-h for NeoVim
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" disable highlighting
nnoremap <leader>h :nohlsearch<cr>
" Make use of german special keys in normal mode
set langmap=ü[,+]
" vim: shiftwidth=2 softtabstop=2 expandtab