Last active
March 22, 2020 00:21
-
-
Save jeancabral/db7ca02244edb6bca349cbaca0c925ed to your computer and use it in GitHub Desktop.
Vim for Javascript, React and TypeScript
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
"" Author: @jeancabral - https://twitter.com/jeancabral | |
"" init vim-plug | |
call plug#begin('~/.vim/plugged') | |
" | |
"" plugin section | |
" | |
" javascript support | |
Plug 'pangloss/vim-javascript' | |
" typescipt supoort | |
Plug 'leafgarland/typescript-vim' | |
" react supoort | |
Plug 'maxmellon/vim-jsx-pretty' | |
" AutoPairs - Insert or delete brackets, parens, quotes in pair. | |
Plug 'jiangmiao/auto-pairs' | |
" NERDTree | |
Plug 'preservim/nerdtree' | |
" Quickly find and open files using fuzzy searches | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
" vim-react-snippets - javascript and typescript snippets for developing react applications. | |
Plug 'SirVer/ultisnips' | |
Plug 'mlaursen/vim-react-snippets' | |
" deoplete plugin for autocompletion and uggestions. | |
if has('nvim') | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
else | |
Plug 'Shougo/deoplete.nvim' | |
Plug 'roxma/nvim-yarp' | |
Plug 'roxma/vim-hug-neovim-rpc' | |
endif | |
let g:deoplete#enable_at_startup = 1 | |
" vim-fugutive - manage Git commands with ease | |
Plug 'tpope/vim-fugitive' | |
" airline - supercharge your vim status bar | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
" vim-multiple-cursors - multi-cursor support for Vim | |
Plug 'terryma/vim-multiple-cursors' | |
" vim-surround - automatically wrap your text selections in brackets | |
Plug 'tpope/vim-surround' | |
" editor config | |
Plug 'editorconfig/editorconfig-vim' | |
" prettier code formatter | |
Plug 'prettier/vim-prettier', { 'do': 'yarn install', 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] } | |
let g:prettier#autoformat = 0 | |
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync | |
" | |
"" end vim-plug | |
call plug#end() | |
"" Customization | |
" | |
" | |
"" NERDTree Custom | |
" open a NERDTree automatically when vim starts up if no files were specified | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
" specific key or shortcut to open NERDTree | |
map <C-n> :NERDTreeToggle<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment