Master Vim for Front‑End Development: Essential Commands & Plugins
This comprehensive guide walks front‑end developers through installing Vim, mastering core editing commands, configuring a .vimrc file, and integrating a curated set of plugins for navigation, code completion, syntax highlighting, linting, Git, markdown preview, Emmet, and automatic formatting.
Vim is a powerful, long‑standing text editor. This guide collects essential Vim commands and configuration tips for front‑end developers, and recommends a set of plugins to enhance productivity.
Installation
sudo apt-get install vim # UbuntuOther platforms can be installed via their package managers.
Beginner Guide
vimtutor # start the built‑in tutorialCursor movement
# hjkl # move left/down/up/right
# 2w # move forward two words
# 3e # move to end of third word
# 0 # go to line start
# $ # go to line end
# gg # first line
# G # last line
# 42G # go to line 42
# <ctrl>+o # jump back
# <ctrl>+i # jump forwardExit
# <esc> # enter normal mode
# :q! # quit without saving
# :wq # write and quitDelete
# x # delete character
# dw # delete to end of word
# de # delete to end of word including char
# d$ # delete to line end
# dd # delete whole line
# 2dd # delete two linesModify
# i # insert before cursor
# A # append at line end
# r # replace character
# o # open new line belowUndo / Redo
# u # undo
# <ctrl>+r # redoCopy, paste, cut
# v # visual mode
# y # yank (copy)
# p # paste
# yy # yank current line
# dd # cut current lineStatus
# <ctrl>+g # show file infoSearch
# /pattern # forward search
# ?pattern # backward search
# n / N # repeat search
# % # find matching brace
# :set ic # ignore case
# :set noic # case‑sensitive
# :set hls # highlight matches
# :set is # show partial matchesReplace
# :s/old/new # replace first match in line
# :s/old/new/g # replace all matches in line
# :%s/old/new/g # replace in whole fileFolding
# zc # close fold
# zC # close all nested folds
# zo # open fold
# zO # open all nested foldsExternal commands
# :!cmd # run shell command.vimrc configuration
The .vimrc file stores user settings. Example snippets:
set nobackup
set noswapfile
set encoding=utf-8
set number
set nowrap
set ruler
set cursorline
set background=dark
colorscheme solarized
set cindent
set tabstop=2
set shiftwidth=2
set showmode
set nofoldenablePlugin configuration (vim‑plug)
Use vim-plug to manage plugins. Example Plug statements:
File explorer
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'Xuyuanp/nerdtree-git-plugin'Code completion and snippets
Plug 'Valloric/YouCompleteMe'
Plug 'Raimondi/delimitMate'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }Syntax highlighting and linting
Plug 'sheerun/vim-polyglot'
Plug 'w0rp/ale'Search tools
Plug 'rking/ag.vim'
Plug 'kien/ctrlp.vim'Status line
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'Commenting
Plug 'scrooloose/nerdcommenter'Git integration
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'Markdown preview
Plug 'suan/vim-instant-markdown'Emmet
Plug 'mattn/emmet-vim'HTML5 and CSS3 support
Plug 'othree/html5.vim'
Plug 'hail2u/vim-css3-syntax'
Plug 'ap/vim-css-color'JavaScript enhancements
Plug 'pangloss/vim-javascript'
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
let g:javascript_plugin_flow = 1
set foldmethod=syntax
let g:javascript_conceal_function = "ƒ"
let g:javascript_conceal_null = "ø"
let g:javascript_conceal_this = "@"
let g:javascript_conceal_return = "⇚"
let g:javascript_conceal_undefined = "¿"
let g:javascript_conceal_NaN = "ℕ"
let g:javascript_conceal_prototype = "¶"
let g:javascript_conceal_static = "•"
let g:javascript_conceal_super = "Ω"
let g:javascript_conceal_arrow_function = "⇒"
set conceallevel=1React support
Plug 'mxw/vim-jsx'
let g:jsx_ext_required = 0Prettier integration
Plug 'prettier/vim-prettier', { 'do': 'yarn install', 'for': ['javascript','typescript','css','less','scss','json','graphql'] }
let g:prettier#config#bracket_spacing = 'true'
let g:prettier#config#jsx_bracket_same_line = 'false'
let g:prettier#autoformat = 0
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql PrettierAsyncSummary
The article provides a comprehensive Vim setup for front‑end developers, covering installation, essential editing commands, a curated .vimrc configuration, and a collection of plugins for file navigation, code completion, syntax highlighting, linting, Git, markdown preview, Emmet, and formatting.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
