344 lines
7.5 KiB
VimL
344 lines
7.5 KiB
VimL
" Use Vim settings, rather then Vi settings (much better!).
|
||
" This must be first, because it changes other options as a side effect.
|
||
set nocompatible
|
||
|
||
" Setzen des Runtimepath, in dem die Vimfiles gesucht werden:
|
||
let runtimepath_orig = &runtimepath
|
||
let &runtimepath = ''
|
||
|
||
" zuerst in vimsuite suchen
|
||
let &runtimepath = &runtimepath . ',' . g:vimfiles
|
||
|
||
" dann in vim Installation suchen
|
||
let &runtimepath = &runtimepath . ',' . runtimepath_orig
|
||
|
||
" dann in vimsuite/after suchen
|
||
let &runtimepath = &runtimepath . ',' . g:vimfiles . '/after'
|
||
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.stefan/after'
|
||
|
||
" packages liegen unter vimsuite/pack
|
||
execute "set packpath+=".g:vimsuite
|
||
|
||
" ------------------
|
||
" packages / plugins
|
||
" ------------------
|
||
packadd! asyncrun
|
||
"packadd! conque
|
||
"packadd! diffchar
|
||
packadd! dirdiff
|
||
packadd! direnv.vim
|
||
packadd! DoxygenToolkit
|
||
packadd! flake8
|
||
packadd! flog
|
||
packadd! fugitive
|
||
if has('vim9script')
|
||
packadd! git-lens.vim
|
||
endif
|
||
packadd! gundo
|
||
packadd! isort
|
||
packadd! linediff
|
||
packadd! merginal
|
||
packadd! plantuml-syntax
|
||
"packadd! pyclewn
|
||
"packadd! pylint
|
||
packadd! python-pep8-indent
|
||
packadd qml
|
||
packadd! sessionman
|
||
packadd! SrchRplcHiGrp
|
||
packadd! syntastic
|
||
packadd! tagbar
|
||
"packadd! tail
|
||
packadd! tcomment
|
||
packadd! termdebug
|
||
packadd! vimagit
|
||
packadd! vim-bash-completion
|
||
packadd! vim-clang-format
|
||
packadd! vim-textidote
|
||
packadd! VisIncr
|
||
packadd! xml
|
||
packadd! yapf
|
||
packadd! YouCompleteMe
|
||
|
||
" call plug#begin()
|
||
" ...
|
||
" Plug 'Eliot00/git-lens.vim'
|
||
" ...
|
||
" call plug#end()
|
||
|
||
" global settings
|
||
" ---------------
|
||
set nobackup " keep no backup file
|
||
set history=50 " keep 50 lines of command line history
|
||
set ruler " show the cursor position all the time
|
||
set showcmd " display incomplete commands
|
||
set belloff=all
|
||
|
||
" filetype detection
|
||
filetype on
|
||
filetype plugin on
|
||
filetype plugin indent on
|
||
"syntax highlighing
|
||
"syntax on
|
||
syntax enable
|
||
|
||
if has('gui')
|
||
set guifont=Liberation\ Mono\ 9
|
||
"set guifontwide=
|
||
set guioptions=arL
|
||
set guioptions+=m
|
||
"set tearoff-feature
|
||
set guioptions+=t
|
||
" add toolbar
|
||
" set guioptions+=T
|
||
endif
|
||
|
||
colorscheme Stefan
|
||
|
||
" no syntax highlighting when printing
|
||
set printoptions+=syntax:n
|
||
|
||
" truecolor for console
|
||
set termguicolors
|
||
|
||
"highlight search
|
||
set incsearch
|
||
set hlsearch
|
||
|
||
" set global option for substitute
|
||
set gdefault
|
||
" case sensitive search
|
||
set noignorecase
|
||
" ignore some pattern in filesearch
|
||
set wildignore+=.git
|
||
set wildignore+=.svn
|
||
|
||
" set very intelligent formatting
|
||
set formatoptions=croqwan2
|
||
|
||
" --------
|
||
" Changing
|
||
" --------
|
||
|
||
" overwrite selected text
|
||
vnoremap p s<C-R>0<ESC>
|
||
vnoremap P s<C-R>0<ESC>
|
||
|
||
" -------
|
||
" Display
|
||
" -------
|
||
" switchbuffer: use open window, split if new
|
||
"set switchbuf=useopen,split
|
||
set switchbuf=useopen
|
||
" wrap long lines
|
||
set wrap
|
||
" show line-numbers
|
||
set number
|
||
" show title
|
||
set title
|
||
" show matching bracket
|
||
set showmatch
|
||
" matchtime in 1/10 seconds
|
||
set matchtime=5
|
||
" show wrapped line
|
||
set showbreak=-->
|
||
" show position of cursor
|
||
set ruler
|
||
" show incomplete command
|
||
set showcmd
|
||
" match braces
|
||
"nnoremap g4 /[\(\{\[]<CR>:nohls<CR>v%o
|
||
"vnoremap g4 vg4
|
||
|
||
" set textwidth to 78
|
||
set textwidth=100
|
||
|
||
" special characters
|
||
" list special characters
|
||
set list
|
||
" special characters:
|
||
set listchars=eol:$
|
||
set listchars+=tab:>\
|
||
set listchars+=trail:_
|
||
set listchars+=extends:<3A>
|
||
set listchars+=precedes:<3A>
|
||
" special characters for keywords
|
||
" set iskeyword+=
|
||
|
||
" ------------
|
||
" diff options
|
||
" ------------
|
||
if &diff
|
||
set guioptions+=b
|
||
" turn off csv ftplugin in diff mode
|
||
au! filetypedetect * *.csv,*.dat,*.tsv,*.tab
|
||
" Turn off spellcheck
|
||
setlocal nospell
|
||
endif
|
||
|
||
" Switch spell off in diff mode
|
||
autocmd OptionSet diff setlocal nospell
|
||
|
||
" horizontal scrollbar in diff-mode
|
||
set diffopt=filler,vertical
|
||
" don't switch on DiffChar by default
|
||
let g:DiffExpr = ''
|
||
|
||
" turn diff off
|
||
command DiffClose call DiffClose()
|
||
function DiffClose()
|
||
diffoff!
|
||
:quit
|
||
endfunction
|
||
|
||
" options for DirDiff
|
||
let g:DirDiffCommand = expand($VIMRUNTIME . '/diff')
|
||
let g:DirDiffExcludes = '*.log,*.pyc,.svn,.git*,.asc,.static_wa,out,Build,build,tags,cscope.out,.directory'
|
||
"let g:DirDiffDynamicDiffText = 1
|
||
|
||
|
||
|
||
" ------
|
||
" Moving
|
||
" ------
|
||
" scrollwith at ^U and ^D
|
||
set scroll=5
|
||
" lines around the cursor
|
||
set scrolloff=10
|
||
" wrap line at (b=<BS>, s=<space>, h, l, <, >, [, ])
|
||
set whichwrap=
|
||
" backspace deletes: (indent,eol,start)
|
||
set backspace=indent
|
||
set backspace+=start
|
||
" mark word under cursor
|
||
nnoremap gm :let @/ = "<C-R><C-W>"<CR>:set hlsearch<CR>
|
||
vnoremap gm y:let @/ = "<C-R>0"<CR>:set hlsearch<CR>
|
||
" go to tag under cursor
|
||
"nnoremap tt g<C-]>
|
||
" find next error
|
||
nnoremap <C-N> :cn<CR>
|
||
" go back to previous edited file
|
||
nnoremap gb :call GotoLastFile()<CR>
|
||
|
||
" -----------
|
||
" come and go
|
||
" -----------
|
||
set sessionoptions-=blank
|
||
set sessionoptions+=buffers
|
||
set sessionoptions+=curdir
|
||
set sessionoptions+=folds
|
||
set sessionoptions-=help
|
||
set sessionoptions+=resize
|
||
set sessionoptions+=tabpages
|
||
set sessionoptions-=terminal
|
||
set sessionoptions+=winsize
|
||
" open window size
|
||
if &diff
|
||
autocmd GUIEnter * set lines=60 columns=200
|
||
else
|
||
autocmd GUIEnter * set lines=60 columns=100
|
||
endif
|
||
" read and write files automatically
|
||
set autoread
|
||
set autowrite
|
||
set autowriteall
|
||
" keep original files for these filetypes
|
||
set patchmode=
|
||
" jump to '" when reading a file
|
||
"autocmd BufEnter *
|
||
"autocmd BufReadPost *
|
||
" \ if line("'\"") > 0 && line("'\"") <= line("$") |
|
||
" \ execute "normal g'\"" |
|
||
" \ endif
|
||
|
||
" set nomodifiable on writeprotected files
|
||
autocmd BufReadPost * if &readonly == 1 | setlocal nomodifiable | endif
|
||
" read all files on got of focus
|
||
" autocmd FocusGained * execute
|
||
" save all files on loss of focus
|
||
autocmd FocusLost * execute ':silent! wa'
|
||
" save session if available
|
||
autocmd FocusLost * execute ':if v:this_session != "" | SessionSave'
|
||
" since we always save, don't use a swapfile
|
||
set noswapfile
|
||
|
||
" -----------
|
||
" spell check
|
||
" -----------
|
||
set spelllang=de,en
|
||
let &spellfile=g:vimfiles.'/spell/myspell.add'
|
||
let g:textidote_jar = '/usr/share/java/textidote.jar'
|
||
|
||
" ----------
|
||
" Completion
|
||
" ----------
|
||
set completeopt=longest
|
||
set completeopt+=menuone
|
||
|
||
" --------------
|
||
" DoxygenToolkit
|
||
" --------------
|
||
" let g:DoxygenToolkit_authorName = 'Stefan Liebl <Stefan.Liebl@toptica.com>'
|
||
let g:DoxygenToolkit_compactOneLineDoc = "yes"
|
||
let g:DoxygenToolkit_compactDoc = "yes"
|
||
" Replace version by copyright ...
|
||
let g:DoxygenToolkit_versionTag = "@copyright "
|
||
let g:DoxygenToolkit_versionString = "Copyright TOPTICA Photonics AG"
|
||
|
||
" -----
|
||
" netrw
|
||
" -----
|
||
"let g:netrw_keepdir = 0
|
||
|
||
" ---------
|
||
" T-Comment
|
||
" ---------
|
||
"let g:tcomment#options = {'col': 1, 'whitespace': 'no'}
|
||
|
||
" ---------
|
||
" VC plugin
|
||
" ---------
|
||
let g:vc_log_name = '~/vc.log'
|
||
|
||
" ------
|
||
" flake8
|
||
" ------
|
||
command Flake8 call Flake8()
|
||
command PyFlake Flake8
|
||
" Flake8 options are stored in ~/.config/flake8
|
||
|
||
" -----
|
||
" Isort
|
||
" -----
|
||
command PyIsort Isort
|
||
|
||
" -----------
|
||
" ClangFormat
|
||
" -----------
|
||
let g:clang_format#command = 'clang-format-15'
|
||
let g:clang_format#detect_style_file = 1
|
||
let g:clang_format#auto_format = 1
|
||
let g:clang_format#auto_format_on_insert_leave = 0
|
||
let g:clang_format#auto_formatexpr = 0
|
||
let g:clang_format#enable_fallback_style = 0
|
||
|
||
" -------------
|
||
" YouCompleteMe
|
||
" -------------
|
||
"let g:ycm_clangd_binary_path = exepath('clangd-13')
|
||
let g:ycm_clangd_uses_ycmd_caching = 0 " Let clangd fully control code completion
|
||
let g:ycm_clangd_args = ['--all-scopes-completion', '--header-insertion=iwyu', '--enable-config']
|
||
" use tt for YCM GoTo
|
||
nnoremap tt :YcmCompleter GoTo<CR>
|
||
|
||
" -----
|
||
" Gundo
|
||
" -----
|
||
let g:gundo_prefer_python3 = 1
|
||
|
||
if exists('g:debug')
|
||
if (g:debug > 0)
|
||
echo 'loaded vimrc'
|
||
endif
|
||
endif
|
||
|