Giter Site home page Giter Site logo

vim_private_comments's Introduction

Vim support for Private Comments

Private Comments allows you to record comments in your code that aren't in the codebase.

This plugin allows you to integrate Vim with Private Comments.

displaying comments

These comments are tied to the specific version of the lines they comment on. When the lines are updated the comments will disappear, but you'll see them if you use git to roll your repository back to the version of the code where it was created.

You can easily jump to the location associated with one of the comments by putting your cursor on it and typing :pcj (short for Private Comments Jump).

Comment input leverages the GUI if you're using one, or happens within Vim's "Command Line" if you aren't. The comment is automatically associated with the line your cursor is currently on.

entering a comment

Note: Private Comments can only record comments about committed lines. So, if it's a new line, or you've changed the line, you'll need to commit it before commenting.

Requirements

  • The Private Comments server must be running locally
  • The pc client (part of private comments) must be in your $PATH[^1]
  • The git command line client must be installed and also in your $PATH.

If you've installed private comments and git with a package manager like Homebrew, they're already in your path. If you've done things manually here's how to add directories to your path in linux.

Installation

This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:

Plugin Manager Install with...
Pathogen git clone https://github.com/masukomi/vim_private_comments ~/.vim/bundle/vim-airline
Remember to run :Helptags to generate help tags
NeoBundle NeoBundle 'masukomi/vim_private_comments'
Vundle Plugin 'masukomi/vim_private_comments'
Plug Plug 'masukomi/vim_private_comments'
VAM call vam#ActivateAddons([ 'vim-airline' ])
Dein call dein#add('masukomi/vim_private_comments')
minpac call minpac#add('masukomi/vim_private_comments')
pack feature (native Vim 8 package feature) git clone https://github.com/masukomi/vim_private_comments ~/.vim/pack/dist/start/vim-airline
Remember to run :helptags to generate help tags
manual copy all of the files into your ~/.vim directory

Vim Plug: Plug 'masukomi/vim_private_comments'

Alternately, however your preferred plugin manager generally installs vim plugins on GitHub.

Usage

Add the following aliases to your ~/.vimrc to create aliases for each of the four Private Comments commands. Then reload your ~/.vimrc or restart vim (for instructions on editing your ~/.vimrc see Editing Your .vimrc file on Vim.works)

:cabbr pcv :call private_comments#View()
:cabbr pcj :call private_comments#JumpToCommentLine()
:cabbr pcr :call private_comments#RecordComment()
:cabbr pcd :call private_comments#DeleteComment()
:cabbr pcc :call private_comments#ClosePCWindow()

Explanation

  • :pcv -> (v for View) Views the private comments for the current file.
  • :pcr -> (r for Record) Records a private comment for the current line of the current file.
  • :pcd -> (d for Delete) Deletes the private comment on the current line.
  • :pcj -> (j for Jump) Jump you to the comment about the specified line.
    • Run from within the private comments listing this will look for the <number>: at the start of the comment line and jump to that line in your main editor window. These line numbers are auto-generated so you don't have to put them in your comment.
  • :pcc -> (c for Close) closes the private comments window.
    • Switching to the private comments window and running :q works fine too. ;)

You can find help docs at :help PrivateComments

License

MIT


^1: Note: This article describes [PATH] and how to work with it if you're unfamiliar.

vim_private_comments's People

Contributors

masukomi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vim_private_comments's Issues

make it clear when the error is that the line is uncommitted

Right now all errors are getting eaten. A common source of errors will be that the user is trying to comment on a line that hasn't been committed yet (or has uncommitted changes).

The pc client will respond with a status code of 9 and print the following message to the STDERR

Line [line number] has not been committed yet. I can't act on uncommitted lines.

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.