Last active
February 9, 2021 01:47
-
-
Save TrevCan/4b2dc3e5c97e691258acaa265642042c to your computer and use it in GitHub Desktop.
@TrevCan's _vimrc config file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "ex vimrc stuff | |
| source $VIMRUNTIME/vimrc_example.vim | |
| " Vim-Plug Vim plugin manager | |
| call plug#begin('$HOME/Vim/vim-plug') | |
| " this path equals c:\users\{user}\Vim\vim-plug | |
| " Vim-Plug declare list of plugins | |
| Plug 'WolfgangMehner/c-support' | |
| Plug 'arthurealike/vim-J' | |
| call plug#end() | |
| "Joker like plugin theme | |
| " colorscheme joker | |
| " Vim with all enhancements | |
| " source $VIMRUNTIME/vimrc_example.vim | |
| " Use the internal diff if available. | |
| " Otherwise use the special 'diffexpr' for Windows. | |
| if &diffopt !~# 'internal' | |
| set diffexpr=MyDiff() | |
| endif | |
| function MyDiff() | |
| let opt = '-a --binary ' | |
| if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif | |
| if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif | |
| let arg1 = v:fname_in | |
| if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif | |
| let arg1 = substitute(arg1, '!', '\!', 'g') | |
| let arg2 = v:fname_new | |
| if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif | |
| let arg2 = substitute(arg2, '!', '\!', 'g') | |
| let arg3 = v:fname_out | |
| if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif | |
| let arg3 = substitute(arg3, '!', '\!', 'g') | |
| if $VIMRUNTIME =~ ' ' | |
| if &sh =~ '\<cmd' | |
| if empty(&shellxquote) | |
| let l:shxq_sav = '' | |
| set shellxquote& | |
| endif | |
| let cmd = '"' . $VIMRUNTIME . '\diff"' | |
| else | |
| let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' | |
| endif | |
| else | |
| let cmd = $VIMRUNTIME . '\diff' | |
| endif | |
| let cmd = substitute(cmd, '!', '\!', 'g') | |
| silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 | |
| if exists('l:shxq_sav') | |
| let &shellxquote=l:shxq_sav | |
| endif | |
| endfunction | |
| " set guifont=Fixedsys:h18:cANSI:qDRAFT | |
| set guifont=Jetbrains_Mono:h18:cANSI:qDRAFT | |
| " tab = 4 spaces | |
| set tabstop=4 | |
| :set ts=4 | |
| :set shiftwidth=4 | |
| " show line numbers | |
| set number | |
| autocmd filetype cpp nnoremap <F8> :w <bar> !g++ %:r.cpp && a.exe <CR> | |
| set belloff=all | |
| " copy and paste | |
| vmap <C-c> "+yi | |
| vmap <C-x> "+c | |
| vmap <C-v> c<ESC>"+p | |
| imap <C-v> <ESC>"+pa | |
| filetype plugin on | |
| " fixing utf-8 characters | |
| scriptencoding utf-8 | |
| set encoding=utf-8 | |
| set fileencoding=utf-8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment