Coder Social home page Coder Social logo

absort0 / vim-unimpaired Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tpope/vim-unimpaired

0.0 0.0 0.0 139 KB

unimpaired.vim: Pairs of handy bracket mappings

Home Page: https://www.vim.org/scripts/script.php?script_id=1590

Vim Script 100.00%

vim-unimpaired's Introduction

unimpaired.vim

Much of unimpaired.vim was extracted from my vimrc when I noticed a pattern: complementary pairs of mappings. They mostly fall into four categories.

There are mappings which are simply short normal mode aliases for commonly used ex commands. ]q is :cnext. [q is :cprevious. ]a is :next. [b is :bprevious. See the documentation for the full set of 20 mappings and mnemonics. All of them take a count.

There are linewise mappings. [<Space> and ]<Space> add newlines before and after the cursor line. [e and ]e exchange the current line with the one above or below it.

There are mappings for toggling options. [os, ]os, and yos perform :set spell, :set nospell, and :set invspell, respectively. There's also l (list), n (number), w (wrap), x (cursorline cursorcolumn), and several others, plus mappings to help alleviate the set paste dance. Consult the documentation.

There are mappings for encoding and decoding. [x and ]x encode and decode XML (and HTML). [u and ]u encode and decode URLs. [y and ]y do C String style escaping.

And in the miscellaneous category, there's [f and ]f to go to the next/previous file in the directory, and [n and ]n to jump between SCM conflict markers.

The . command works with all operator mappings, and will work with the linewise mappings as well if you install repeat.vim.

Installation

Install using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/unimpaired.git
vim -u NONE -c "helptags unimpaired/doc" -c q

FAQ

My non-US keyboard makes it hard to type [ and ]. Can I configure different prefix characters?

The easiest solution is to map to [ and ] directly:

nmap < [
nmap > ]
omap < [
omap > ]
xmap < [
xmap > ]

Note we're not using the noremap family because we do want to recursively invoke unimpaired.vim's maps.

Contributing

See the contribution guidelines for pathogen.vim.

Self-Promotion

Like unimpaired.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.

vim-unimpaired's People

Contributors

tpope avatar blueyed avatar awood avatar andrewradev avatar muchzill4 avatar bohrshaw avatar bjnord avatar jebaum avatar justinmk avatar tinybeachthor avatar kuntau avatar teoljungberg avatar tommcdo avatar treyhunner avatar tylerbrazier avatar wjlroe avatar wbolster avatar kiryph avatar mmontu avatar solawing avatar y 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.