Last active
March 7, 2018 14:30
-
-
Save utilum/9e3eace183f4f610654a6a2c9f40d4e6 to your computer and use it in GitHub Desktop.
.vimrc
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
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim/ | |
| call vundle#begin() | |
| Plugin 'VundleVim/Vundle.vim' | |
| Plugin 'vim-ruby/vim-ruby' | |
| Plugin 'mattn/emmet-vim' | |
| Plugin 'fatih/vim-go' | |
| Plugin 'Shougo/neocomplete' | |
| Plugin 'scrooloose/nerdtree' | |
| call vundle#end() | |
| filetype plugin indent on | |
| set laststatus=2 | |
| set statusline+=%f | |
| set statusline+=%= " Switch to the right side | |
| set statusline+=%l " Current line | |
| set statusline+=/ " Separator | |
| set statusline+=%L " Total lines | |
| set expandtab | |
| set tabstop=2 | |
| set shiftwidth=2 | |
| set autoindent | |
| set smartindent | |
| set hlsearch | |
| let g:neocomplete#enable_at_startup = 1 | |
| if has("autocmd") | |
| " Drupal *.module and *.install files. | |
| augroup module | |
| " autocmd BufRead,BufNewFile *.module set filetype=php | |
| " autocmd BufRead,BufNewFile *.install set filetype=php | |
| " autocmd BufRead,BufNewFile *.inc set filetype=php | |
| " autocmd BufRead,BufNewFile *.test set filetype=php | |
| augroup END | |
| au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | |
| \| exe "normal! g'\"" | endif | |
| endif | |
| cabbr pc !php -l % | |
| syntax on | |
| imap <C-e> <C-y>, | |
| nmap <Space> :noh<return> | |
| autocmd FileType ruby map <F9> :w<CR>:!ruby -c %<CR> | |
| autocmd FileType ruby map <F5> :w<CR>:!ruby %<CR> | |
| " Shougo/neocomplete config | |
| let g:acp_enableAtStartup = 0 | |
| " Use neocomplete. | |
| let g:neocomplete#enable_at_startup = 1 | |
| " Use smartcase. | |
| let g:neocomplete#enable_smart_case = 1 | |
| " Set minimum syntax keyword length. | |
| let g:neocomplete#sources#syntax#min_keyword_length = 3 | |
| let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' | |
| let g:syntastic_go_checkers = ['go', 'golint', 'govet'] | |
| let g:syntastic_aggregate_errors = 1 | |
| " Define dictionary. | |
| let g:neocomplete#sources#dictionary#dictionaries = { | |
| \ 'default' : '', | |
| \ 'vimshell' : $HOME.'/.vimshell_hist', | |
| \ 'scheme' : $HOME.'/.gosh_completions' | |
| \ } | |
| " Define keyword. | |
| if !exists('g:neocomplete#keyword_patterns') | |
| let g:neocomplete#keyword_patterns = {} | |
| endif | |
| let g:neocomplete#keyword_patterns['default'] = '\h\w*' | |
| " Plugin key-mappings. | |
| inoremap <expr><C-g> neocomplete#undo_completion() | |
| inoremap <expr><C-l> neocomplete#complete_common_string() | |
| " Recommended key-mappings. | |
| " <CR>: close popup and save indent. | |
| inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR> | |
| function! s:my_cr_function() | |
| return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>" | |
| " For no inserting <CR> key. | |
| "return pumvisible() ? "\<C-y>" : "\<CR>" | |
| endfunction | |
| " <TAB>: completion. | |
| inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" | |
| runtime! macros/matchit.vim | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment