Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.22 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.22 KB

bharyang-vim

Plugin to sort imports in a JavaScript project for Vim/NeoVim

Installation

bharyang-vim depends on bharyang-cli.

Installation with vim-plug

vim-plug can install bharyang-cli as a post-install hook, and lazy load this plugin for JavaScript projects.

Plug 'squgeim/bharyang-vim', { 'do': 'npm install -g bharyang-cli', 'for': ['javascript'] } 

For manual installations, install bharyang-cli from npm:

npm install -g bharyang-cli

Usage

Select the import lines in visual mode. Use any of the following commands:

Bharyang
BharyangAsc
BharyangDesc
BharyangGroup

The Bharyang command uses a configuration value to determine default sort type. The value can be one of asc, desc or group. For example, to set it to desc:

let g:bharyang_default_sort_type="desc"

Contribution

The code is quite straight forward, bharyang-cli does all of the heavy lifting. Pull requests are always welcome.