GithubHelp home page GithubHelp logo

nigo81 / vim-rt-format Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skywind3000/vim-rt-format

0.0 0.0 0.0 11 KB

:sunglasses: Prettify Current Line on Enter !!

License: MIT License

Vim Script 100.00%

vim-rt-format's Introduction

RT-Format

Format current line immediately in INSERT mode as soon as you press ENTER:

picture

Features

  • Format the current line in real-time when you press ENTER.
  • Seamless, no need to stop your work to run an extra command like gq or :Neoformat.
  • When you are focusing on editing, everything is done without paying extra attention.
  • No external process (eg. LSP servers) dependencies.
  • Supported languages including Python, Lua, Ruby, and Javascript.

Requirements

  • Vim with "+python3" feature.
  • Python module "autopep8".

Quick Start

Install the plugin with vim-plug:

" Tell vim-plug to install python module with post-update hook
Plug 'skywind3000/vim-rt-format', { 'do': 'pip3 install autopep8' }

" By default, it will be triggered by `ENTER` in insert mode.
" set this to 1 to use `CTRL+ENTER` instead, and keep the  
" default `ENTER` behavior unchanged.
let g:rtf_ctrl_enter = 0

" Enable formatting when leaving insert mode
let g:rtf_on_insert_leave = 1

Enable plugin for current buffer:

:RTFormatEnable

Then you go.

Credit

Some of my other plugins may also interest you:

  • asynctasks.vim: Modern task system for project building, testing and deploying.
  • vim-quickui: The missing UI extensions for Vim 8.2 (and NeoVim 0.4).
  • vim-auto-popup: Display the completion menu automantically.

vim-rt-format's People

Contributors

skywind3000 avatar nigo81 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.