讓Vim 支持Javascript 語法高亮顯示

Installation

Download plug.vim
and put it in the "autoload" directory.
Ref: vim-plug

Vim

Unix
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Windows (PowerShell)
md ~\vimfiles\autoload
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile(
  $uri,
  $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
    "~\vimfiles\autoload\plug.vim"
  )
)

Usage

Add a vim-plug section to your ~/.vimrc (or ~/.config/nvim/init.vim for Neovim):

  1. Begin the section with call plug#begin()
  2. List the plugins with Plug commands
  3. call plug#end() to update &runtimepath and initialize plugin system
    • Automatically executes filetype plugin indent on and syntax enable.
      You can revert the settings after the call. e.g. filetype indent off, syntax off, etc.

Example

" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'

" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'

" Multiple Plug commands can be written in a single line using | separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'

" On-demand loading
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Using a non-master branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }

" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }

" Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }

" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }

" Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'

" Initialize plugin system
call plug#end()

Reload .vimrc and :PlugInstall to install plugins.

JavaScript

JavaScript bundle for vim, this bundle provides syntax highlighting and improved indentation.

  git clone https://github.com/pangloss/vim-javascript.git ~/.vim/bundle/vim-javascript
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 安裝依賴庫(支持Python 3、Lua、Ruby) sudo apt-get install libncurse...
    Cyfeng閱讀 2,299評論 0 2
  • 我清楚知道自己特別特別長的地方在哪里,并不是說其它地方有多短,而是興趣點(diǎn)不同,以及想做更有價(jià)值更有意義也更有趣的事情
    極潤閱讀 343評論 0 0
  • 動物作為群體,處在某個(gè)食物鏈中的一環(huán),有不可忽視的意義,但作為個(gè)體的一只大象、一只狐獴存在的意義是什么?紀(jì)錄...
    _青松閱讀 759評論 0 1

友情鏈接更多精彩內(nèi)容