docs: various updates & removal of obsolete sections

remotes/origin/HEAD
Chris Grieser 2024-06-19 12:39:54 +02:00
parent 7055134943
commit 01b1d297b0
1 changed files with 20 additions and 72 deletions

View File

@ -15,12 +15,9 @@ Lightweight and quick file operations without being a full-blown file manager.
* [Utility Commands](#utility-commands) * [Utility Commands](#utility-commands)
* [Path Copying Commands](#path-copying-commands) * [Path Copying Commands](#path-copying-commands)
* [Disable Ex-Commands](#disable-ex-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) - [How is this different from `vim.eunuch`?](#how-is-this-different-from-vimeunuch)
- [Why that name](#why-that-name) - [Why that Name](#why-that-name)
- [About me](#about-me) - [About the Author](#about-the-author)
<!-- tocstop --> <!-- tocstop -->
@ -32,18 +29,17 @@ Lightweight and quick file operations without being a full-blown file manager.
file (if the LSP supports `workspace/willRenameFiles`). file (if the LSP supports `workspace/willRenameFiles`).
- Lightweight: no file management UI or file tree. - Lightweight: no file management UI or file tree.
- Various quality-of-life improvements like automatically keeping the extensions - Various quality-of-life improvements like automatically keeping the extensions
when no extension is given. when no extension is given, or the ability to use vim motions in the input
- Fully written in lua and makes use of up-to-date nvim features like field.
`vim.ui.input`.
## Installation and Setup ## Installation and Setup
```lua ```lua
-- Packer -- lazy.nvim
use {"chrisgrieser/nvim-genghis", requires = "stevearc/dressing.nvim"}
-- Lazy
{"chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.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 `nvim-genghis` (and `dressing.nvim`) require no `.setup()` function. Just create
@ -51,17 +47,16 @@ keybindings for the commands you want to use:
```lua ```lua
local keymap = vim.keymap.set local keymap = vim.keymap.set
local genghis = require("genghis") keymap("n", "<leader>yp", function() require("genghis").copyFilepath() end)
keymap("n", "<leader>yp", genghis.copyFilepath) keymap("n", "<leader>yn", function() require("genghis").copyFilename() end)
keymap("n", "<leader>yn", genghis.copyFilename) keymap("n", "<leader>cx", function() require("genghis").chmodx() end)
keymap("n", "<leader>cx", genghis.chmodx) keymap("n", "<leader>rf", function() require("genghis").renameFile() end)
keymap("n", "<leader>rf", genghis.renameFile) keymap("n", "<leader>mf", function() require("genghis").moveAndRenameFile() end)
keymap("n", "<leader>mf", genghis.moveAndRenameFile) keymap("n", "<leader>mc", function() require("genghis").moveToFolderInCwd() end)
keymap("n", "<leader>mc", genghis.moveToFolderInCwd) keymap("n", "<leader>nf", function() require("genghis").createNewFile() end)
keymap("n", "<leader>nf", genghis.createNewFile) keymap("n", "<leader>yf", function() require("genghis").duplicateFile() end)
keymap("n", "<leader>yf", genghis.duplicateFile) keymap("n", "<leader>df", function() require("genghis").trashFile() end)
keymap("n", "<leader>df", genghis.trashFile) keymap("x", "<leader>x", function() require("genghis").moveSelectionToNewFile() end)
keymap("x", "<leader>x", genghis.moveSelectionToNewFile)
``` ```
## Available Commands ## Available Commands
@ -124,49 +119,6 @@ vim.g.genghis_use_systemclipboard = true
vim.g.genghis_disable_commands = 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`? ## How is this different from `vim.eunuch`?
- Various improvements like automatically keeping the extensions when no - Various improvements like automatically keeping the extensions when no
extension is given, or moving files to the trash instead of removing them. extension is given, or moving files to the trash instead of removing them.
@ -181,25 +133,21 @@ and setup.
- LSP support when renaming. - LSP support when renaming.
- Written 100% in lua. - Written 100% in lua.
## Why that name ## Why that Name
A nod to [vim.eunuch](https://github.com/tpope/vim-eunuch). As opposed to 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 childless eunuchs, it is said that Genghis Khan [has fathered thousands of
children](https://allthatsinteresting.com/genghis-khan-children). children](https://allthatsinteresting.com/genghis-khan-children).
<!-- vale Google.FirstPerson = NO --> <!-- vale Google.FirstPerson = NO -->
## About me ## About the Author
In my day job, I am a sociologist studying the social mechanisms underlying the 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 digital economy. For my PhD project, I investigate the governance of the app
economy and how software ecosystems manage the tension between innovation and 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. 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) 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/) - [Academic Website](https://chris-grieser.de/)
- [GitHub](https://github.com/chrisgrieser/)
- [Twitter](https://twitter.com/pseudo_meta) - [Twitter](https://twitter.com/pseudo_meta)
- [ResearchGate](https://www.researchgate.net/profile/Christopher-Grieser) - [ResearchGate](https://www.researchgate.net/profile/Christopher-Grieser)
- [LinkedIn](https://www.linkedin.com/in/christopher-grieser-ba693b17a/) - [LinkedIn](https://www.linkedin.com/in/christopher-grieser-ba693b17a/)