Giter Site home page Giter Site logo

mrossinek / vim-verdict Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 32 KB

A version-control-friendly prose text formatter for vim (and neovim).

Home Page: https://gitlab.com/mrossinek/vim-verdict

License: MIT License

Vim Script 100.00%
vim nvim neovim prose text format indent vcs git

vim-verdict's Introduction

vim-verdict

vim-verdict is a simple formatting tool to help you maintain more VCS-friendly prose text. It follows the ideas outlined in this blog.

Installation

I would recommend using minpac which makes extensive use of the package feature which was added to Vim 8 and Neovim.

call minpac#add('https://gitlab.com/mrossinek/vim-verdict')

Other package managers work in a similar fashion.

Usage

Since the functionality provided by vim-verdict can be seen as rather restrictive to some use-cases, it is not enabled by default for any filetype. Therefore, in order to use it, you must enable it explicitly where appropriate. You can do so by running

:call verdict#Init()

You may also deactivate again with the corresponding Deinit function.

:call verdict#Deinit()

This function will initialize some configurable variables (see Configuration further down) and set the following options local to your buffer:

formatexpr=verdict#Format()
indentexpr=verdict#Indent(v:lnum)

This will enable automatic indentation while typing in insert mode. Furthermore, you will be able to use gq{motion} to format the text moved over by motion.

Note: I recommend using the plugin localvimrc which allows you to use local .lvimrc files to specify additional settings on a project-basis. This will allow you to automatize the initialization of vim-verdict where you need it on a regular basis. You could for example add a single .lvimrc file to the root of your website, notes directory or tex project.

Configuration

vim-verdict makes use of the following variables:

  • g:verdict_loaded: if existing, verdict is not loaded again [Default: 1 (after initial loading)]
  • g:verdict_sentence_delims: symbols delimiting a sentence [Default: .!?]
  • g:verdict_sentence_suffixes: symbols which may follow a delimiter [Default: )]}"'']
  • g:verdict_default_textwidth: default textwidth used when no other value is specified [Default: 80]
  • g:verdict_overwrite_shiftwidth: option to overwrite the shiftwidth with a verdict specific value [no default]

vim-verdict's People

Contributors

mrossinek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

hangyav

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.