set nocompatible " be iMproved filetype off " required! set rtp+=~/.vim/bundle/vundle/ set rtp+=~/.vim/vim-conf/ call vundle#begin() " let Vundle manage Vundle " required! Plugin 'gmarik/vundle' " My Plugins here: " " original repos on github Plugin 'ctrlp.vim' Plugin 'ack.vim' Plugin 'Tagbar' Plugin 'The-NERD-tree' Plugin 'fugitive.vim' Plugin 'inkpot' Plugin 'colorv.vim' Plugin 'greplace.vim' Plugin 'git://github.com/godlygeek/csapprox.git' " Track the engine. Plugin 'SirVer/ultisnips' " Snippets are separated from the engine. Add this if you want them: Plugin 'honza/vim-snippets' Plugin 'SuperTab--Van-Dewoestine' Plugin 'unimpaired.vim' Plugin 'Gundo' "Plugin 'git://github.com/nosami/Omnisharp.git' Plugin 'git://github.com/tpope/vim-dispatch.git' Plugin 'Syntastic' Plugin 'git://github.com/Valloric/YouCompleteMe.git' "Plugin 'Keithbsmiley/swift.vim' Plugin 'git://github.com/Townk/vim-autoclose.git' "Plugin 'git://github.com/vim-scripts/closetag.vim.git' Plugin 'alvan/vim-closetag' Plugin 'janko-m/vim-test' Plugin 'git://github.com/burnettk/vim-angular.git' Plugin 'git://github.com/edsono/vim-matchit.git' " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required! " " Brief help " :PluginList - list configured bundles " :PluginInstall(!) - install(update) bundles " :PluginSearch(!) foo - search(or refresh cache first) for foo " :PluginClean(!) - confirm(or auto-approve) removal of unused bundles " " see :h vundle for more details or wiki for FAQ " NOTE: comments after Plugin command are not allowed.. " Basic vim configurations: if filereadable(expand("~/.vim/bundle/inkpot/colors/inkpot.vim")) colorscheme inkpot endif syntax on set hlsearch " highlight search pattern text set noswapfile " No swap files set formatoptions=l set linebreak " type help linebreak for info set t_Co=256 "tabstop number of spaces a in the text stands for (local to buffer) :set ts=4 "shiftwidth number of spaces used for each step of (auto)indent (local to buffer) :set sw=4 "smarttab a in an indent inserts 'shiftwidth' spaces :set sta "softtabstop if non-zero, number of spaces to insert for a (local to buffer) :set sts=4 "expandtab expand to spaces in Insert mode (local to buffer) :set et "autoindent automatically set the indent of a new line (local to buffer) :set ai "cindent enable specific indenting for C code (local to buffer) :set cin "wrap long lines wrap :set wrap "smartindent do clever autoindenting (local to buffer) :set si "cinkeys keys that trigger C-indenting in Insert mode (local to buffer) :set cink=0{,0},0),!^F,o,O,e "textwidth line length above which to break a line (local to buffer) :set tw=0 " single character insert :nnoremap i_r " / Basic vim configurations "folding settings set foldmethod=syntax "fold based on indent set foldnestmax=10 "deepest fold is 10 levels set nofoldenable "dont fold by default set foldlevel=50 "this is just what i use " tab navigation like firefox nmap :tabprevious nmap :tabnext map :tabprevious map :tabnext imap :tabpreviousi imap :tabnexti nmap :tabnew imap :tabnew " faster window navigation nnoremap h nnoremap j nnoremap k nnoremap l "set completeopt=menu,longest set completeopt=longest,menuone,preview " supertab: "let g:SuperTabDefaultCompletionType='' let g:SuperTabDefaultCompletionType='context' "let g:SuperTabContextDefaultCompletionType='' let g:SuperTabContextDefaultCompletionType = "" "let g:SuperTabLongestHighlight = 1 let g:SuperTabDefaultCompletionTypeDiscovery = ["&omnifunc:","&completefunc:"] let g:SuperTabClosePreviewOnPopupClose = 1 " If you prefer the Omni-Completion tip window to close when a selection is " made, these lines close it on movement in insert mode or when leaving " insert mode autocmd CursorMovedI * if pumvisible() == 0|pclose|endif autocmd InsertLeave * if pumvisible() == 0|pclose|endif " map the -key to , for terminal vim and gvim let mapleader="รถ" nnoremap j :TagbarToggle nnoremap o :NERDTreeToggle nnoremap O :NERDTreeFind nnoremap g :GundoToggle nnoremap , :tabedit $MYVIMRC " vim-test let test#python#runner = 'pytest' "let test#strategy = "terminal" nmap t :TestNearest nmap T :TestFile nmap a :TestSuite nmap l :TestLast " ignore Unity's .meta files let NERDTreeIgnore=['\.meta$', '\~$'] " Ultisnips let g:UltiSnipsExpandTrigger="" "OmniSharp settings: "let g:Omnisharp_start_server = 1 "This is the default value, setting it isn't actually necessary "let g:OmniSharp_host = "http://localhost:2001" "Timeout in seconds to wait for a response from the server "let g:OmniSharp_timeout = 1 "Showmatch significantly slows down omnicomplete "when the first match contains parentheses. set noshowmatch "Set autocomplete function to OmniSharp (if not using YouCompleteMe completion plugin) autocmd FileType cs setlocal omnifunc=OmniSharp#Complete " Fetch full documentation during omnicomplete requests. " There is a performance penalty with this (especially on Mono) " By default, only Type/Method signatures are fetched. Full documentation can still be fetched when " you need it with the :OmniSharpDocumentation command. " let g:omnicomplete_fetch_documentation=1 "Move the preview window (code documentation) to the bottom of the screen, so it doesn't move the code! "You might also want to look at the echodoc plugin set splitbelow " Synchronous build (blocks Vim) "autocmd FileType cs nnoremap :wa!:OmniSharpBuild " Builds can also run asynchronously with vim-dispatch installed autocmd FileType cs nnoremap :wa!:OmniSharpBuildAsync " Get Code Issues and syntax errors let g:syntastic_cs_checkers = ['syntax', 'issues'] autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck "show type information automatically when the cursor stops moving autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() " this setting controls how long to pause (in ms) before fetching type / symbol information. set updatetime=500 " Remove 'Press Enter to continue' message when type information is longer than one line. set cmdheight=2 " Contextual code actions (requires CtrlP) "nnoremap a :OmniSharpGetCodeActions " Run code actions with text selected in visual mode to extract method "vnoremap a :call OmniSharp#GetCodeActions('visual') "The following commands are contextual, based on the current cursor position. autocmd FileType cs nnoremap gd :OmniSharpGotoDefinition nnoremap fi :OmniSharpFindImplementations nnoremap ft :OmniSharpFindType nnoremap fs :OmniSharpFindSymbol nnoremap fu :OmniSharpFindUsages nnoremap fm :OmniSharpFindMembersInBuffer " cursor can be anywhere on the line containing an issue for this one nnoremap x :OmniSharpFixIssue nnoremap fx :OmniSharpFixUsings nnoremap tt :OmniSharpTypeLookup nnoremap dc :OmniSharpDocumentation " rename with dialog nnoremap nm :OmniSharpRename nnoremap :OmniSharpRename " rename without dialog - with cursor on the symbol to rename... ':Rename newname' command! -nargs=1 Rename :call OmniSharp#RenameTo("") " Force OmniSharp to reload the solution. Useful when switching branches etc. nnoremap rl :OmniSharpReloadSolution nnoremap cf :OmniSharpCodeFormat " Load the current .cs file to the nearest project nnoremap tp :OmniSharpAddToProject " Automatically add new cs files to the nearest project on save autocmd BufWritePost *.cs call OmniSharp#AddToProject() " (Experimental - uses vim-dispatch or vimproc plugin) - Start the omnisharp server for the current solution nnoremap ss :OmniSharpStartServer nnoremap sp :OmniSharpStopServer " Add syntax highlighting for types and interfaces nnoremap ht :OmniSharpHighlightTypes "Don't ask to save when changing buffers (i.e. when jumping to a type definition) set hidden " /OmniSharp settings let g:ackprg='ack -H --nocolor --nogroup --column --nobinary' " ctrlp configurations "let g:ctrpl_map = 'e' nnoremap e :CtrlP let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn|redo)$', \ 'file': '\v\.(exe|so|dll)$', \ } set wildignore+=*/build/bin/*,*/build/build/* " GUI specific configurations: if has("gui") set guifont=Monaco:h13 set guioptions=egmt endif " Source the vimrc file after saving it "if has("autocmd") " autocmd bufwritepost .vimrc source $MYVIMRC "endif let g:tagbar_sort = 0 " Show syntax highlighting groups for word under cursor nmap c :call SynStack() function! SynStack() if !exists("*synstack") return endif echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') endfunc set wildmode=list:longest,full " YouCompleteMe "let g:ycm_server_log_level = 'debug' let g:ycm_key_list_select_completion=['', ''] let g:ycm_key_list_previous_completion=['', ''] " UltiSnips let g:UltiSnipsSnippetsDir = '~/.vim/vim-conf/UltiSnips' " Make UltiSnips and YCM play nice together let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" "set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P "set statusline=%F%m%r%h%w\ "set statusline+=%{fugitive#statusline()}\ "set statusline+=[%{strlen(&fenc)?&fenc:&enc}] "set statusline+=\ [line\ %l\/%L] set statusline= set statusline +=%1*\ %n\ %* "buffer number set statusline +=%5*%{&ff}%* "file format set statusline +=%3*%y%* "file type set statusline +=%4*\ %<%F%* "full path set statusline +=%2*%m%* "modified flag set statusline +=%=%{fugitive#statusline()} set statusline +=%1*%5l%* "current line set statusline +=%2*/%L%* "total lines set statusline +=%1*%4v\ %* "virtual column number set statusline+=%0*\ \ %m%r%w\ %P\ \ "set statusline +=%2*0x%04B\ %* "character under cursor" set laststatus=2 let g:syntastic_html_tidy_ignore_errors=["