" ~/.vimrc " To ignore plugin indent changes, instead use: "filetype plugin on set encoding=utf-8 fileencodings= syntax on set number set cc=80 autocmd Filetype make setlocal noexpandtab set list listchars=tab:»·,trail:· " per .git vim configs " just `git config vim.settings "expandtab sw=4 sts=4"` in a git repository " change syntax settings for this repository let git_settings = system("git config --get vim.settings") if strlen(git_settings) exe "set" git_settings endif set nocompatible filetype off call plug#begin() set clipboard=unnamedplus """"""""""""""""""""""" "" Add new plugins here """"""""""""""""""""""" Plug 'scrooloose/nerdtree' Plug 'tomasiser/vim-code-dark' Plug 'vim-airline/vim-airline' Plug 'tomasr/molokai' Plug 'joshdick/onedark.vim' """Plugin 'justmao945/vim-clang' """Plugin 'OmniCppComplete' Plug 'neoclide/coc.nvim', {'branch': 'release'} """"""""""""""""""""""" "" End of plugin list """"""""""""""""""""""" call plug#end() filetype plugin indent on colorscheme onedark let g:airline_theme='onedark' " let g:airline_theme = 'codedark' " let g:molokai_original = 1 " let g:rehash256 = 1 """"""""""""""""""""""" "" Map functions """"""""""""""""""""""" map :NERDTreeToggle syntax on autocmd VimEnter *.{cs,} NERDTree | wincmd p autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif set expandtab set shiftwidth=4 set softtabstop=4 set smartindent set autoindent set incsearch set mouse=a set cursorline set tags+=~/.vim/tags/cpp set tags+=~/.vim/tags/gl set tags+=~/.vim/tags/sdl set tags+=~/.vim/tags/qt4 " Install DoxygenToolkit from http://www.vim.org/scripts/script.php?script_id=987 let g:DoxygenToolkit_authorName="John Doe " let g:omni_sql_no_default_maps = 1 " Enhanced keyboard mappings " " in normal mode F2 will save the file nmap :w " in insert mode F2 will exit insert, save, enters insert again imap pumvisible() ? ':wa' : ':wa' " switch between header/source with F4 map :e %:p:s,.h$,.X123X,:s,.c$,.h,:s,.X123X$,.c, " recreate tags file with F5 map :!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q . " create doxygen comment map :Dox " build using makeprg with map :make " build using makeprg with map :make clean all " goto definition with F12 map autocmd Filetype {cs,py,c,cpp,h} call SetCSharpAutocompletion() function SetCSharpAutocompletion() inoremap { {} inoremap { {}O inoremap {{ { inoremap {} {} inoremap ( () inoremap ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\" : ")" inoremap strpart(getline('.'), col('.')-2, 2) == "()" ? "\" : strpart(getline('.'), col('.')-2, 2) == "''" ? "\" : strpart(getline('.'), col('.')-2, 2) == "\"\"" ? "\" : "\" inoremap [ [] inoremap ] strpart(getline('.'), col('.')-1, 1) == "]" ? "\" : "]" inoremap ' strpart(getline('.'), col('.')-1, 1) == "\'" ? "\" : "\'\'\" inoremap " strpart(getline('.'), col('.')-1, 1) == "\"" ? "\" : "\"\"\" " inoremap strpart(getline('.'), col('.')-2, 2) == "''" ? "\" : "\" " inoremap ; strpart(getline('.'), col('.')-1, 1) == ")" ? "\;" : ";" inoremap for for () inoremap if if () inoremap if if () endfunction """ OmniSharp shortcuts inoremap pumvisible() ? '' : \ getline('.')[col('.')-2] =~# '[[:alnum:].-_#$]' ? '' : '' inoremap pumvisible() ? (complete_info().selected == -1 ? '' : '') : ''