From fe232545587959c2d01eb901d547744b345b0fcb Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 26 Jul 2025 20:28:18 +0200 Subject: [PATCH] Add system default app integration to Neovim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add o keymap to open current file with system default application - Uses ':silent \!open %' to prevent command output clutter - Update README with new keymap documentation - Enables quick preview of markdown, images, PDFs in native apps Enhances workflow by bridging Neovim editing with system-level file viewing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 1 + nvim.nix | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 3a93cba..736480f 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ home-manager switch --flake github:Logan-Lin/nix-config#yanlin | `e` | Normal | Toggle file explorer | | `w` | Normal | Save file | | `q` | Normal | Quit | +| `o` | Normal | Open file with system default app | | `y` | Normal/Visual | Copy to system clipboard | | `p` | Normal/Visual | Paste from system clipboard | | `gs` | Normal | Git status | diff --git a/nvim.nix b/nvim.nix index 7c65a8a..509359e 100644 --- a/nvim.nix +++ b/nvim.nix @@ -132,6 +132,14 @@ options = { desc = "Replace selection with system clipboard"; }; } + # System integration + { + mode = "n"; + key = "o"; + action = ":silent !open %"; + options = { desc = "Open file with system default app"; }; + } + # Git keymaps (vim-fugitive) { mode = "n";