# Install ESLint and Babel ESLint
# Make sure to install at least v5.1.0 of ESLint
npm install --save-dev eslint babel-eslint
# Install the Airbnb configs (3 of them, listed below)
npx install-peerdeps --dev eslint-config-airbnb
# Install Prettier + ESLint config
npm install --save-dev --save-exact prettier eslint-config-prettier
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Font | |
:set guifont=Source\ Code\ Pro:h14 | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason? | |
:set laststatus=0 | |
:set noshowmode "don't show --INSERT-- | |
:set noruler "don't show line numbers/column/% junk |
syntax on | |
set ruler " Show the line and column numbers of the cursor. | |
set formatoptions+=o " Continue comment marker in new lines. | |
set textwidth=0 " Hard-wrap long lines as you type them. | |
set modeline " Enable modeline. | |
set esckeys " Cursor keys in insert mode. | |
set linespace=0 " Set line-spacing to minimum. | |
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) | |
" More natural splits | |
set splitbelow " Horizontal split below current. |
This is my typical decorator stack for a 'smart component' used as the component for react-router
route.
Note some code is missing here but this should give you the idea.
Example usage:
StateDetailsScene.js
import React from 'react'
import _ from 'lodash'
import route from 'core/decorators/route'
So, I just learned that gf
exists. If your cursor is over a path in vim, and you type gf, it'll open that file/dir in a new buffer. You can also open in a new window/tab as detailed here.
In node, it'd be great if you could jump to a required
file, huh? Trouble is, typically you don't put the .js
on your require('./path/to/a/js/file')
. No matter, vim has your back, just add set suffixesadd+=.js
to your .vimrc and vim will try adding .js and see if it can find that file instead.
If you do a lot of spelunking in node_modules, it'd be great if you could jump to the directory of a required npm module too, right? A la, require('my-awesome-module')
. Well, you can add set path+=$PWD/node_modules
to your .vimrc too, and vim will add node_modules to the path, and jump to it's directory in node_modules (caveat: you must have opened vim from your project root for this too work).
For your cmd+c convenience:
# show number all tabs | |
:tabdo windo set number | |
# copy to clipboard fix | |
sudo apt-get install vim-gtk | |
# editorconfig | |
https://github.com/editorconfig/editorconfig-vim | |
# autocomplete |