" An example for a vimrc file. " " Maintainer: Bram Moolenaar " 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 = '' " gx does some weird things like downloading files by default if executable('xdg-open') nnoremap gx B"pyE:!xdg-open =escape("p","#") & elseif has('win32') nnoremap gx B"pyE:!start =escape("p","#") 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 let g:pandoc#syntax#codeblocks#embeds#langs = ["html", "js=javascript", "java"] silent! helptags ALL colorscheme atomified set omnifunc=ale#completion#OmniFunc " Start interactive EasyAlign in visual mode (e.g. vipga) xmap ga (EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip) nmap ga (EasyAlign) set shellslash set belloff=all set modeline set langmenu=en_US let $LANG = 'en_US' source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim set synmaxcol=60000 set scrolloff=12 set sidescroll=1 set sidescrolloff=20 set autoindent set smartindent set ruler set number set dir=$HOME/vimstuff/swap//,. set backupdir=$HOME/vimstuff/backup//,. set nobackup set undodir=$HOME/vimstuff/undo//,. set undofile set wildmode=longest,full 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 !redraw! command W w command DelThis call delete(expand('%')) | bdelete! " Filetypes au BufRead,BufNewFile *.z80 set filetype=z8a au BufRead,BufNewFile *.hs,*.yaml,*.yml set tabstop=2 smarttab expandtab shiftwidth=2 augroup pandoc_syntax au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc augroup END " Markdown table formatting fun FormatMarkdownDashes() s/\v([ -])@<= ([ -])@=/-/g endfun nnoremap ga- :call FormatMarkdownDashes() nmap ga\| gaip*\| nnoremap map >> map << map :TOhtml:wq:n map :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#") map :!build make map :!build run map :so $MYVIMRC "imap {} {}O imap <<`^a imap ยงยง 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