Giter VIP home page Giter VIP logo

vim-paraglide's Introduction

vim-paraglide ๐Ÿช‚

vim-paraglide is a plugin to make navigating paragraphs easier.

Motivation

The standard } and { paragraph motions jump to the blank lines before and after a paragraph, respectively, rather than to the start and end of the paragraph. If you want to change this behavior, you have to edit the somewhat-arcane nroff macros of the'paragraphs' options.

The standard paragraph motions also don't work very well with blocks, such as when you want to select a vertical column in a markdown table. vim-paraglide provides flexible mappings for most use cases around paragraph navigation.

Features

Jump to edges

Demo: jumping to all edges

Default keybinding: <down>/<up>.

Jump to only top or bottom edges

Demo: jumping to only top or bottom edges

Default keybindings:

  • <s-down>/<s-up> for top edges
  • }/{ for bottom edges (similar to default paragraph motions)

Tip: hold down shift and use the arrow keys to move across paragraphs quickly, if you're just navigating through the file.

Block, or column-aware jumps

Demo: block, or column-aware jumps

Default keybinding: g<down>/g<up>.

This works by ignoring characters to the left of the cursor column when searching for a paragraph break.

Support for visual mode

Demo: visual mode

Support for motions

Demo: visual mode

Mappings

Default mappings

Key Mapping
<down> Jump to next edge
<up> Jump to previous edge
<s-down> (shift-down) Jump to next edge (top only)
<s-up> (shift-up) Jump to previous edge (top only)
} Jump to next edge (bottom only)
{ Jump to previous edge (bottom only)
g<down> Block-wise jump to next edge
g<up> Block-wise jump to previous edge

Custom mappings

To set up a custom mapping, add the following to your .vimrc:

" Use 'gj' and 'gk' to navigate paragraphs instead of the arrow keys.
noremap <silent> gj <Plug>ParaglideDownAny
noremap <silent> gk <Plug>ParaglideUpAny

To see the full list of available keys, do:

:map <Plug>Paraglide <ENTER>

Settings

Setting Purpose Default
g:paraglide_default_maps Whether to install the default mappings. 1
g:paraglide_modify_jumplist Whether to add jumps to the window jumplist. 1
g:paraglide_wrap Whether to wrap around to the top or bottom while jumping. 0

Related plugins

If you like the idea of this plugin, you may also be interested in:

vim-paraglide's People

Contributors

camflint avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vim-paraglide's Issues

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.