Giter VIP home page Giter VIP logo

vim-visualmarks's Introduction

visualMarks

visualMarks is a small vimScript allowing marking and retrieving visually selected blocks by associating them to marks, in way inspired from Vim's native "registers".

Usage:

To use it with the default mapping and save the mark in register "a", type in visual mode:

ma

Note that to do the same, but save the selection in register "b" it would be mb etc.

The default mapping to retrieve the mark from register "a" is this in normal mode:

<a

And you will get it back. Of course, you can replace a with any mark you want. These visual registers are saved in a separate file and are totally isolated from the normal registers so a regular mark in register "a" will not get overwritten by a visual mark in register "a".

This script also remembers which of the 3 visual modes you were in when you made the mark, and it will recover that as well. So if you were in block visual, and you retrieve your mark, you will have your mark selected in block visual.

These marks are also specific to a file, so a visual mark in file "a.txt" and a visual mark in file "b.txt" of the same register name are different marks, and will be persistent (ie, they will be able to be used after coming back to a file after closing it).

Configure marksFile path

In case you'd want to store the marks file in an alternative location, then configure your preference in your vimrc, for example:

let g:visualMarks_marksFile = $XDG_CONFIG_HOME . '/vim/vis-mark'

Making Your Own Mapping:

To change the default mapping to something else, put this into your vimrc:

vmap <unique> m <Plug>VisualMarksVisualMark
nmap <unique> < <Plug>VisualMarksGetVisualMark

And then change the m or < to whatever you want to use.

A Note from the Developers:

A few more features will come soon I hope. Feel free to contribute of course if you feel inspired! :)

vim-visualmarks's People

Contributors

hallzy avatar iago-lito avatar slve 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.