This is my JS-focused VIM config which I am currently running on MacOS. It should work on Linux without any changes, and on Windows you should only need to modify the swap dir and plugin paths.
- Vim (obviously)
- Vim Plug
- Powerline Fonts
- Mystical Tutor Color Scheme
- A decent terminal emulator with support for Powerline fonts and their symbols
You can install them all (on UNIX) like so:
# Powerline Fonts
cd ~
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
sudo ./install.sh
cd ..
rm -rf fonts
# Create directories
mkdir -p .vim/autoload .vim/plugged .vim/colors .vim/tmp
# Vim-Plug
curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Mystical Tutor
curl -fLo ~/.vim/colors/mysticaltutor.vim https://raw.githubusercontent.com/caksoylar/vim-mysticaltutor/master/colors/mysticaltutor.vim
- Replace the default vimrc with this one. On UNIX it's pretty typically found in ~/.vimrc, or in %AppData% on Windows.
- Go through the file and change any hotkeys or directory paths that you don't like
- Open the file in vim and type
:PlugInstall
then restart vim.
Just a short list of hotkeys and features offered by this config:
F2
opens (or closes) a file tree and lets you browse the directory for other files to edit. New files open in tabs.- Browse tabs with
F3
(Previous Tab) andF4
(Next Tab) - Open a
git blame
split pane withF5
, and presso
to open the commit diff responsible for that line. - Fixes lots of common exit typos, such as :Wq or :wQ, effectively making it case-insensitive
- Better defaults, like visible line numbers, highlight matching braces, scroll offset so you can always see above or below the current cursor line, etc.
- Auto indent using 2 spaces with support for certain HTML tags
- Airline status bar with a wide variety of information about the file you're currently working on.
- Comfortable dark theme colors
- Dedicated directory for swap files
- Better split behavior (open right and down, move with ctrl+HJKL single chords)
- Set unix line endings by default
- Support UTF-8
- Syntax Highlighting and Linting with support for JSX
- CSS Color Highlighter
- Realtime Syntax Checking
- Auto Formatting
- Auto close HTML tags
etc.