docs: restructuring
parent
69c7dd0282
commit
9cee6c52c8
23
README.md
23
README.md
|
|
@ -4,8 +4,11 @@ Convenience file operations for neovim, written in lua.
|
|||
<!--toc:start-->
|
||||
- [How is this different from `vim.eunuch`?](#how-is-this-different-from-vimeunuch)
|
||||
- [Installation and Setup](#installation-and-setup)
|
||||
- [Available commands](#available-commands)
|
||||
- [Autocompletion of filenames](#autocompletion-of-directories)
|
||||
- [Available Commands](#available-commands)
|
||||
- [File Operation Command](#file-operation-command)
|
||||
- [File Utility Commands](#file-utility-commands)
|
||||
- [Disable Ex-Commands](#disable-ex-commands)
|
||||
- [Autocompletion of directories](#autocompletion-of-directories)
|
||||
- [Why that name](#why-that-name)
|
||||
- [About me](#about-me)
|
||||
<!--toc:end-->
|
||||
|
|
@ -43,25 +46,27 @@ keymap("n", "<leader>df", function () genghis.trashFile{trashLocation = "your/pa
|
|||
keymap("x", "<leader>x", genghis.moveSelectionToNewFile)
|
||||
```
|
||||
|
||||
## Available commands
|
||||
## Available Commands
|
||||
|
||||
### File Operation Command
|
||||
- `.createNewFile` or `:New`: Create a new file.
|
||||
- `.duplicateFile` or `:Duplicate`: Duplicate the current file.
|
||||
- `.moveSelectionToNewFile` or `:NewFromSelection`: Prompts for a new file name and moves the current selection to that new file. (Note that this is a Visual Line Mode command; the selection is moved linewise.)
|
||||
- `.renameFile` or `:Rename`: Rename the current file.
|
||||
- `.moveAndRenameFile` or `:Move`: Move and Rename the current file. Works like the UNIX `mv` command. Best used with [autocompletion of directories](#autocompletion-of-directories).
|
||||
|
||||
> __Note__
|
||||
> The following applies to all commands above:
|
||||
> - If no extension has been provided, will use the extension of the original file.
|
||||
> - If the new file name includes a `/`, the new file is placed in the respective subdirectory, creating any non-existing folders. Except for `.moveAndRenameFile`, all operations take only place in the current working directory, so `.moveAndRenameFile` is the only command that can move to a parent directory.
|
||||
> - All commands support [autocompletion of existing directories](#autocompletion-of-directories).
|
||||
The following applies to all commands above:
|
||||
- If no extension has been provided, uses the extension of the original file.
|
||||
- If the new file name includes a `/`, the new file is placed in the respective subdirectory, creating any non-existing folders. Except for `.moveAndRenameFile`, all operations take only place in the current working directory, so `.moveAndRenameFile` is the only command that can move to a parent directory.
|
||||
- All commands support [autocompletion of existing directories](#autocompletion-of-directories).
|
||||
|
||||
### File Utility Commands
|
||||
- `.trashFile{trashLocation = "/your/path/"}` or `:Trash`: Move the current file to the trash location. [Defaults to the operating-system-specific trash directory.](https://github.com/chrisgrieser/nvim-genghis/blob/main/lua/genghis.lua#L164) ⚠️ Any existing file in the trash location with the same name is overwritten, making that file irretrievable.
|
||||
- `.copyFilename` or `:CopyFilename`: Copy the file name. When `clipboard="unnamed[plus]"` has been set, copies to the `+` register, otherwise to `"`.
|
||||
- `.copyFilepath` or `:CopyFilepath`: Copy the absolute file path. When `clipboard="unnamed[plus]"` has been set, copies to the `+` register, otherwise to `"`.
|
||||
- `.chmodx` or `:Chmodx`: Makes current file executable. Equivalent to `chmod +x`.
|
||||
|
||||
### How to disable command-line commands
|
||||
### Disable Ex-commands
|
||||
Put this in your configuration file:
|
||||
|
||||
```lua
|
||||
|
|
|
|||
Loading…
Reference in New Issue