Skip to content

Instantly share code, notes, and snippets.

@Baudin999
Created December 12, 2017 08:05
Show Gist options
  • Save Baudin999/bdfb876f0aa6e19c44b65d73354041d0 to your computer and use it in GitHub Desktop.
Save Baudin999/bdfb876f0aa6e19c44b65d73354041d0 to your computer and use it in GitHub Desktop.
My simple vimrc
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'valloric/youcompleteme'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'flazz/vim-colorschemes'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'scrooloose/syntastic'
Plug 'bling/vim-bufferline'
Plug 'tpope/vim-surround'
Plug 'elmcast/elm-vim'
Plug 'purescript-contrib/purescript-vim'
call plug#end()
" Airline configuration
let g:airline#extensions#tabline#enabled = 1
" Syntax highlighting
colo apprentice
syntax enable
let g:jsx_ext_required = 0
let g:javascript_plugin_jsdoc = 1
" Syntax Checking
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_eslint_exe='$(npm bin)/eslint'
let g:syntastic_javascript_checkers=['eslint']
" Spaces and tabs
set tabstop=4 " number of spaces a tab counts for
set softtabstop=4 " number of spaces a tab counts for when editing
set expandtab " tabs are spaces
set shiftwidth=4
set smarttab
" UI config
set number " show line numbers
set showcmd " show the last command entered
filetype plugin indent on " filetype detection and allows loading of language specific indentation
set wildmenu " vim autocompletes things like filenames
set lazyredraw
set showmatch
" searching
set incsearch " search as characters are entered
set hlsearch " highlight matches
" NERDTree keymappings
nnoremap <silent> <F2> :NERDTreeFind<CR>
noremap <F3> :NERDTreeToggle<CR>
map <F3> :NERDTreeToggle<CR>
map <F2> :NERDTreeFind<CR>
" CtrlP settings
let g:ctrlp_match_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git|elm-stuff\'
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" Set the mouse to allow scrolling
set mouse=a
set encoding=utf-8
set hidden
set wildchar=<Tab> wildmenu wildmode=full
set wrap!
nnoremap <s-right> :bn<CR>
nnoremap <s-left> :bp<CR>
nnoremap <F5> :buffers<CR>:buffer<Space>
" autoformat on save
augroup autoindent
au!
autocmd BufWritePre * :normal migg=G`i
augroup End
" Save sessions in vim
nnoremap <S-F8> :mksession! ~/.vim/vim_session <cr> " Quick write session with F2
nnoremap <F8> :source ~/.vim/vim_session <cr> " And load session with F3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment