From 01b1d297b00914e714b767d3100c8881adb1619b Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:39:54 +0200 Subject: [PATCH] docs: various updates & removal of obsolete sections --- README.md | 92 ++++++++++++------------------------------------------- 1 file changed, 20 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 51ecd10..b414f9a 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,9 @@ Lightweight and quick file operations without being a full-blown file manager. * [Utility Commands](#utility-commands) * [Path Copying Commands](#path-copying-commands) * [Disable Ex-Commands](#disable-ex-commands) -- [Cookbook](#cookbook) - * [Use Telescope for `.moveToFolderInCwd`](#use-telescope-for-movetofolderincwd) - * [Autocompletion of directories for `.moveAndRenameFile`](#autocompletion-of-directories-for-moveandrenamefile) - [How is this different from `vim.eunuch`?](#how-is-this-different-from-vimeunuch) -- [Why that name](#why-that-name) -- [About me](#about-me) +- [Why that Name](#why-that-name) +- [About the Author](#about-the-author) @@ -32,18 +29,17 @@ Lightweight and quick file operations without being a full-blown file manager. file (if the LSP supports `workspace/willRenameFiles`). - Lightweight: no file management UI or file tree. - Various quality-of-life improvements like automatically keeping the extensions - when no extension is given. -- Fully written in lua and makes use of up-to-date nvim features like - `vim.ui.input`. + when no extension is given, or the ability to use vim motions in the input + field. ## Installation and Setup ```lua --- Packer -use {"chrisgrieser/nvim-genghis", requires = "stevearc/dressing.nvim"} - --- Lazy +-- lazy.nvim {"chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.nvim"}, + +-- packer +use {"chrisgrieser/nvim-genghis", requires = "stevearc/dressing.nvim"} ``` `nvim-genghis` (and `dressing.nvim`) require no `.setup()` function. Just create @@ -51,17 +47,16 @@ keybindings for the commands you want to use: ```lua local keymap = vim.keymap.set -local genghis = require("genghis") -keymap("n", "yp", genghis.copyFilepath) -keymap("n", "yn", genghis.copyFilename) -keymap("n", "cx", genghis.chmodx) -keymap("n", "rf", genghis.renameFile) -keymap("n", "mf", genghis.moveAndRenameFile) -keymap("n", "mc", genghis.moveToFolderInCwd) -keymap("n", "nf", genghis.createNewFile) -keymap("n", "yf", genghis.duplicateFile) -keymap("n", "df", genghis.trashFile) -keymap("x", "x", genghis.moveSelectionToNewFile) +keymap("n", "yp", function() require("genghis").copyFilepath() end) +keymap("n", "yn", function() require("genghis").copyFilename() end) +keymap("n", "cx", function() require("genghis").chmodx() end) +keymap("n", "rf", function() require("genghis").renameFile() end) +keymap("n", "mf", function() require("genghis").moveAndRenameFile() end) +keymap("n", "mc", function() require("genghis").moveToFolderInCwd() end) +keymap("n", "nf", function() require("genghis").createNewFile() end) +keymap("n", "yf", function() require("genghis").duplicateFile() end) +keymap("n", "df", function() require("genghis").trashFile() end) +keymap("x", "x", function() require("genghis").moveSelectionToNewFile() end) ``` ## Available Commands @@ -124,49 +119,6 @@ vim.g.genghis_use_systemclipboard = true vim.g.genghis_disable_commands = true ``` -## Cookbook - -### Use Telescope for `.moveToFolderInCwd` - -```lua -require("dressing").setup { - select = { - backend = { "telescope" }, - }, -} -``` - -### Autocompletion of directories for `.moveAndRenameFile` -You can get autocompletion for directories by `nvim-cmp` and vim's `omnifunc`: - -```lua --- packer -use { - "chrisgrieser/nvim-genghis", - requires = { - "stevearc/dressing.nvim", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-omni", - }, -} --- lazy -{ - "chrisgrieser/nvim-genghis", - dependencies = { - "stevearc/dressing.nvim", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-omni", - }, -}, -``` - -```lua --- required setup for cmp, somewhere after your main cmp-config -require("cmp").setup.filetype("DressingInput", { - sources = cmp.config.sources { { name = "omni" } }, -}) -``` - ## How is this different from `vim.eunuch`? - Various improvements like automatically keeping the extensions when no extension is given, or moving files to the trash instead of removing them. @@ -181,25 +133,21 @@ and setup. - LSP support when renaming. - Written 100% in lua. -## Why that name +## Why that Name A nod to [vim.eunuch](https://github.com/tpope/vim-eunuch). As opposed to childless eunuchs, it is said that Genghis Khan [has fathered thousands of children](https://allthatsinteresting.com/genghis-khan-children). -## About me +## About the Author In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch. -__Blog__ I also occasionally blog about vim: [Nano Tips for Vim](https://nanotipsforvim.prose.sh) -__Profiles__ -- [Discord](https://discordapp.com/users/462774483044794368/) - [Academic Website](https://chris-grieser.de/) -- [GitHub](https://github.com/chrisgrieser/) - [Twitter](https://twitter.com/pseudo_meta) - [ResearchGate](https://www.researchgate.net/profile/Christopher-Grieser) - [LinkedIn](https://www.linkedin.com/in/christopher-grieser-ba693b17a/)