Skip to content

Instantly share code, notes, and snippets.

@dimanyc
Created December 28, 2018 15:50
Show Gist options
  • Save dimanyc/ddc12c6710bb25eb474e5e282f28ef05 to your computer and use it in GitHub Desktop.
Save dimanyc/ddc12c6710bb25eb474e5e282f28ef05 to your computer and use it in GitHub Desktop.
new vimrc
set nocompatible " be iMproved, required
filetype off " required
"--- Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
Plugin 'prettier/vim-prettier'
Plugin 'dyng/ctrlsf.vim'
Plugin 'lpenz/vimcommander'
Plugin 'VundleVim/Vundle.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-repeat'
Plugin 'thoughtbot/vim-rspec'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-dispatch'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ngmy/vim-rubocop'
" Plugin 'scrooloose/syntastic'
Plugin 'vim-ruby/vim-ruby'
Plugin 'fugalh/desert.vim.git'
Plugin 'pangloss/vim-javascript'
Plugin 'flazz/vim-colorschemes'
Plugin 'mxw/vim-jsx'
Plugin 'gavocanov/vim-js-indent'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'vim-airline/vim-airline'
Plugin 'jdkanani/vim-material-theme'
Plugin 'slim-template/vim-slim.git'
Plugin 'tpope/vim-fugitive'
Plugin 'mileszs/ack.vim'
Plugin 'AndrewRadev/multichange.vim'
Plugin 'burnettk/vim-angular'
Plugin 'othree/javascript-libraries-syntax.vim'
Plugin 'leafgarland/typescript-vim'
Plugin 'dkprice/vim-easygrep'
Plugin 'carakan/new-railscasts-theme'
Plugin 'danilo-augusto/vim-afterglow'
Plugin 'tomasr/molokai'
Plugin 'elixir-lang/vim-elixir'
Plugin 'slashmili/alchemist.vim'
Plugin 'akz92/vim-ionic2'
Plugin 'nathanaelkane/vim-indent-guides'
" ES2015 code snippets (Optional)
Plugin 'epilande/vim-es2015-snippets'
Plugin 'sbdchd/neoformat'
Plugin 'w0rp/ale'
" React code snippets
Plugin 'epilande/vim-react-snippets'
" Ultisnips
Plugin 'SirVer/ultisnips'
call vundle#end()
"--- END: Vundle
filetype plugin indent on " required
filetype indent on
set smartindent
set autoindent
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set clipboard=unnamed
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
let g:vimrubocop_config = '~/.rubocop.yml'
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
set number
set laststatus=2
set shiftwidth=2
set tabstop=2
set expandtab
syntax on
syntax enable
" Molokai
let g:molokai_original = 1
let g:rehash256 = 1
colorscheme molokai
" sets quotes color
hi Delimiter ctermfg=202
" sets colosing bracket hightlight color
hi MatchParen cterm=none ctermbg=green ctermfg=blue
autocmd BufWritePre * StripWhitespace
" let g:syntastic_html_tidy_ignore_errors = [ '<form> lacks "action" attribute']
autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
autocmd Filetype javascript setlocal ts=2 sts=2 sw=2
let g:javascript_enable_domhtmlcss = 1
let g:javascript_ignore_javaScriptdoc = 1
" let g:syntastic_scss_sass_quiet_messages = {
" \ "regex": 'File to import not found or unreadable', }
" let g:syntastic_eruby_ruby_quiet_messages =
\ {'regex': 'possibly useless use of a variable in void context'}
nmap <silent> gw "_yiw:s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/<CR><C-o>:noh<CR>
" Ignore node/modules
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|tmp\|coverage'
" JS libs
let g:used_javascript_libs = 'underscore,backbone,angular'
" Toggle case
function! TwiddleCase(str)
if a:str ==# toupper(a:str)
let result = tolower(a:str)
elseif a:str ==# tolower(a:str)
let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g')
else
let result = toupper(a:str)
endif
return result
endfunction
vnoremap ~ y:call setreg('', TwiddleCase(@"), getregtype(''))<CR>gv""Pgv
" Multimotion Mappings
let g:multichange_mapping = 'sm'
let g:multichange_motion_mapping = 'm'
" Norton Commander ~ OMG!!!
noremap <silent> <F11> :cal VimCommanderToggle()<CR>
hi IndentGuidesOdd ctermbg=black
hi IndentGuidesEven ctermbg=darkgrey
" hi IndentGuidesOdd ctermbg=white
" hi IndentGuidesEven ctermbg=lightgrey
let g:rspec_command = "!bundle exec rspec {spec} "
set backspace=2
set noswapfile
" silver searcher
let g:ackprg = 'ag --nogroup --nocolor --column'
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
set nocursorline " Don't paint cursor line
set nocursorcolumn " Don't paint cursor column
set lazyredraw " Wait to redraw
set scrolljump=8 " Scroll 8 lines at a time at bottom/top
let html_no_rendering=1 " Don't render italic, bold, links in HTML
set regexpengine=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment