Skip to content
This repository was archived by the owner on Jul 29, 2023. It is now read-only.

Conversation

chrisphilip322
Copy link

I prefer to have the indention character on the right side of the indent rather than on the left. This small change adds an option that lets you choose to right align the character instead of left align it.

  1. Left align, first indent on, no regression
// let g:indentLine_showFirstIndentLevel = 1
// " let g:indentLine_right_align = 1       
// let g:indentLine_first_char = '·'        
// let g:indentLine_char = '·'              
                                            
#include <stdio.h>                          
                                            
int main(int argc, char **argv) {           
· for(int i=0; i < 20; i++) {               
· · if(i % 15 == 0) {                       
· · · printf("fizzbuzz\n");                 
· · } else if(i % 5 == 0) {                 
· · · printf("buzz\n");                     
· · } else if(i % 3 == 0) {                 
· · · printf("fizz\n");                     
· · } else {                                
· · · printf("%d\n", i);                    
· · }                                       
· }                                         
}                                           
  1. Left align, no first indent, no regression
// let g:indentLine_showFirstIndentLevel = 0
// " let g:indentLine_right_align = 1       
// let g:indentLine_first_char = '·'        
// let g:indentLine_char = '·'              
                                            
#include <stdio.h>                          
                                            
int main(int argc, char **argv) {           
  for(int i=0; i < 20; i++) {               
  · if(i % 15 == 0) {                       
  · · printf("fizzbuzz\n");                 
  · } else if(i % 5 == 0) {                 
  · · printf("buzz\n");                     
  · } else if(i % 3 == 0) {                 
  · · printf("fizz\n");                     
  · } else {                                
  · · printf("%d\n", i);                    
  · }                                       
  }                                         
}                                                                                
  1. Right align, first indent, new feature
// let g:indentLine_showFirstIndentLevel = 1
// let g:indentLine_right_align = 1         
// let g:indentLine_first_char = '·'        
// let g:indentLine_char = '·'              
                                            
#include <stdio.h>                          
                                            
int main(int argc, char **argv) {           
 ·for(int i=0; i < 20; i++) {               
 · ·if(i % 15 == 0) {                       
 · · ·printf("fizzbuzz\n");                 
 · ·} else if(i % 5 == 0) {                 
 · · ·printf("buzz\n");                     
 · ·} else if(i % 3 == 0) {                 
 · · ·printf("fizz\n");                     
 · ·} else {                                
 · · ·printf("%d\n", i);                    
 · ·}                                       
 ·}                                         
}                                           
  1. Right align, no first indent, new feature
// let g:indentLine_showFirstIndentLevel = 1
// let g:indentLine_right_align = 1         
// let g:indentLine_first_char = '·'        
// let g:indentLine_char = '·'              
                                            
#include <stdio.h>                          
                                            
int main(int argc, char **argv) {           
  for(int i=0; i < 20; i++) {               
   ·if(i % 15 == 0) {                       
   · ·printf("fizzbuzz\n");                 
   ·} else if(i % 5 == 0) {                 
   · ·printf("buzz\n");                     
   ·} else if(i % 3 == 0) {                 
   · ·printf("fizz\n");                     
   ·} else {                                
   · ·printf("%d\n", i);                    
   ·}                                       
  }                                         
}                                           

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant