Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add signs support (instead of underlining) #21

Open
venthur opened this issue Oct 16, 2015 · 0 comments
Open

Please add signs support (instead of underlining) #21

venthur opened this issue Oct 16, 2015 · 0 comments

Comments

@venthur
Copy link

venthur commented Oct 16, 2015

Hi,

thank you very much for this nice plugin, this was really needed. I have one suggestion: could you instead of underlining problems use vim's sign API which was designed exactly for this use-case? It places little one-or-two-letter sings on the left column (e.g. EE, WW, or whatever you want) For an example, syntastic uses it as well (see screenshot in the link).

:help sign

1. Introduction                                 sign-intro signs                                                                                                                                                                                                                  

When a debugger or other IDE tool is driving an editor it needs to be able                                                                                                                                                                                                        
to give specific highlights which quickly tell the user useful information                                                                                                                                                                                                        
about the file.  One example of this would be a debugger which had an icon                                                                                                                                                                                                        
in the left-hand column denoting a breakpoint.  Another example might be an                                                                                                                                                                                                       
arrow representing the Program Counter (PC).  The sign features allow both                                                                                                                                                                                                        
placement of a sign, or icon, in the left-hand side of the window and                                                                                                                                                                                                             
definition of a highlight which will be applied to that line.  Displaying the                                                                                                                                                                                                     
sign as an image is most likely only feasible in gvim (although Sun                                                                                                                                                                                                               
Microsystem's dtterm does support this it's the only terminal emulator I know                                                                                                                                                                                                     
of which does).  A text sign and the highlight should be feasible in any color                                                                                                                                                                                                    
terminal emulator.                                                                                                                                                                                                                                                                

Signs and highlights are not useful just for debuggers.  Sun's Visual                                                                                                                                                                                                             
WorkShop uses signs and highlights to mark build errors and SourceBrowser                                                                                                                                                                                                         
hits.  Additionally, the debugger supports 8 to 10 different signs and                                                                                                                                                                                                            
highlight colors. workshop  Same for Netbeans netbeans.                                                                                                                                                                                                                           

There are two steps in using signs:                                                                                                                                                                                                                                               

1. Define the sign.  This specifies the image, text and highlighting.  For                                                                                                                                                                                                        
   example, you can define a "break" sign with an image of a stop roadsign and                                                                                                                                                                                                    
   text "!!".                                                                                                                                                                                                                                                                     

2. Place the sign.  This specifies the file and line number where the sign is                                                                                                                                                                                                     
   displayed.  A defined sign can be placed several times in different lines                                                                                                                                                                                                      
   and files.                                                                                                                                                                                                                                                                     

When signs are defined for a file, Vim will automatically add a column of two                                                                                                                                                                                                     
characters to display them in.  When the last sign is unplaced the column                                                                                                                                                                                                         
disappears again.  The color of the column is set with the SignColumn group                                                                                                                                                                                                       
hl-SignColumn.  Example to set the color:                                                                                                                                                                                                                                         

        :highlight SignColumn guibg=darkgrey                                                                                                                                                                                                                                      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant