├── .gitignore ├── README.md └── .vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | .vim 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vimkickstart 2 | This project was born from a point where me and my development team got really frustrated about the lack of fast Ruby IDE's. In the search towards a fast and advanced editor we found Vim (with the right configuration) capable of being fast like Sublime Text and provide us with the nice features an IDE provides like Code Completion and GIT support. 3 | This repo should provide you with a nice Kickstart-Vim-Configuration you can build on. 4 | 5 | ![Alt text](https://cloud.githubusercontent.com/assets/962263/25851310/95990e94-34c5-11e7-859c-9bf6d0983f0c.png "Screenshot") 6 | 7 | ---- 8 | ## Quick Start 9 | 1. Clone this repo in your home folder which will create **~/vimkickstart**. 10 | ```bash 11 | git clone git@github.com:danema/vimkickstart.git 12 | ``` 13 | 2. Install Vundle (VIM plugin manager) 14 | ```bash 15 | git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 16 | ``` 17 | 3. Create symbolic links to the repo 18 | ```bash 19 | if [ -f "$HOME/.vimrc" ]; then mv .vimrc .vimrc.bck && ln -s vimkickstart/.vimrc; else ln -s vimkickstart/.vimrc; fi; if [ -d "$HOME/.vim" ]; then mv .vim vimkickstart/ && ln -s vimkickstart/.vim; else ln -s vimkickstart/.vim; fi 20 | ``` 21 | 4. Install the latest version of Vim 22 | ```bash 23 | brew update && brew install vim --with-override-system-vi 24 | ``` 25 | 5. Install Vim Plugins 26 | ```bash 27 | vim +PluginInstall +qall 28 | ``` 29 | 6. Complete Solarized installation 30 | ```bash 31 | cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/ 32 | ``` 33 | 7. Install Silver Searcher 34 | ```bash 35 | brew install the_silver_searcher 36 | ``` 37 | 8. Install Cmake (Required for Code Completion) 38 | ```bash 39 | brew install cmake 40 | ``` 41 | 9. Compile YCM (Required for Code Completion) 42 | ```bash 43 | cd ~/.vim/bundle/YouCompleteMe 44 | ./install.py 45 | ``` 46 | 10. Install [eclim](http://eclim.org/install.html) to get Code Completion from Eclipse (optional) 47 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " ------------------------- 2 | " VIM template by @danema 3 | " ------------------------- 4 | 5 | " User interface 6 | set background=dark 7 | let g:solarized_termcolors=256 8 | let g:solarized_termtrans = 0 9 | set guifont=Menlo\ Regular:h20 10 | 11 | " Window navigation 12 | map [1;3A :wincmd k 13 | map [1;3B :wincmd j 14 | map [1;3D :wincmd h 15 | map [1;3C :wincmd l 16 | 17 | " NERDTree 18 | let g:NERDTreeMapOpenInTab='' 19 | let NERDTreeShowHidden=1 20 | map :NERDTreeTabsToggle 21 | autocmd BufWritePost * call NERDTreeFocus() | call g:NERDTree.ForCurrentTab().getRoot().refresh() | call g:NERDTree.ForCurrentTab().render() | wincmd w 22 | 23 | " Support Mouse-scroll & Better File navigation 24 | set mouse=nicr 25 | set nocompatible 26 | set whichwrap+=<,>,[,] 27 | set backspace=indent,eol,start 28 | 29 | " Syntax highlighting & indentation 30 | syntax enable 31 | filetype plugin indent on 32 | set expandtab 33 | set tabstop=2 shiftwidth=2 softtabstop=2 34 | set autoindent 35 | 36 | " Linenumbers 37 | set number 38 | set updatetime=250 39 | 40 | " Silver Searcher 41 | if executable('ag') 42 | " Use Ag over Grep 43 | set grepprg=ag\ --nogroup\ --nocolor 44 | 45 | " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore 46 | let g:ctrlp_user_command = 'ag -Q -l --nocolor --hidden -g "" %s' 47 | 48 | " ag is fast enough that CtrlP doesn't need to cache 49 | let g:ctrlp_use_caching = 0 50 | 51 | if !exists(":Ag") 52 | command -nargs=+ -complete=file -bar Ag silent! grep! |cwindow|redraw! 53 | nnoremap \ :Ag 54 | endif 55 | endif 56 | 57 | " Code completion 58 | let g:EclimCompletionMethod = 'omnifunc' 59 | "autocmd FileType ruby,eruby let g:EclimCompletionMethod = 'omnifunc' 60 | autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete 61 | autocmd FileType java setlocal omnifunc=javacomplete#Complete 62 | 63 | autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 64 | autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 65 | autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 66 | autocmd FileType ruby,eruby let g:rubycomplete_include_object = 1 67 | autocmd FileType ruby,eruby let g:rubycomplete_include_objectspace = 1 68 | let g:ycm_seed_identifiers_with_syntax = 1 69 | 70 | " Syntastic 71 | set statusline+=%#warningmsg# 72 | set statusline+=%{SyntasticStatuslineFlag()} 73 | set statusline+=%* 74 | 75 | let g:syntastic_always_populate_loc_list = 1 76 | let g:syntastic_auto_loc_list = 1 77 | let g:syntastic_check_on_open = 1 78 | let g:syntastic_check_on_wq = 1 79 | let g:syntastic_enable_balloons = 1 80 | 81 | autocmd BufWritePost * :SyntasticCheck 82 | 83 | " Solarized 84 | if (&t_Co == 256 || &t_Co == 88) && !has('gui_running') && 85 | \ filereadable(expand("$HOME/.vim/plugin/guicolorscheme.vim")) 86 | " Use the guicolorscheme plugin to makes 256-color or 88-color 87 | " terminal use GUI colors rather than cterm colors. 88 | runtime! plugin/guicolorscheme.vim 89 | GuiColorScheme solarized 90 | else 91 | " For 8-color 16-color terminals or for gvim, just use the 92 | " regular :colorscheme command. 93 | colorscheme solarized 94 | endif 95 | 96 | " On save auto-create the enclosing folder if it doesn't already exist 97 | augroup vimrc-auto-mkdir 98 | autocmd! 99 | autocmd BufWritePre * call s:auto_mkdir(expand(':p:h'), v:cmdbang) 100 | function! s:auto_mkdir(dir, force) 101 | if !isdirectory(a:dir) 102 | \ && (a:force 103 | \ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$') 104 | call mkdir(iconv(a:dir, &encoding, &termencoding), 'p') 105 | endif 106 | endfunction 107 | augroup END 108 | 109 | " Vundle 110 | set rtp+=~/.vim/bundle/Vundle.vim 111 | call vundle#begin() 112 | 113 | Plugin 'VundleVim/Vundle.vim' 114 | 115 | " Colorscheme 116 | Plugin 'altercation/vim-colors-solarized' 117 | Plugin 'guicolorscheme.vim' 118 | Plugin 'godlygeek/csapprox' 119 | 120 | " NERDTree 121 | Plugin 'Xuyuanp/nerdtree-git-plugin' 122 | Plugin 'scrooloose/nerdtree' 123 | Plugin 'jistr/vim-nerdtree-tabs' 124 | 125 | " Navigation 126 | Plugin 'wincent/command-t' 127 | Plugin 'ctrlp.vim' 128 | Plugin 'trotter/autojump.vim' 129 | 130 | " Programming support 131 | Plugin 'vim-ruby/vim-ruby' 132 | Plugin 'tpope/vim-rails' 133 | Plugin 'mattn/emmet-vim' 134 | Plugin 'rubycomplete.vim' 135 | Plugin 'artur-shaik/vim-javacomplete2' 136 | Plugin 'valloric/youcompleteme' 137 | Plugin 'ervandew/eclim' 138 | Plugin 'tpope/vim-fugitive' 139 | Plugin 'airblade/vim-gitgutter' 140 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 141 | Plugin 'scrooloose/syntastic' 142 | Plugin 'mmozuras/vim-whitespace' 143 | 144 | " In-Vim Shell 145 | Plugin 'Conque-Shell' 146 | Plugin 'shougo/vimshell.vim' 147 | Plugin 'shougo/vimproc.vim' 148 | 149 | " Script Library 150 | Plugin 'L9' 151 | Plugin 'Improved-AnsiEsc' 152 | 153 | call vundle#end() 154 | --------------------------------------------------------------------------------