This is an automated archive made by the Lemmit Bot.
The original was posted on /r/neovim by /u/MirrorCold3935 on 2025-06-28 13:23:11+00:00.
Hey r/neovim! ๐
Iโm excited to share my first Neovim plugin with the community! This has been a fantastic learning experience, and Iโd love to get your feedback.
What is lastplace.nvim?
A modern, Lua-based plugin that intelligently restores your cursor position when reopening files. Think of it as โwhere was I?โ for your code editing sessions.
๐ Repository: https://github.com/nxhung2304/lastplace.nvim
Why another lastplace plugin?
I know there are already several similar plugins like nvim-lastplace , remember.nvim , and the original vim-lastplace (which are all great!), but I wanted to create something as a learning project and ended up with some different design decisions:
๐๏ธ Architecture-focused
- Modular design - Clean separation of concerns across 5 separate files (
init.lua
,config.lua
,core.lua
,commands.lua
,utils.lua
) - Comprehensive API - Full programmatic control for advanced users
- Extensive configuration - 8+ options for fine-tuning behavior
- Modern tooling - Complete development setup with Makefile, git hooks, CI/CD
๐ง Smart behaviors:
- Only jumps when it makes sense (respects file size, cursor visibility)
- Automatic fold opening and optional cursor centering
- Debug mode for troubleshooting
- Manual commands for full control
Features Iโm proud of:
- ๐ Zero dependencies - Pure Lua implementation with no external requirements
- ๐ Comprehensive documentation - Detailed help documentation and examples
- ๐ง Development-ready - Complete Makefile, git hooks, formatting setup
- ๐ฏ User commands -
:LastPlaceJump
,:LastPlaceToggle
,:LastPlaceInfo
,:LastPlaceReset
- ๐ก๏ธ Error handling - Graceful handling of edge cases
What sets it apart:
- ๐๏ธ Modular architecture - Easy to understand and extend
- โ๏ธ Rich configuration - 8 different options vs 3-4 in other plugins
- ๐ง Manual control - 4 user commands for complete control
- ๐ Debug support - Built-in debugging capabilities
- ๐ Complete documentation - Full help file with examples and troubleshooting
What I learned building this:
As my first plugin, this taught me:
- Lua module organization and architecture patterns
- Neovimโs autocmd system and buffer/window management
- Plugin development best practices (testing, documentation, CI/CD)
- The importance of user experience in configuration design
- How to structure a project for maintainability and contribution
This was purely a learning exercise that turned into something I thought might be useful to others. Iโm not trying to compete with existing solutions - I learned a ton from them!
Looking forward to your feedback and suggestions! ๐