-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·298 lines (248 loc) · 9.68 KB
/
Copy pathvimrc
File metadata and controls
executable file
·298 lines (248 loc) · 9.68 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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
" VIM Konfiguration Datei
" jerik
" Villeicht interessant:
" http://cscope.sourceforge.net/cscope_vim_tutorial.html
" http://kien.github.io/ctrlp.vim/ - tool for file searching
" https://github.com/rking/ag.vim/blob/master/README.md - tool for file searching
" https://github.com/osyo-manga/vim-over - see search and replaces before you execute
" http://vimcasts.org/episodes/aligning-text-with-tabular-vim/
" Vim Scripting http://andrewscala.com/vimscript/, see as well pdf in .vim
" http://web.stanford.edu/~ryanlee/posts/2015-07/vim
" @todo Julian support
" http://www.lindonslog.com/linux-unix/send-lines-code-vim-r-julia-python-repl-slime/
" https://github.com/jpalardy/vim-slime
" https://github.com/JuliaEditorSupport/julia-vim
" https://github.com/tpope/vim-commentary
let mapleader = '-'
" 2017-04-08 test for vim-pipe
" http://learnvimscriptthehardway.stevelosh.com/chapters/06.html
let maplocalleader = ','
" Kein piepen
set noerrorbells
" Globale einstellungen für Tabstop und shiftwidth
set tabstop=4
set sw=4
" Visuelles Klingeln anstat normales piepen
set visualbell
" Automatisches einrücken
set autoindent
" autowrite: Automatically save modifications to files
" when you use critical (rxternal) commands.
set autowrite
" backspace: '2' allows backspacing" over
" indentation, end-of-line, and start-of-line.
" see also "help bs".
set backspace=2
" esckeys: allow usage of cursor keys within insert mode
" You will find this useful when working, eg, on SunOS.
set esckeys
" hidden: Allow "hidden" buffers. A must-have!
set hidden
" hlsearch : highlight search - show the current search pattern
" This is a nice feature sometimes - but it sure can get in the
" way sometimes when you edit.
set nohlsearch
" ignorecase: ignore the case in search patterns? NO!
" set noignorecase
" https://vim.fandom.com/wiki/Searching
" When 'ignorecase' and 'smartcase' are both on, if a pattern contains an
" uppercase letter, it is case sensitive, otherwise, it is not. For example,
" /The would find only "The", while /the would find "the" or "The" etc.
set ignorecase
set smartcase
" Color of the search
" GUI
hi Search guibg=cyan guifg=black
" Terminal
hi Search cterm=NONE ctermfg=black ctermbg=cyan
" laststatus: show status line? Yes, always!
" laststatus: Even for only one buffer.
set laststatus=2
" magic: Use 'magic' patterns (extended regular expressions)
" in search patterns? Certainly! (I just *love* "\s\+"!)
set magic
" modeline: ...
" Allow the last line to be a modeline - useful when
" the last line in sig gives the preferred textwidth for replies.
set modeline
set modelines=1
" ruler: show cursor position? Yep!
set ruler
" number: Zeilennummer: nein
set nonumber
" showcmd: Show current uncompleted command? Absolutely!
set showcmd
" showmatch: Show the matching bracket for the last ')'?
set showmatch
" showmode: Show the current mode? YEEEEEEEEESSSSSSSSSSS!
set showmode
" 2016-12-19 http://stackoverflow.com/questions/41186370/vim-displays-content-of-file-with-signs
:set encoding=utf-8
" splitbelow: Create new window below current one.
set splitbelow
"
" statusline: customize contents of the windows' status line.
" I prefer it this way:
" Show the current buffer number and filename with info on
" modification, read-only, and whether it is a help buffer
" (show only when applied).
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)\=Pos=<%l\,%c%V>\ %P\=ASCII=%b\ HEX=%B)%=(c)\ Michael\ Prokop
" Meine favorisierte statusline:
" is now overrule by air-line
set statusline=%<[%n]\%f\%y\%r\%1*%m%*%w%=%(Spalte:\%c%V%)%4(%)%-10(Zeile:\%l%)\%4(%)%p%%\%P\ \ \ \ ASCII=%b\ HEX=%B\ \ \ \ \ [jerik]
" ttyscroll: turn off scrolling -> faster!
set ttyscroll=0
" whichwrap:
" Allow jump commands for left/right motion to wrap to previous/next
" line when cursor is on first/last character in the line:
set whichwrap=<,>,h,l,[,]
" wrapmargin:
" When do you want the line to break? A value of 1 means that 1
" "cursor" before the end of the visible screen.
" if wrapmargin=n, then the wrapping occurs if the distance to the
" right screen-border is "n" spaces
set wrapmargin=1
" Run the after ftplugin on startup"
filetype plugin on
" Swapfiles nicht ins gleich verzeichnis schreiben, sondern in ein spezielles
if has( "win32" )
set dir=C:\swps
elseif has("macunix")
set dir=/usr/local/swps
else
set dir=/usr/local/swps
endif
" copy paste with system clipboard on Windows
" set clipboard=unnamed
" jerik: 20141020
" see :Tweak # looks interesting let's try :)
" Fullscreen when opening vim # for winwos
" http://unix.stackexchange.com/questions/40047/vim-script-check-running-platform
if has( "win32" )
au GUIEnter * simalt ~x
endif
"Rails configuraiton - 2006-07-13 "
"see: :h rails"
"autocmd User Rails* Lcd
"let g:rails_level=4
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" 20170222 set font for graphical vim, to support EUR sign"
" http://www.troubleshooters.com/linux/vifont.htm
" set gfn=DejaVu_Sans_Mono:h11:cANSI @todo jerik should be a font that works on OSX/Linux
" Font names must be without whitespace: s/ /_/g
set guifont=Meslo_LG_M_Regular_for_Powerline:h12
" Projects notes mit neuer Syntax versehen
au BufRead,BufNewFile *.log set filetype=plog
au BufRead,BufNewFile journal.txt set filetype=plog fo-=t
" alternative way: https://stackoverflow.com/q/1413285/1933185
" au BufRead, BufNewFile Journal.txt call JournalOptions()
" function JournalOptions()
" set filetype = plog
" set fo-=t
" endfunction
" jerik 20141014
" Realod listed files if they are saved
" http://www.bestofvim.com/tip/auto-reload-your-vimrc/
" augroup reload_vimrc "{
" autocmd!
" autocmd BufWritePost $MYVIMRC so $MYVIMRC
" augroup "}
" jerik 20141014
" DOES NOT WORK
" http://stackoverflow.com/questions/11068128/how-to-disable-vim-autocomplete-popup-for-plain-text-files
" autocmd WinEnter * :if &ft=='vim' | DisableAcp | else | EnableAcp | endif
" jerik 20141014
" @todo Do I need the tweak.vim or merge into .vimrc?
" Rehash: Reload my vim configuration files"
function! Rehash()
":so $HOME/vimfiles/plugin/tweak.vim
":so $HOME/vimfiles/plugin/sandbox.vim
exec ":so " . MyVimFolder() . "/plugin/tweak.vim"
exec ":so " . MyVimFolder() . "/plugin/sandbox.vim"
echom "Reloaded tweak.vim, sandbox.vim"
endfunction
command! Rehash call Rehash()
filetype plugin indent on " Required!
" https://github.com/junegunn/vim-plug/wiki/faq
" @todo vimfiles should be a variable which is .vim or vimfiles, based on the OS
" To install run :PlugInstall
" To remove, update vimrc, :so vimrc, :PlugClean
call plug#begin('~/.vim/plugged')
""Plug 'junegunn/seoul256.vim'
""Plug 'junegunn/goyo.vim'
""Plug 'junegunn/limelight.vim'
"Plug 'jelera/vim-javascript-syntax'
"Plug 'Raimondi/delimitMate'
"Plug 'https://github.com/garbas/vim-snipmate.git'
"Plug 'tomtom/tlib_vim' "# not sure for which use case it is
"Plug 'MarcWeber/vim-addon-mw-utils' "# not sure for which use case it is
"Plug 'garbas/vim-snipmate'
" for more vim-python stuff see: https://stackabuse.com/vim-for-python-development/
"Plug 'honza/vim-snippets'
" https://vimawesome.com/plugin/python-mode python-mode vs flake8
"Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
" runs with F7, needs to have pip3 install flake8 for the venv! use :cnext, :cprevious
Plug 'nvie/vim-flake8'
" not sure if syntastic works, lets see if there is commign something :)
Plug 'vim-syntastic/syntastic'
Plug 'kien/ctrlp.vim'
Plug 'davidhalter/jedi-vim'
" Plug 'ervandew/supertab' " 2019-12-01 disabled supertab, perhaps it interferes with ultisnips
Plug 'Townk/vim-autoclose'
Plug 'tpope/vim-commentary'
"Plug 'krisajenkins/vim-pipe' "# 2019-10-01 not usefull for python"
""Plug 'tpope/vim-fugitive' "# 2019-10-01 not working, get errors, cannot execute :Git"
Plug 'NLKNguyen/papercolor-theme'
Plug 'gabrielelana/vim-markdown'
" Multiple Plug commands can be written in a single line using | separators
" https://yufanlu.net/2016/10/30/ultisnips/ cool usage tips
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'tpope/vim-surround'
call plug#end()
" disable spell checking
let g:markdown_enable_spell_checking = 0
" flake8 configurations -- seems not ot work; Die Spalte mit der Anzeige in
" der Datei wird nicht mehr angezeigt, der fehler taucht noch im
" dialog-fenster auf
" see: https://github.com/vim-syntastic/syntastic/issues/204
" let g:syntastic_python_checker_args='--ignore=E501'
let g:syntastic_python_flake8_post_args='--ignore=E501,E401'
"let g:syntastic_python_flake8_post_args='--ignore=E501,E128,E225'
" 2019-12-01 ultisnip configuration
" The below shortcuts are the default wonesss. See help: Trigger key mappings
" let g:UltiSnipsExpandTrigger="<tab>"
" let g:UltiSnipsListSnippets="<c-tab>
" let g:UltiSnipsJumpForwardTrigger="<c-j>"
" let g:UltiSnipsJumpBackwardTrigger="<c-k>"
" TODO @todo vim-airline # Needs the powerline fonts, installed. Does not work out of the box
" better colorschema"
"color jerik
colorscheme fruchtig
" colorscheme PaperColor
if has("gui_running")
set background=light
endif
" Nerdtree like setup of netrw
" https://shapeshed.com/vim-netrw/
" :Ex, :Sex, :Vex = current, horizontal split, vertical split window
" remove banner; Toggle with "I"
let g:netrw_banner = 0
" Listing style. Cycle through styles with "i"
let g:netrw_liststyle = 3
" open in 1, 2, 3, 4 = new horizontal, new vertical split, new tab, previous
" window
let g:netrw_browse_split = 4
let g:netrw_altv = 1
" Set witdht of the directory explorer
let g:netrw_winsize = 25
" open when starting with vim; do I need that?
" augroup ProjectDrawer
" autocmd!
" autocmd VimEnter * :Vexplore
" augroup END