Skip to content

oesse/vim-jsrf

Repository files navigation

vim-jsrf

Build Status

Refactorings for javascript in vim.

Installation

Requirements:

  • Vim 8 or NeoVim v0.2.0
  • Node 5
Plug 'oesse/vim-jsrf', { 'do': 'npm install' }
cd ~/.vim/bundle
git clone git://github.com/oesse/vim-jsrf.git
cd vim-jsrf && npm install

Usage

In a javascript file use <leader>r as the prefix for refactoring commands in normal and visual mode. Available refactorings:

default mapping name description
<leader>rv extract variable Extract the expression under the cursor to new const variable
<leader>re expand object Put each property of object literal on a line of its own
<leader>rc collapse object Put the object literal on a single line

You can change the refactorings prefix in your vimrc:

let g:jsrf_map_leader = '\'

About

Refactorings for javascript in vim.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published