-
Notifications
You must be signed in to change notification settings - Fork 4
add neovide #44
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
add neovide #44
Conversation
📝 WalkthroughWalkthroughThis pull request integrates Neovide support into the project. A new package for Neovide is declared in the flake along with its dedicated Nix expression that uses the wrapper-manager to create a Neovide wrapper. The development shell is updated to inherit Neovide alongside Neovim. Additionally, Lua configuration files are enhanced: a conditional in the init file detects the Neovide environment to load a dedicated module, and a new Lua script configures GUI settings, scaling factors, and key mappings for Neovide. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant FS as flake.nix
participant NV as Neovide Wrapper (nvide.nix)
participant PL as Plugin Loader (init.lua)
participant NP as Neovide Module (neovide.lua)
participant User as User
Dev->>FS: Start devShell (includes neovim, neovide)
FS->>NV: Invoke callPackage for Neovide wrapper
NV->>PL: Provide Neovide configuration details
PL->>PL: Check if vim.g.neovide is set
PL->>NP: Conditionally require "neovide" module
NP->>NP: Set GUI font & initialize scaling factors and keymaps
User->>NP: Press <C-+> or <C--> keys
NP->>NP: Execute scale_up or scale_down functions
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (4)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
nvide.nix (1)
1-20: Well-structured Nix wrapper for NeovideThis is a clean implementation using wrapper-manager to properly configure Neovide with the correct Neovim binary. The use of
lib.getExeto get the executable path is a good practice.Consider adding a brief comment explaining what the
.config.build.packages.neovidechain does for developers who might not be familiar with the wrapper-manager pattern.+# Use wrapper-manager to create a Neovide wrapper that uses our configured Neovim (inputs.wrapper-manager.lib { inherit pkgs; modules = [ { wrappers.neovide.basePackage = neovide; wrappers.neovide.flags = ["--neovim-bin" (lib.getExe self'.packages.neovim) "--fork"]; } ]; }) .config .build .packages .neovideplugins/nobbz/lua/nobbz/neovide.lua (1)
1-2: Consider making font settings more configurableThe font setting is hardcoded. For better maintainability, consider extracting the font name and size into variables at the top of the file.
-vim.o.guifont = "Departure Mono:11" +local font_name = "Departure Mono" +local font_size = 11 +vim.o.guifont = font_name .. ":" .. font_size
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
flake.nix(3 hunks)nvide.nix(1 hunks)plugins/nobbz/lua/nobbz/init.lua(1 hunks)plugins/nobbz/lua/nobbz/neovide.lua(1 hunks)
🔇 Additional comments (7)
plugins/nobbz/lua/nobbz/init.lua (1)
56-56: Clean implementation of conditional Neovide module loadingThis is a good approach to selectively load the Neovide configuration only when running in the Neovide environment. The code follows the established pattern for module loading in this file and is placed at a logical position in the initialization sequence.
plugins/nobbz/lua/nobbz/neovide.lua (3)
3-3: Initial scale factor might be too smallThe initial scale factor of 0.6 is significantly smaller than the default (1.0). This might make the interface appear too small, especially on high-resolution displays.
Consider testing with a value closer to 1.0 (perhaps 0.9 or 1.0) or making this configurable through a user setting.
5-17: Good scaling implementationThe scaling mechanism is well-implemented with proportional changes using multiplication/division, which ensures consistent scaling behavior regardless of the current scale.
19-22: Clear key mappings for scalingThe key mappings for scaling are clear and intuitive. Using Which-Key with descriptions ensures these functions are discoverable.
flake.nix (3)
30-30: Clean package declaration for NeovideThis package declaration properly calls the nvide.nix file with the necessary context.
41-41: Good integration of Neovide into the development shellAdding Neovide to the development shell makes it easily accessible alongside Neovim.
69-71: Properly structured dependency for wrapper-managerThe wrapper-manager input is correctly added with the "follows" directive to ensure consistent nixpkgs usage across the project.
Summary by CodeRabbit
neovide.neovideto the package management system.