Skip to content

Comments

Show parent directory with filename in lualine statusline#163

Merged
rikuson merged 1 commit intomasterfrom
relaxed-germain
Feb 10, 2026
Merged

Show parent directory with filename in lualine statusline#163
rikuson merged 1 commit intomasterfrom
relaxed-germain

Conversation

@rikuson
Copy link
Owner

@rikuson rikuson commented Feb 10, 2026

Summary

  • Fix sections config that was incorrectly nested inside options (had no effect)
  • Configure lualine_c with filename component using path = 4 to display parent_dir/filename format

Test plan

  • Open Neovim and verify the statusline shows parent_dir/filename (e.g. plugins/lualine.lua)
  • Confirm other statusline sections still render correctly

🤖 Generated with Claude Code

- Move sections config out of options where it was incorrectly nested
- Add lualine_c with filename path=4 to display parent_dir/filename

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Feb 10, 2026

Code Review

Summary

This PR fixes a configuration bug in the lualine statusline plugin and adds parent directory display to the filename component. The changes are well-focused and address a real issue.

✅ Positive Aspects

Bug Fix: The primary change correctly moves the sections configuration out of the options block where it had no effect. In lualine, sections is a top-level configuration key, not nested under options. This fix will now properly hide the mode indicator (lualine_a).

Improved Navigation Context: Adding path = 4 to the filename component provides better context by showing parent_dir/filename, which is helpful when working with files that have the same name in different directories.

Clean Code Structure: The indentation and formatting are consistent with Lua conventions.

🔍 Observations & Considerations

Configuration Validity: The path = 4 option should display the filename with one level of parent directory (e.g., plugins/lualine.lua). This is a valid lualine filename path option.

Empty Section: Setting lualine_a = {} intentionally hides the mode indicator (INSERT, NORMAL, etc.). This is a deliberate choice but worth confirming it's desired behavior, as the mode indicator is often useful for vim users.

Other Sections: The PR only configures lualine_a and lualine_c. Other sections (b, x, y, z) will use lualine's defaults, which typically include:

  • lualine_b: branch, diff, diagnostics
  • lualine_x: encoding, fileformat, filetype
  • lualine_y: progress
  • lualine_z: location

If you want a more minimal statusline, you might consider explicitly configuring the other sections as well.

📋 Test Plan

The test plan in the PR description is appropriate. Consider also testing:

  • Files in the root directory (should show just the filename)
  • Files nested multiple directories deep (should show immediate parent + filename)
  • Unnamed/new buffers (should gracefully handle [No Name])

Recommendation

LGTM - The changes are technically correct and improve the configuration. The bug fix is important and the feature addition is useful. No blocking issues identified.

The only question is whether hiding the mode indicator (lualine_a = {}) is intentional. If so, this is ready to merge.


Review generated by Claude Code

@rikuson rikuson merged commit 3ad116e into master Feb 10, 2026
3 checks passed
@rikuson rikuson deleted the relaxed-germain branch February 10, 2026 03:28
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

Successfully merging this pull request may close these issues.

1 participant