Coder Social home page Coder Social logo

move-char-left-right.vim's Introduction

Move-Char-Left-Right.vim

This Vim plugin provides actions for moving the character under the cursor left or right.

Why?

This can be done in vanilla Vim using xp and xhP, but that is annoyingly asymmetric, does not accept counts, and is not dot-repeatable. This plugin fixes all 3 points.

Mappings

No mappings are created automatically, add your own. I use:

nmap  <Plug>(move-char-left)
nmap  <Plug>(move-char-right)

or with init.lua:

vim.keymap.set('n', '', '<Plug>(move-char-left)')
vim.keymap.set('n', '', '<Plug>(move-char-right)')

because of its reminiscence of the [e ]e mappings from vim-unimpaired.

Usage

In normal mode, use [count][ä to move the character under the cursor [count] positions to the left. Want to move it again? Use . or [count].! Analogously for .

Want to move a character to the start or end of line? Use a large [count], i.e. 500[ä or 500]ä.

Requirements

Developed and tested on Neovim 0.9.1. It's 100% Vimscript and nothing fancy, so it should work on Vim 8+, too. Does not require vim-repeat for the dot repeat.

move-char-left-right.vim's People

Contributors

bagohart avatar

Watchers

 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.