{"id":13761130,"url":"https://github.com/hoschi/yode-nvim","last_synced_at":"2025-04-07T05:11:55.204Z","repository":{"id":44142668,"uuid":"391324603","full_name":"hoschi/yode-nvim","owner":"hoschi","description":"Yode plugin for NeoVim","archived":false,"fork":false,"pushed_at":"2023-04-10T10:40:24.000Z","size":270,"stargazers_count":373,"open_issues_count":6,"forks_count":5,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-03-30T22:11:09.640Z","etag":null,"topics":["lua","neovim","neovim-lua","neovim-plugin","nvim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoschi.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"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}},"created_at":"2021-07-31T10:31:38.000Z","updated_at":"2025-03-16T13:19:01.000Z","dependencies_parsed_at":"2024-01-15T03:58:50.395Z","dependency_job_id":"2ebd045d-330b-4d55-a457-bf96bc1cea8e","html_url":"https://github.com/hoschi/yode-nvim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoschi%2Fyode-nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoschi%2Fyode-nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoschi%2Fyode-nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoschi%2Fyode-nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoschi","download_url":"https://codeload.github.com/hoschi/yode-nvim/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"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":["lua","neovim","neovim-lua","neovim-plugin","nvim"],"created_at":"2024-08-03T13:01:39.631Z","updated_at":"2025-04-07T05:11:55.188Z","avatar_url":"https://github.com/hoschi.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Yode-Nvim\n\n| [HackerNews](https://news.ycombinator.com/item?id=30305011) | [reddit](https://www.reddit.com/r/neovim/comments/sq5yfn/yodenvim_focused_code_editing_for_neovim/) |\n\n[Yode](https://github.com/hoschi/yode) plugin for [NeoVim](https://neovim.io/)\n\nFocus on the important parts of the code. Hide the rest, literally. With\nYode-Nvim you can go deeper than the file level, picking out the lines that are\nimportant for the current task. Whether you want to focus on important parts of\na large file, or collect small parts of many files, you can see everything at a\nglance. Zoom from the focused part back into the file to briefly expand your\ncontext or adjust your focus. Everything happens in the editor, the rest of the\ntool chain still works, this makes Yode-Nvim work for any programming language,\nframework, etc.\n\nFor the past six months, I've been using this MVP in its various stages in\ndevelopment for Yode-Nvim itself. Currently I am working on fixing minor bugs\nand integrating more plugins.\n\n## Introduction Video\n\n[![Yode Introduction Video](./media/demo-thumb.png)](https://www.youtube.com/watch?v=4jXGKmBrD5g)\n\nFor a more in-depth introduction to the idea of Yode, check out the\n[video of the proof of concept](https://github.com/hoschi/yode)!\n\n## GIFs\n\nNeomake error linting with correct error placement:\n\n\nhttps://user-images.githubusercontent.com/163128/155854870-0efdebf9-f1b3-41ee-948f-845c026b0b46.mp4\n\n[Watch on Youtube instead](https://youtu.be/2njtODvxJek)\n\nCode formatter changes file buffer and seditor:\n\n\nhttps://user-images.githubusercontent.com/163128/155854806-d8c8d006-96e2-4c8f-a23c-5ba1f18fd692.mp4\n\n[Watch on Youtube instead](https://youtu.be/tJn28q0FRrw)\n\n\n`Gread` to restore file with git:\n\n\nhttps://user-images.githubusercontent.com/163128/155854880-a538f9c0-752c-4098-a6fd-c81f204fdb0c.mp4\n\n[Watch on Youtube instead](https://youtu.be/GiHhVtWs9Rc)\n\n\n## Features \u0026 Commands\n\n* `YodeCreateSeditorFloating` focus on a code part and make it floating, stay\n  at the current (main) view\n* `YodeCreateSeditorReplace` focus on a code part and replace it with the\n  current buffer\n* `YodeBufferDelete` delete the current buffer and jump back to file, if it is\n  a seditor\n* `YodeGoToAlternateBuffer` Yode-Nvim creates buffer local mappings for these\n  commands, see `lua/yode-nvim/createSeditor.lua` for all mappings\n* `YodeCloneCurrentIntoFloat` clone seditor into float\n* `YodeFloatToMainWindow` is the opposite\n* `YodeFormatWrite` formats and writes a buffer, no matter which type\n* `YodeRunInFile` can run a command in the current file or the file buffer of\n  the current seditor\n* changes from outside are tried to be applied as good as possible. If this\n  does not work so well, seditors can change the size \n* in general there are different layouts for the floating windows, but at the\n  moment there is only one\n* jump between windows by using `\u003cC-W\u003ew` or have a deeper look at \n  [window movement](https://neovim.io/doc/user/windows.html#window-move-cursor)\n* see the next section for more details\n\n## Installation\n\nYou need at least Neovim 0.6. Add Plenary and Yode-Nvim to your config, e.g.\nwith\n[vim-plug](https://github.com/junegunn/vim-plug):\n\n```viml\nPlug 'nvim-lua/plenary.nvim'\nPlug 'hoschi/yode-nvim'\n```\n\nImportant is that this repo is cloned with submodules, which happens automatically\nwhen you use vim-plug. The minimal setup is this:\n\n```viml\nlua require('yode-nvim').setup({})\n```\n\nCheck out the help section for a more sophisticated configuration.\n\n## Interim Help\n\n**TODO** move this to Vim help syntax `./doc/yode-nvim.txt`.\n[kdheepak/panvimdoc: Write documentation in pandoc markdown. Generate documentation in vimdoc.](https://github.com/kdheepak/panvimdoc)\n\n* install\n    * use your favorite plugin manager, important is to include the git submodules\n    * clone with submodules: `git clone --recurse-submodules git@github.com:hoschi/yode-nvim.git`\n* log is written to cache dir of `stdpaths`\n    * the default level is 'warn', but can be configured. Level can also be\n      overwritten with an environment variable, see the Development section for\n      more info.\n    * TODO link here how to echo this dir\n    * e.g. `~/myuser/.cache/nvim/yode-nvim.log`\n* example setup:\n\n```viml\nlua require('yode-nvim').setup({})\nmap \u003cLeader\u003eyc      :YodeCreateSeditorFloating\u003cCR\u003e\nmap \u003cLeader\u003eyr :YodeCreateSeditorReplace\u003cCR\u003e\nnmap \u003cLeader\u003ebd :YodeBufferDelete\u003ccr\u003e\nimap \u003cLeader\u003ebd \u003cesc\u003e:YodeBufferDelete\u003ccr\u003e\n\" these commands fall back to overwritten keys when cursor is in split window\nmap \u003cC-W\u003er :YodeLayoutShiftWinDown\u003cCR\u003e\nmap \u003cC-W\u003eR :YodeLayoutShiftWinUp\u003cCR\u003e\nmap \u003cC-W\u003eJ :YodeLayoutShiftWinBottom\u003cCR\u003e\nmap \u003cC-W\u003eK :YodeLayoutShiftWinTop\u003cCR\u003e\n\" at the moment this is needed to have no gap for floating windows\nset showtabline=2\n```\n\n* compatible plugins with current change detection logic\n    * [tpope/vim-fugitive: fugitive.vim: A Git wrapper so awesome, it should be illegal](https://github.com/tpope/vim-fugitive)\n        * `Gread` works by using one or two change events\n* `YodeRunInFile` works only with synchronous commands, e.g. `Gread`. Not with\n  async commands like `FormatWrite`\n* adapted plugins\n    * [mhartington/formatter.nvim](https://github.com/mhartington/formatter.nvim)\n        * uses `nvim_buf_set_lines` for one `change/add` event, but is async\n        * [adapted version to install](https://github.com/hoschi/formatter.nvim)\n    * [neomake/neomake: Asynchronous linting and make framework for Neovim/Vim](https://github.com/neomake/neomake)\n        * uses API methods of `api.lua` to be aware of file vs seditor buffers\n        * [adapted version to install](https://github.com/hoschi/neomake)\n* overlapping/nested seditors are not supported at the moment\n    * see TODO statements in `onSeditorBufferLines`\n    * other parts of code as well, probably not documented\n\n## Contribution\n\nIntegration with the LSP client to be able to use all the features in seditors\nas well is definitely one of my top priorities. Contributions that improve the\ncollaboration with the rest of the NeoVim universe would help a lot. The\nintegration of Neomake and Formatter.nvim can be taken as examples. Other\nplugins may be easier to integrate, check this ticket:\n[Collection of tips to get Yode-Nvim working with other plugins](https://github.com/hoschi/yode-nvim/issues/2)\n\n## Development\n\n* [Lamda module help](https://moriyalb.github.io/lamda/)\n* start Neovim with `DEBUG_YODE='debug' nvim` to set log level\n    * TODO link to modes\n    * \"trace\" shows state changes as well\n* see log file:\n    * `tail -f ~/.cache/nvim/yode-nvim.log | grep -v \"^\\[\"`\n    * last part removes the file name lines\n* format files\n    * install `stylua`\n    * `make format`\n* lint files\n    * install `luacheck`\n    * `make lint`\n* see `local.vimrc` for enhancements\n    * rename to `.local.vimrc` to use it\n    * [install nvim plugin for it](https://github.com/thinca/vim-localrc)\n    * start Neovim with `YODE=true DEBUG_YODE='debug' nvim` to enable special parts for testing\n* install local Lua\n    * install [Hererocks](https://github.com/mpeterv/hererocks)\n    * setup environment with `hererocks env -l5.1 -rlatest`\n    * source environment with `source env/bin/activate`\n    * install packages you want to use in REPL, e.g. `luarocks install inspect`\n* REPL\n    * source environment as showed above\n    * `cd lua` to go into the same path Neovim saves Lua files\n    * start a REPL with `lua`\n    * require installed luarocks packages, e.g. `inspect = require('inspect')`\n    * require local deps by copy/paste from source, e.g. `R = require('yode-nvim.deps.lamda.dist.lamda')`\n    * require source code, e.g. `h = require('yode-nvim.helper')`\n    * play with the code which works, everything using `vim.XYZ` will fail\n* test JS development\n    * `npm ci` to install dependencies\n    * now you can setup Neomake for the JS files in `testData/`\n* run tests:\n    * running tests requires\n      [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) to be checked\n      out in the parent directory of *this* repository\n    * run all tests: `make test`\n    * run single test: `nvim --headless -c \"PlenaryBustedDirectory lua/yode-nvim/tests/e2e/seditor_to_file_editor_sync_spec.lua {minimal_init = 'lua/yode-nvim/tests/minimal.vim'}\"`\n    * [more infos, see Plenary docs here](https://github.com/nvim-lua/plenary.nvim#plenarytest_harness)\n    * run all tests on file changes `nodemon -e lua,vim --exec 'make test'`\n    * run single test on file changes `nodemon -e lua,vim --exec \"nvim --headless -c \\\"PlenaryBustedDirectory lua/yode-nvim/tests/e2e/basic_mosaic_layout_spec.lua {minimal_init = 'lua/yode-nvim/tests/minimal.vim'}\\\" \"`\n    * run single test file and log `DEBUG_YODE='trace' nvim --headless -c \"PlenaryBustedDirectory lua/yode-nvim/tests/e2e/recover_seditor_with_undo_spec.lua {minimal_init = 'lua/yode-nvim/tests/minimal.vim'}\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoschi%2Fyode-nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoschi%2Fyode-nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoschi%2Fyode-nvim/lists"}