{"id":13411204,"url":"https://github.com/kevinhwang91/rnvimr","last_synced_at":"2025-05-15T05:07:26.402Z","repository":{"id":37461773,"uuid":"236804933","full_name":"kevinhwang91/rnvimr","owner":"kevinhwang91","description":"Make Ranger running in a floating window to communicate with Neovim via RPC","archived":false,"fork":false,"pushed_at":"2025-02-13T10:06:04.000Z","size":245,"stargazers_count":833,"open_issues_count":10,"forks_count":20,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T10:09:57.967Z","etag":null,"topics":["neovim","nvim","nvim-plugin","python","ranger","vim"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevinhwang91.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-28T18:13:27.000Z","updated_at":"2025-04-08T01:18:07.000Z","dependencies_parsed_at":"2024-01-03T03:29:27.416Z","dependency_job_id":"d5588b63-6d35-4a35-98a1-af140e23455f","html_url":"https://github.com/kevinhwang91/rnvimr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhwang91%2Frnvimr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhwang91%2Frnvimr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhwang91%2Frnvimr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhwang91%2Frnvimr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinhwang91","download_url":"https://codeload.github.com/kevinhwang91/rnvimr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","nvim","nvim-plugin","python","ranger","vim"],"created_at":"2024-07-30T20:01:12.132Z","updated_at":"2025-05-15T05:07:21.392Z","avatar_url":"https://github.com/kevinhwang91.png","language":"Python","funding_links":[],"categories":["File Explorer","Python"],"sub_categories":["Markdown and LaTeX","Assembly"],"readme":"# Rnvimr\n\nRnvimr is a NeoVim plugin that allows you to use Ranger in a floating window.\n\nDifferent than other Ranger vim-plugins, Rnvimr gives you full control over Ranger.\nIt uses [RPC](https://neovim.io/doc/user/api.html#RPC) to communicate with Ranger.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"960px\" src=\"https://user-images.githubusercontent.com/17562139/94383438-a3be7680-0172-11eb-9f57-f3cd88aff0c0.gif\"\u003e\n\u003c/p\u003e\n\n**This plugin does not support Vim.**\n\n## Table of contents\n\n* [Requirements](#requirements)\n* [Features](#features)\n* [Installation](#installation)\n  * [Dependence](#dependence)\n  * [Plugin](#plugin)\n  * [CheckHealth (optional)](#checkhealth-(optional))\n* [Usage](#usage)\n  * [Demonstration](#demonstration)\n  * [Example configuration](#example-configuration)\n    * [Minimal configuration](#minimal-configuration)\n    * [Advanced configuration](#advanced-configuration)\n* [FAQ](#faq)\n* [License](#license)\n\n## Requirements\n\n1. [Ranger](https://github.com/ranger/ranger) (v1.9.3 or laster)\n2. [Pynvim](https://github.com/neovim/pynvim)\n3. [Neovim](https://github.com/neovim/neovim) 0.5 or later\n4. Python3.6\n5. [Ueberzug](https://github.com/seebye/ueberzug) (optional, v18.1.6 or laster) /\n[Ueberzugpp](https://github.com/jstkdng/ueberzugpp) (optional, v2.3.0 or laster)\n\n## Features\n\n- Replace the built-in Netrw as a default file explorer\n- Calibrated preview images for ueberzug\n- Attach file automatically when toggling Ranger\n- Adjust floating window size automatically after resizing NeoVim\n- Adjust view automatically to adapt the size of floating window\n- Fully customizable layouts for floating window\n- Better experience for Pager view in Ranger\n- Wipe out the buffers corresponding to the files deleted by Ranger automatically\n- Enhanced border in Ranger\n- Synchronize the current working directory of Neovim and Ranger\n- Hide the files included in gitignore\n- Save Buffer information when the src files are moved from Ranger\n\n## Installation\n\n### Dependence\n\nExample for [yay](https://github.com/Jguer/yay) in ArchLinux and\n[pip](https://pip.pypa.io/en/stable/) in other \\*unix distributions:\n\n```sh\n# ArchLinux install all requirements is extremely convenient\nyay -S ranger python-pynvim ueberzug\n# ~ `ueberzug` can be replaced with `ueberzugpp` ~\n\n# pip\n\n# macOS users please install ranger by `pip3 ranger-fm` instead of `brew install ranger`\n# There're some issues about installation, such as https://github.com/ranger/ranger/issues/1214\n# Please refer to the issues of ranger for more details\npip3 install ranger-fm pynvim\n\n# Ueberzug/Ueberzugpp is not supported in macOS because it depends on X11\npip3 install ueberzug\n```\n\n\u003e Ueberzug is optional\n\n### Plugin\n\nInstall Rnvimr with your favorite plugin manager! Example for [Vim-plug](https://github.com/junegunn/vim-plug):\n\n```vim\nPlug 'kevinhwang91/rnvimr'\n```\n\n### CheckHealth (optional)\n\nRun `nvim +'checkhealth rnvimr'` in shell. If everything is OK, it will output like these:\n\n```log\nhealth#rnvimr#check\n========================================================================\n## OS\n  - OK: Name: Linux\n\n## Ranger\n  - OK: Version: ranger-master\n\n## Python\n  - OK: Version: 3.8.3 (default, May 17 2020, 18:15:42) [GCC 10.1.0]\n\n## Pynvim\n  - OK: Version: 0.4.1\n\n## Ueberzug (optional)\n  - OK: Ueberzug is ready\n\n## RPC\n  - OK: RPC echo: Neovim send \"Give me five!\" and receive \"Give me five!\"\n```\n\n## Usage\n\nUsing `:RnvimrToggle` to create a Ranger process, and if one exists,\n`:RnvimrToggle` simply shows or hides the floating window.\n\nUsing `:RnvimrResize` to cycle the preset layouts.\n\nPressing `Enter` to open a file in Ranger.\n\nRnvimr also supports `ctrl-t`/`ctrl-x`/`ctrl-v` key bindings that allow you to\nopen up a file in a new tab, a new horizontal split, or in a new vertical split.\n\nPressing `q` in Ranger simply hides the floating window.\nRanger will attach the file of the current buffer in the next toggle event.\n\nPressing `yw` in Ranger will emit Ranger's cwd to Neovim's, `gw` will jump to Neovim's cwd.\n\n### Demonstration\n\n\u003cdetails\u003e\n    \u003csummary\u003eHide the files included in gitignore\u003c/summary\u003e\n    \u003cp align=\"center\"\u003e\n        \u003cimg src=\"https://user-images.githubusercontent.com/17562139/86036499-8e04bc80-ba70-11ea-9f89-dac26795b7ec.png\"\u003e\n    \u003c/p\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n    \u003csummary\u003eSave buffers information (undo) when the src files are moved from Ranger\u003c/summary\u003e\n    \u003cp align=\"center\"\u003e\n        \u003cimg width=\"960px\" src=\"https://user-images.githubusercontent.com/17562139/86033825-23518200-ba6c-11ea-88d6-914d8d8f1f96.gif\"\u003e\n    \u003c/p\u003e\n\u003c/details\u003e\n\n### Example configuration\n\n#### Minimal configuration\n\n```vim\nPlug 'kevinhwang91/rnvimr'\n\ntnoremap \u003csilent\u003e \u003cM-i\u003e \u003cC-\\\u003e\u003cC-n\u003e:RnvimrResize\u003cCR\u003e\nnnoremap \u003csilent\u003e \u003cM-o\u003e :RnvimrToggle\u003cCR\u003e\ntnoremap \u003csilent\u003e \u003cM-o\u003e \u003cC-\\\u003e\u003cC-n\u003e:RnvimrToggle\u003cCR\u003e\n```\n\n#### Advanced configuration\n\n```vim\nPlug 'kevinhwang91/rnvimr'\n\n\" Make Ranger replace Netrw and be the file explorer\nlet g:rnvimr_enable_ex = 1\n\n\" Make Ranger to be hidden after picking a file\nlet g:rnvimr_enable_picker = 1\n\n\" Replace `$EDITOR` candidate with this command to open the selected file\nlet g:rnvimr_edit_cmd = 'drop'\n\n\" Disable a border for floating window\nlet g:rnvimr_draw_border = 0\n\n\" Hide the files included in gitignore\nlet g:rnvimr_hide_gitignore = 1\n\n\" Change the border's color\nlet g:rnvimr_border_attr = {'fg': 14, 'bg': -1}\n\n\" Make Neovim wipe the buffers corresponding to the files deleted by Ranger\nlet g:rnvimr_enable_bw = 1\n\n\" Add a shadow window, value is equal to 100 will disable shadow\nlet g:rnvimr_shadow_winblend = 70\n\n\" Draw border with both\nlet g:rnvimr_ranger_cmd = ['ranger', '--cmd=set draw_borders both']\n\n\" Link CursorLine into RnvimrNormal highlight in the Floating window\nhighlight link RnvimrNormal CursorLine\n\nnnoremap \u003csilent\u003e \u003cM-o\u003e :RnvimrToggle\u003cCR\u003e\ntnoremap \u003csilent\u003e \u003cM-o\u003e \u003cC-\\\u003e\u003cC-n\u003e:RnvimrToggle\u003cCR\u003e\n\n\" Resize floating window by all preset layouts\ntnoremap \u003csilent\u003e \u003cM-i\u003e \u003cC-\\\u003e\u003cC-n\u003e:RnvimrResize\u003cCR\u003e\n\n\" Resize floating window by special preset layouts\ntnoremap \u003csilent\u003e \u003cM-l\u003e \u003cC-\\\u003e\u003cC-n\u003e:RnvimrResize 1,8,9,11,5\u003cCR\u003e\n\n\" Resize floating window by single preset layout\ntnoremap \u003csilent\u003e \u003cM-y\u003e \u003cC-\\\u003e\u003cC-n\u003e:RnvimrResize 6\u003cCR\u003e\n\n\" Map Rnvimr action\nlet g:rnvimr_action = {\n            \\ '\u003cC-t\u003e': 'NvimEdit tabedit',\n            \\ '\u003cC-x\u003e': 'NvimEdit split',\n            \\ '\u003cC-v\u003e': 'NvimEdit vsplit',\n            \\ 'gw': 'JumpNvimCwd',\n            \\ 'yw': 'EmitRangerCwd'\n            \\ }\n\n\" Add views for Ranger to adapt the size of floating window\nlet g:rnvimr_ranger_views = [\n            \\ {'minwidth': 90, 'ratio': []},\n            \\ {'minwidth': 50, 'maxwidth': 89, 'ratio': [1,1]},\n            \\ {'maxwidth': 49, 'ratio': [1]}\n            \\ ]\n\n\" Customize the initial layout\nlet g:rnvimr_layout = {\n            \\ 'relative': 'editor',\n            \\ 'width': float2nr(round(0.7 * \u0026columns)),\n            \\ 'height': float2nr(round(0.7 * \u0026lines)),\n            \\ 'col': float2nr(round(0.15 * \u0026columns)),\n            \\ 'row': float2nr(round(0.15 * \u0026lines)),\n            \\ 'style': 'minimal'\n            \\ }\n\n\" Customize multiple preset layouts\n\" '{}' represents the initial layout\nlet g:rnvimr_presets = [\n            \\ {'width': 0.600, 'height': 0.600},\n            \\ {},\n            \\ {'width': 0.800, 'height': 0.800},\n            \\ {'width': 0.950, 'height': 0.950},\n            \\ {'width': 0.500, 'height': 0.500, 'col': 0, 'row': 0},\n            \\ {'width': 0.500, 'height': 0.500, 'col': 0, 'row': 0.5},\n            \\ {'width': 0.500, 'height': 0.500, 'col': 0.5, 'row': 0},\n            \\ {'width': 0.500, 'height': 0.500, 'col': 0.5, 'row': 0.5},\n            \\ {'width': 0.500, 'height': 1.000, 'col': 0, 'row': 0},\n            \\ {'width': 0.500, 'height': 1.000, 'col': 0.5, 'row': 0},\n            \\ {'width': 1.000, 'height': 0.500, 'col': 0, 'row': 0},\n            \\ {'width': 1.000, 'height': 0.500, 'col': 0, 'row': 0.5}\n            \\ ]\n\n\" Fullscreen for initial layout\n\" let g:rnvimr_layout = {\n\"            \\ 'relative': 'editor',\n\"            \\ 'width': \u0026columns,\n\"            \\ 'height': \u0026lines - 2,\n\"            \\ 'col': 0,\n\"            \\ 'row': 0,\n\"            \\ 'style': 'minimal'\n\"            \\ }\n\"\n\" Only use initial preset layout\n\" let g:rnvimr_presets = [{}]\n\n```\n\nFor more information, please refer to [:help rnvimr](./doc/rnvimr.txt),\nbecause I don't want to maintain two documents with the same contents :).\n\n## FAQ\n\nQ: Couldn't open some special types of files by using `Enter` or `l` in Ranger.\n\nA: Please follow the below steps to solve this issue:\n\n1. The behavior of opening the file in Ranger depends on `rifle.conf`.\n   Press `r` to make sure that the `${VISUAL:-$EDITOR} -- \"$@\"` is the best candidate in Ranger.\n2. If the case 1 is false, change the code in `rifle.conf` like that:\n\n\u003c!-- markdownlint-disable MD013 --\u003e\n\n```diff\n-!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- \"$@\"\n+!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php|your_file_type = ${VISUAL:-$EDITOR} -- \"$@\"\n```\n\n\u003c!-- markdownlint-enable MD013 --\u003e\n\nQ: CheckHealth says RPC timeout.\n\nA: Install [Dependence](#Dependence) first,\nrun ex command`:echo $NVIM_LISTEN_ADDRESS` to\nconfirm that the message output is in a format like this `/tmp/nvimIYj484/0` or a tcp format\n`address:port`, Rnvimr needs this environment variable.\n\nQ: How can I go back to the previous directory in Ranger after attaching a new file?\n\nA: Press `H` in Ranger, mean go back to the last history directory.\n\nQ: How can I use Ranger default configuration (vanilla)?\n\nA: Write `let g:rnvimr_vanilla = 1` to your vim configuration.\n\nQ: `let g:rnvimr_enable_ex = 1` can't work as expected.\n\nA: Turn off the option of other plugins (like `let g:NERDTreeHijackNetrw = 0` which is used in\nNERDTree) or uninstall the conflicting plugins.\n\nQ: In MacOS, I must press `\u003cctrl-v\u003e` twice to split window vertically.\n\nA: Please refer to [#71](https://github.com/kevinhwang91/rnvimr/issues/71) and use `rnvimr_action`\nvariable to remap `\u003cctrl-v\u003e` as a workaround for the issue.\n\n## License\n\nThe project is licensed under a BSD-3-clause license. See [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhwang91%2Frnvimr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinhwang91%2Frnvimr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhwang91%2Frnvimr/lists"}