Skip to content

Instantly share code, notes, and snippets.

@stphnrdmr
Last active June 2, 2018 01:48
Show Gist options
  • Save stphnrdmr/361d7a9b38849e66d05d82220d69de36 to your computer and use it in GitHub Desktop.
Save stphnrdmr/361d7a9b38849e66d05d82220d69de36 to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
set shell=zsh
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'mileszs/ack.vim'
Plugin 'Raimondi/delimitMate'
Plugin 'bling/vim-airline'
Plugin 'morhetz/gruvbox'
Plugin 'junegunn/vim-easy-align'
Plugin 'sheerun/vim-polyglot'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-dispatch'
Plugin 'w0rp/ale'
Plugin 'tpope/vim-sensible'
Plugin 'mattn/emmet-vim'
"Plugin 'tpope/vim-rails'
"Plugin 'tpope/vim-bundler'
"Plugin 'vim-ruby/vim-ruby'
"Plugin 'thoughtbot/vim-rspec'
"Plugin 'elixir-lang/vim-elixir'
"Plugin 'slashmili/alchemist.vim'
"Plugin 'guns/xterm-color-table.vim'
call vundle#end()
"Personal Settings.
syntax on
set statusline+=%#warningmsg#
set statusline+=%*
"Set Color Scheme and Font Options
colorscheme gruvbox
set background=dark
let g:gruvbox_italic=1
set guifont=Inconsolata\ For\ Powerline:h18
set wrap " don't wrap lines
set tabstop=2 " a tab is two spaces
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set relativenumber" show relative line
set shiftwidth=2 " number of spaces to use for autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch " set show matching parenthesis
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
" shiftwidth, not tabstop
set expandtab
set hlsearch " highlight search terms
set pastetoggle=<F2>
set undolevels=1000 " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title " change the terminal's title
set visualbell " don't beep
set noerrorbells " don't beep
set spell
set guioptions-=L
set nobackup
set noswapfile
set lazyredraw
set winwidth=84
"General mappings
let mapleader = ","
imap jj <Esc>
vmap <Enter> <Plug>(EasyAlign)
nnoremap <leader>c :nohl<CR>
" Window navigation
nnoremap <silent> + :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> - :exe "resize " . (winheight(0) * 2/3)<CR>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Folding, autofold with space
set foldcolumn=1
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
" Autocomplete
inoremap <C-Space> <C-x><C-o>
imap <C-@> <C-Space>
" Remove dangling whitespace
autocmd BufWritePre * :%s/\s\+$//e
" CTRL-P settings
let g:ctrlp_use_caching = 0
" Silver Searcher
if executable('ag')
let g:ackprg = 'ag --vimgrep --smart-case'
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
" airline
let g:airline_powerline_fonts = 1
imap <C-c> <CR><Esc>O
" Refactorings
" Extract variable
map <Leader>V Oconst <C-r>. = <C-r>"<Esc>j
" mark lines over 80 columns
highlight ColorColumn ctermbg=239
let &colorcolumn="81,".join(range(120,999),",")
au BufEnter /private/tmp/crontab.* setl backupcopy=yes
"ale
let g:ale_fixers = {
\ 'javascript': ['standard'],
\}
let g:ale_completion_enabled = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = '▶'
let g:ale_sign_warning = '▶'
let g:airline#extensions#ale#enabled = 1
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
"jsdoc highlighting
let g:javascript_plugin_jsdoc = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment