Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vim plugin to extract an expression to a variable

License

NotificationsYou must be signed in to change notification settings

fvictorio/vim-extract-variable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Extract an expression to a variable.

vim-extract-variable demo

Installation

Use one of the hundred of methods that exist to install a vim plugin. I recommendvim-plug:

Plug 'fvictorio/vim-extract-variable'

Usage

A normal and visual mapping is set:<leader>ev. If you use it in visual mode, it extracts the selected text to a variable. The name of the variable will be prompted to you. If you use it in normal mode, the text between parentheses is used.

The declaration is created in the previous line, usingO, so it should preserve the indentation if you haveautoindent on.

Supported languages

The following languages are supported:

LanguageResult
Elixirfoo = 42
Gofoo := 42
JavaScriptconst foo = 42
Rfoo <- 42
Rubyfoo = 42
TypeScriptconst foo = 42
Pythonfoo = 42
C#var foo = 42;
C++auto foo = 42;

About

Vim plugin to extract an expression to a variable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp