All Projects → NikolayFrantsev → Jshint2.vim

NikolayFrantsev / Jshint2.vim

Lightweight, customizable and functional Vim plugin for JSHint integration.

Projects that are alternatives of or similar to Jshint2.vim

Incsearch Easymotion.vim
Stars: ✭ 82 (-69.06%)
Mutual labels:  viml, vim-plugin
Vim Todo Lists
Vim plugin for TODO lists
Stars: ✭ 126 (-52.45%)
Mutual labels:  viml, vim-plugin
Learn Vim
无废话极简版Vim学习笔记!文章按主题分拆为多个章节,并尽量控制每节的信息量;通过文字色彩和字体,将命令、快捷键突出显示;在每节结尾,提供一个命令列表,以便回顾文中介绍的重要命令。如果这些文章能对喜欢Vim的朋友有所益处,我将不胜荣幸。
Stars: ✭ 83 (-68.68%)
Mutual labels:  viml, vim-plugin
Vim Lookup
Jump to the definition of variables or functions in VimL code.
Stars: ✭ 51 (-80.75%)
Mutual labels:  viml, vim-plugin
Vim Glsl
Vim runtime files for OpenGL Shading Language
Stars: ✭ 184 (-30.57%)
Mutual labels:  viml, vim-plugin
Viki vim
A personal wiki for Vim
Stars: ✭ 52 (-80.38%)
Mutual labels:  viml, vim-plugin
Vim Youdao Translater
vim的有道取词翻译插件
Stars: ✭ 116 (-56.23%)
Mutual labels:  viml, vim-plugin
Vim Diff Toggle
🛠 Vim plugin to speed up editing diff files
Stars: ✭ 17 (-93.58%)
Mutual labels:  viml, vim-plugin
Vim Markbar
Display all accessible marks and their surrounding lines in a collapsible sidebar.
Stars: ✭ 159 (-40%)
Mutual labels:  viml, vim-plugin
Tlib vim
Some utility functions for VIM
Stars: ✭ 147 (-44.53%)
Mutual labels:  viml, vim-plugin
Vim Grepper
👾 Helps you win at grep.
Stars: ✭ 1,030 (+288.68%)
Mutual labels:  viml, vim-plugin
8cc.vim
C Compiler written in Vim script
Stars: ✭ 205 (-22.64%)
Mutual labels:  viml, vim-plugin
Vim Hexedit
Hexedit is a plug-in under VIM, which is used to strengthen the hex editing ability of VIM.
Stars: ✭ 42 (-84.15%)
Mutual labels:  viml, vim-plugin
Vim Plugin Viewdoc
Vim plugin: flexible viewer for any documentation
Stars: ✭ 79 (-70.19%)
Mutual labels:  viml, vim-plugin
Tskeleton vim
File Templates and Code Skeletons/Snippets for VIM
Stars: ✭ 33 (-87.55%)
Mutual labels:  viml, vim-plugin
Incsearch Fuzzy.vim
Stars: ✭ 116 (-56.23%)
Mutual labels:  viml, vim-plugin
Vim Gnupg
This script implements transparent editing of gpg encrypted files.
Stars: ✭ 566 (+113.58%)
Mutual labels:  viml, vim-plugin
Vimcompletesme
You don't Complete Me; Vim Completes Me! A super simple, super minimal, super light-weight tab completion plugin for Vim.
Stars: ✭ 752 (+183.77%)
Mutual labels:  viml, vim-plugin
Quickfixsigns vim
Mark quickfix & location list items with signs
Stars: ✭ 126 (-52.45%)
Mutual labels:  viml, vim-plugin
Vifm.vim
Vim plugin that allows use of vifm as a file picker
Stars: ✭ 197 (-25.66%)
Mutual labels:  viml, vim-plugin

jshint2.vim

Lightweight, customizable and functional Vim plugin for JSHint integration.

jshint2.vim

Features

  • Linting whole file or selected lines without saving to disk.
  • Using project-specific (locally installed) version of JSHint and JSHint configuration files if available.
  • Setting lint flags from command line with autocompletion.
  • Optionally opening list of linting errors with useful shortcuts.
  • Optionally validating files after reading or saving.
  • Working on Linux, Windows (with JSHint 2.1.5 and newer) and OS X.

Installation

  1. Install Node.js and JSHint.
  2. Clone plugin into your ~/.vim/bundle/jshint2.vim/.
  3. Install Pathogen or just add set runtimepath+=~/.vim/bundle/jshint2.vim/ into your .vimrc.
  4. Optionally place .jshintrc into your home and/or project directory.
  5. ???
  6. PROFIT!

Usage

Use :JSHint command inside Vim to lint whole file or :'<,'>JSHint to lint only selected lines.
Add ! to suppress opening error list (number of lint errors still will be shown), add space and use tab key to complete space separated lint flags — :JSHint! white:true eqeqeq:true. Use - to ignore errors by their codes — :JSHint -E001 -W002 -I003.

Error List Shortcuts

t — open error in new tab.
T — open error in new tab with error list.
v — open error in new vertical split.
V — open error in new vertical split with error list.
s — open error in new horizontal split.
S — open error in new horizontal split with error list.
i — ignore selected error.
n — scroll to selected error.
q — close error list.

Configuration

Set global JSHint command path (mostly for Windows):

let jshint2_command = '~/path/to/node_modules/.bin/jshint'

Lint JavaScript files after reading it:

let jshint2_read = 1

Lint JavaScript files after saving it:

let jshint2_save = 1

Do not automatically close orphaned error lists:

let jshint2_close = 0

Skip lint confirmation for non JavaScript files:

let jshint2_confirm = 0

Do not use colored messages:

let jshint2_color = 0

Hide error codes in error list (if you don't use error ignoring or error codes confuses you):

let jshint2_error = 0

Set min and max height of error list:

let jshint2_min_height = 3
let jshint2_max_height = 12

Tips

Quick lint mapping:

" jshint validation
nnoremap <silent><F1> :JSHint<CR>
inoremap <silent><F1> <C-O>:JSHint<CR>
vnoremap <silent><F1> :JSHint<CR>

" show next jshint error
nnoremap <silent><F2> :lnext<CR>
inoremap <silent><F2> <C-O>:lnext<CR>
vnoremap <silent><F2> :lnext<CR>

" show previous jshint error
nnoremap <silent><F3> :lprevious<CR>
inoremap <silent><F3> <C-O>:lprevious<CR>
vnoremap <silent><F3> :lprevious<CR>

Author & License

Written by Nikolay S. Frantsev under GNU GPL 3 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].