Skip to content

Instantly share code, notes, and snippets.

@dhilst
Created December 12, 2018 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhilst/43a1aa12737d279b2f416f0802e2c494 to your computer and use it in GitHub Desktop.
Save dhilst/43a1aa12737d279b2f416f0802e2c494 to your computer and use it in GitHub Desktop.
my vimrc
set modeline
set ls=2
set autoindent smartindent clipboard+=unnamed
set formatoptions-=t formatoptions+=croql
set nohls
set synmaxcol=200
set et
set backspace=indent,eol,start
set mouse+=a
set fo+=crot
set backupcopy=yes
set incsearch
filetype plugin on
filetype plugin indent on
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=/usr/local/opt/fzf
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'w0rp/ale'
"Plugin 'rking/ag.vim'
Plugin 'nvie/vim-flake8'
Plugin 'tpope/vim-surround'
Plugin 'jiangmiao/auto-pairs'
Plugin 'mattn/emmet-vim'
Plugin 'alvan/vim-closetag'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
Plugin 'scrooloose/nerdtree'
Plugin 'junegunn/fzf.vim'
Plugin 'christoomey/vim-tmux-navigator'
"Plugin 'haya14busa/incsearch.vim'
"Plugin 'python-mode/python-mode'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
filetype plugin on
filetype on
syntax on
" Leader mappings
let mapleader = ' '
noremap <leader>e :e %:p:h<CR>
noremap <leader>l :ALEToggle<CR>
noremap <leader>b :Buffers<CR>
noremap <leader>h :History<CR>
noremap <leader>p :Files!<CR>
noremap <leader>f :Ag<CR>
noremap <leader>n :noh<CR>
noremap <leader>v :e! ~/.vimrc<CR>
noremap <tab> gt
noremap <s-tab> gT
" close-tags
let g:closetag_filenames = '*.html,*.html.erb,*.jsx'
" Remember cursor position
if v:version >= 700
au BufLeave * let b:winview = winsaveview()
au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif
endif
" Show trailing white spaces
highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
au FileType eruby,ruby,javascript set ts=2 sts=2 sw=2 et
au FileType ruby noremap <expr> <leader>t ':!rspec ' . expand('%') . ':' . line('.')
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, {'options': '--delimiter : --nth 4..'}, <bang>0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment