• 20Apr
    Categories: VIM, development Comments: 0

    Hi there.

    These days is all about being efficient in your working process. Now, I find myself using Vim a lot, bot for regular text processing, e-mail, Wiki page edit (Firefox + ViewSourceWith), and Python/C/C++ programming.

    I should be clear on that the usage of Vim as an IDE pretty much relies on the size of the software project. If we are making a very small software, then most often I find Vim most efficient. But, however, if the project is large, then maybe Eclipse or KDevelop is more efficient. I should also state that I keep Java programming in the Eclipse IDE.

    So, how can you use Vim Marks to be more efficient? Well, given that you have a large source code file, and you find yourself moving a lot between some blocks of code. Then, a way of saving you for the trouble of actually holding in your keys until your at the requested position, you just jump to a previously declared mark.

    Vim screenshot

    Vim screenshot

    Now, if we were have the marker over some frequently used function/class/variable (or something), and we want to store a VIM marker there, we hit the keys:ma.

    This stores a marker in registry a. So, if we’re somewhere else in our file, and want to jump back, we may type: 'a.

    Notice however that there is a distinction between lowercase and uppercase registry definition. If we type mA instead of ma, then we are able to jump between files (often you’re writing source code in multiple files). You may store these markers in registers from a-z for in-file references, and A-Z for between file references.

    To delete your marker, type: d'a. If you only want to replace it with a new marker, then simply type ma. You may also list all known markers with:


    :markers

    I would recommend reading this Vim wiki page regarding these Vim markes. I find them very useful, hopefully also you will.

    Vim screenshot

    Vim screenshot

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.