Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for the great plugin!
I was finding it mildly confusing to tell which file I'm in at any given time in a Rust project I've been working on recently due to the presence of many 'mod.rs' files. However, I prefer my status line to be quite minimal, ideally showing only the filename. In this case, I thought it would be helpful to dynamically add the parent directory to the filename component when multiple buffers are open with files of the same name.
As such, I decided to add a new path option to lualine to accomodate this behavior.
Example:
Directory structure:
Relevant lualine config:
With one of the mod.rs files open, lualine will look like this:
![image](https://private-user-images.githubusercontent.com/57921252/353648171-238deed6-31e9-4847-89a4-2915dd6da77a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTkzMjgsIm5iZiI6MTczOTQxOTAyOCwicGF0aCI6Ii81NzkyMTI1Mi8zNTM2NDgxNzEtMjM4ZGVlZDYtMzFlOS00ODQ3LTg5YTQtMjkxNWRkNmRhNzdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzNTcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2NTdjMzNkY2FmODI1MTBmMTUyMTFiYmJmZmNmY2EzNDdlYjNmNTgyZmQzOTFkMDE3OTg2Y2JjM2Q4MGYyMjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2lhh9PC9yvfrXQYRzLmhpLyJIvNc6dZPRn5kvo8wvwQ)
When opening the other mod.rs file, lualine will now look like this: (for parser/mod.rs)
![image](https://private-user-images.githubusercontent.com/57921252/353648528-a0718169-8456-4120-a94b-9a4655f1cfc7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTkzMjgsIm5iZiI6MTczOTQxOTAyOCwicGF0aCI6Ii81NzkyMTI1Mi8zNTM2NDg1MjgtYTA3MTgxNjktODQ1Ni00MTIwLWE5NGItOWE0NjU1ZjFjZmM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzNTcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0NjJmNjg0MWY5ODdhMzk2NTIzNTVlODdiODdmMTMyZjIzYTUzNWFjYWMxYzliZTRhMTlhODQ5OTg0OGMyM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.tFsjYb3ndWRiKZsiVWERHmzcKzCbDYTbkuLj0FeiGDY)
![image](https://private-user-images.githubusercontent.com/57921252/353648622-fa8f29b7-1f6c-416c-aa7a-d3eb9cdd3af8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTkzMjgsIm5iZiI6MTczOTQxOTAyOCwicGF0aCI6Ii81NzkyMTI1Mi8zNTM2NDg2MjItZmE4ZjI5YjctMWY2Yy00MTZjLWFhN2EtZDNlYjljZGQzYWY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzNTcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRlY2VjMmJkNWI5ZjVlZmExZTBhYzkyZTg2NTAzNTYzZDdkNTEzYTg4MDY4YzgwMjcyNzM1MGVmMDU3Y2E5NzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LtWZ-V3kiXyv7z_mHoRf4fI-3KOooToJM3RLSwghvto)
And this for src/mod.rs:
Deleting either buffer will cause the component to revert to showing only the filename again.