https://github.com/chrisgrieser/nvim-genghis
Lightweight and quick file operations without being a full-blown file manager.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: researchgate.net -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Lightweight and quick file operations without being a full-blown file manager.
Basic Info
Statistics
- Stars: 212
- Watchers: 3
- Forks: 12
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
nvim-genghis ⚔️
Lightweight and quick file operations without being a full-blown file manager. For when you prefer a fuzzy finder over a file tree, but still want some convenient file operations inside nvim.
Table of contents
Features
Commands - Perform common file operations: moving, renaming, creating, deleting, or duplicating files. - Copy the path or name of the current file in various formats. - Navigate to the next or previous file in the current folder.
Quality-of-life
- All movement and renaming commands update import statements to the
renamed file (if the LSP supports workspace/willRenameFiles).
- Automatically keep the extension when no extension is given.
- Use vim motions in the input field.
Installation
Requirements
- nvim 0.10+
- A vim.ui.input provider such as
dressing.nvim or
snacks.nvim for an input UI that
supports vim motions and looks much nicer.
- For the trash command: an OS-specific trash CLI like trash or gio trash.
(Since macOS 14+, there is a trash cli already built-in, so there is no need
to install anything.)
```lua -- lazy.nvim { "chrisgrieser/nvim-genghis" }
-- packer use { "chrisgrieser/nvim-genghis" } ```
Configuration
The setup call is required for lazy.nvim, but otherwise optional.
```lua -- default config require("genghis").setup { trashCmd = function() ---@type fun(): string|string[] if jit.os == "OSX" then return "trash" end -- builtin since macOS 14 if jit.os == "Windows" then return "trash" end if jit.os == "Linux" then return { "gio", "trash" } end return "trash-cli" end,
fileOperations = {
-- automatically keep the extension when no file extension is given
-- (everything after the first non-leading dot is treated as the extension)
autoAddExt = true,
},
navigation = {
onlySameExtAsCurrentFile = false,
ignoreDotfiles = true,
ignoreExt = { "png", "svg", "webp", "jpg", "jpeg", "gif", "pdf", "zip" },
ignoreFilesWithName = { ".DS_Store" },
},
successNotifications = true,
icons = { -- set an icon to empty string to disable it
chmodx = "",
copyFile = "",
copyPath = "",
duplicate = "",
file = "",
move = "",
new = "",
nextFile = "",
prevFile = "",
rename = "",
trash = "",
},
} ```
Usage
You can access a command as lua function:
lua
require("genghis").createNewFile()
Or you can use the ex command :Genghis with the respective sub-command:
vim
:Genghis createNewFile
File operations
createNewFile: Create a new file.duplicateFile: Duplicate the current file.moveSelectionToNewFile: Prompts for a new filename and moves the current selection to that new file. (Visual Line command, the selection is moved linewise.)renameFile: Rename the current file.moveAndRenameFile: Move and Rename the current file. Keeps the old name if the new path ends with/. Works like the Unixmvcommand.moveToFolderInCwd: Move the current file to an existing folder in the current working directory.chmodx: Makes current file executable. Equivalent tochmod +x.trashFile: Move the current file to the trash. Defaults togio trashon Linux, andtrashon macOS or Windows. (The trash CLIs must usually be installed.)showInSystemExplorer: Reveals the current file in the system explorer, such as macOS Finder. (Currently only on macOS, PRs welcome.)
The following applies to all commands above:
1. If no extension has been provided, uses the extension of the original file.
(Everything after the first non-leading dot is treated as the extension; this
behavior can be disabled with the config fileOperations.autoAddExt = false.)
2. If the new filename includes a /, the new file is placed in the respective
subdirectory, creating any non-existing intermediate folders.
3. All movement and renaming commands update import statements to the renamed
file (if the LSP supports workspace/willRenameFiles).
Copy operations
copyFilename: Copy the filename.copyFilepath: Copy the absolute filepath.copyFilepathWithTilde: Copy the absolute filepath, replacing the home directory with~.copyRelativePath: Copy the relative filepath.copyDirectoryPath: Copy the absolute directory path.copyRelativeDirectoryPath: Copy the relative directory path.copyFileItself: Copies the file itself. This means you can paste it into the browser or file manager. (Currently only on macOS, PRs welcome.)
All commands use the system clipboard.
File navigation
.navigateToFileInFolder("next"|"prev"): Move to the next/previous file in the
current folder of the current file, in alphabetical order.
- If snacks.nvim is installed, displays a cycling notification.
Why the name "Genghis"?
A nod to vim.eunuch, an older vimscript plugin with a similar goal. As opposed to childless eunuchs, it is said that Genghis Khan has fathered thousands of children.
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.
Owner
- Name: Chris Grieser
- Login: chrisgrieser
- Kind: user
- Location: Berlin, Germany
- Company: Technical University of Berlin
- Website: https://chris-grieser.de/
- Repositories: 189
- Profile: https://github.com/chrisgrieser
Researcher in sociology & software developer
GitHub Events
Total
- Issues event: 11
- Watch event: 11
- Delete event: 5
- Issue comment event: 16
- Push event: 99
- Pull request event: 10
- Fork event: 1
- Create event: 5
Last Year
- Issues event: 11
- Watch event: 11
- Delete event: 5
- Issue comment event: 16
- Push event: 99
- Pull request event: 10
- Fork event: 1
- Create event: 5
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Chris Grieser | 7****r | 314 |
| saccarosium | g****v@a****m | 9 |
| Steven Xu | s****u@g****m | 5 |
| Juliette Lamarche | j****e@p****z | 4 |
| Alexander Gehrke | g****b@q****e | 3 |
| Craftidore | e****t@m****m | 3 |
| dependabot[bot] | 4****] | 2 |
| Ofir Gal | o****r@g****e | 2 |
| Beau McCartney | m****l@g****m | 2 |
| Scott Zhu Reeves | 8****r@u****m | 1 |
| Filipe Kiss | h****o@f****r | 1 |
| George Mantzouranis | g****u | 1 |
| Oliver Jan Krylow | o****r@b****t | 1 |
| Ralf Schmitz Bongiolo | m****o@h****m | 1 |
| Zheng Piaodan | z****n@g****m | 1 |
| codicocodes | 7****s | 1 |
| ryankav | 3****v | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 21
- Total pull requests: 41
- Average time to close issues: 2 months
- Average time to close pull requests: about 7 hours
- Total issue authors: 20
- Total pull request authors: 15
- Average comments per issue: 2.76
- Average comments per pull request: 1.37
- Merged pull requests: 34
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 4
- Pull requests: 7
- Average time to close issues: about 16 hours
- Average time to close pull requests: about 1 hour
- Issue authors: 4
- Pull request authors: 2
- Average comments per issue: 1.25
- Average comments per pull request: 0.14
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 5
Top Authors
Issue Authors
- stevenxxiu (2)
- fritzblue (1)
- savchenko (1)
- star-szr (1)
- JanValiska (1)
- Mange (1)
- alexmozaidze (1)
- mcchrish (1)
- rodrigoaguilera (1)
- marcomayer (1)
- DeadlySquad13 (1)
- alr86 (1)
- jthvai (1)
- BeauSLM (1)
- prncss-xyz (1)
Pull Request Authors
- stevenxxiu (8)
- saccarosium (7)
- dependabot[bot] (6)
- Craftidore (3)
- ofirgall (3)
- prncss-xyz (2)
- mrbongiolo (2)
- ryankav (2)
- gemantzu (2)
- crater2150 (2)
- filipekiss (1)
- codicocodes (1)
- bugabinga (1)
- zhengpd (1)
- star-szr (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2 composite
- kdheepak/panvimdoc main composite
- stefanzweifel/git-auto-commit-action v4 composite
- amannn/action-semantic-pull-request v5 composite
- JohnnyMorganz/stylua-action v2 composite
- actions/checkout v3 composite