Files
myvimrc/_vimrc

174 lines
4.3 KiB
VimL

" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2016 Jul 28
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Get the defaults that most users want.
source $VIMRUNTIME/defaults.vim
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file (restore to previous version)
if has('persistent_undo')
set undofile " keep an undo file (undo changes after closing)
endif
endif
if &t_Co > 2 || has("gui_running")
" Switch on highlighting the last used search pattern.
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
if has('syntax') && has('eval')
packadd matchit
endif
set rtp+=$HOME/vimfiles
let g:netrw_xg = '<cWORD>'
" gx does some weird things like downloading files by default
if executable('xdg-open')
nnoremap gx BvE"py:!xdg-open <C-R>p &<CR>
endif
let g:ale_completion_autoimport = 1
let g:ale_linters = {'rust': ['analyzer'], 'v': ['v', 'vfmt']}
let g:ale_linter_aliases = {
\ 'vlang': 'v',
\}
"let g:ale_rust_analyzer_config = { 'cargo': { 'allFeatures': v:true } }
" execute pathogen#infect()
packloadall
let g:load_doxygen_syntax=1
" Okular as vimtex' pdf viewer
let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
let g:vimtex_view_general_options_latexmk = '--unique'
let g:vimtex_compiler_method = 'arara'
let g:vimtex_compiler_arara = {
\ 'options' : ['-v'],
\}
if $LANGUAGE_TOOL != ""
let g:languagetool_jar = '$LANGUAGE_TOOL/languagetool-commandline.jar'
endif
if executable('pdftotext')
let g:pdf_convert_on_edit=1
let g:pdf_convert_on_read=1
endif
silent! helptags ALL
colorscheme atomified
set omnifunc=ale#completion#OmniFunc
set modeline
set langmenu=en_US
let $LANG = 'en_US'
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set noundofile
set ru
set nu
set dir=$HOME/vimstuff/swap//,.
set backupdir=$HOME/vimstuff/backup//,.
set nobackup
set undodir=$HOME/vimstuff/undo//,.
set undofile
set encoding=utf-8
set tabstop=4
set shiftwidth=4
set softtabstop=0 noexpandtab
noh
set shortmess=filnxtToO
"set statusline+=%b\ 0x%B
"set laststatus=2
set spelllang=en_us,de_de
set spellfile=$HOME/vimfiles/spell/en.utf8.add,$HOME/vimfiles/spell/de.utf8.add
command -nargs=1 C silent !<args><NL>redraw!
command W w
command DelThis call delete(expand('%')) | bdelete!
" Filetypes
au BufRead,BufNewFile *.z80 set filetype=z8a
au BufRead,BufNewFile *.hs set tabstop=2 smarttab expandtab shiftwidth=2
nnoremap <buffer> <CR> <C-]>
map <Tab> >>
map <S-Tab> <<
map <F2> :TOhtml<enter>:wq<enter>:n<enter><F2>
map <F3> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#")<CR>
map <F5> :!build make<Return><Return>
map <F6> :!build run<Return><Return>
map <S-F5> :so $MYVIMRC<Return>
"imap {}<Return> {<cr>}<Esc>O
imap §§ <Esc>
for gcommand in ['Git', 'Gcd', 'Glcd', 'Gstatus', 'Gcommit', 'Gmerge', 'Gpull',
\ 'Grebase', 'Gpush', 'Gfetch', 'Grename', 'Gdelete', 'Gremove', 'Gblame', 'Gbrowse',
\ 'Ggrep', 'Glgrep', 'Glog', 'Gllog', 'Gedit', 'Gsplit', 'Gvsplit', 'Gtabedit', 'Gpedit',
\ 'Gread', 'Gwrite', 'Gwq', 'Gdiff', 'Gsdiff', 'Gvdiff', 'Gmove']
exe 'cnoreabbrev g'.gcommand[1:].' '.gcommand
endfor
set termguicolors
set guifont=Consolas:h10
set guioptions-=T
set guioptions-=m
set guioptions-=r
set guioptions-=R
set guioptions-=L
set guioptions-=l
set guioptions-=b
" vim: set tabstop=2 expandtab shiftwidth=2