https://github.com/chrisgrieser/finder-vim-mode

Feature-rich control of macOS Finder without the mouse, inspired by vim and ranger.

https://github.com/chrisgrieser/finder-vim-mode

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 (11.7%) to scientific vocabulary

Keywords

complex-modification finder-extension karabiner-elements macos-finder macos-finder-extension vim-emulation vim-emulator vim-mode

Keywords from Contributors

archival projection interactive alfred-workflow generic sequences pdf-summarization reference-management text-object process-management
Last synced: 10 months ago · JSON representation

Repository

Feature-rich control of macOS Finder without the mouse, inspired by vim and ranger.

Basic Info
  • Host: GitHub
  • Owner: chrisgrieser
  • License: mit
  • Language: Shell
  • Default Branch: main
  • Homepage:
  • Size: 11 MB
Statistics
  • Stars: 107
  • Watchers: 1
  • Forks: 3
  • Open Issues: 1
  • Releases: 13
Topics
complex-modification finder-extension karabiner-elements macos-finder macos-finder-extension vim-emulation vim-emulator vim-mode
Created over 3 years ago · Last pushed 11 months ago
Metadata Files
Readme Funding License

README.md

Vim Mode for Finder

Feature-rich control of macOS Finder without the mouse, inspired by vim and ranger.

Last commit shield

Finder vim cheatsheet

Usage examples

  • wl: Duplicate selected file and open the copy.
  • axq: Select all files, move them to the other window, close current window.
  • .f.d.: Show hidden files, select first hidden file, delete it, hide dotfiles again.
  • AM: Select files (but not folders), create a new directory, move selected files into that directory, and start renaming the directory (enters insert mode).
  • azmhp: Select all files and folders, zip them (and wait for zipping to finish), and move the archive one directory up

Table of contents

Usage

  • Only works in Finder's List View.
  • :help Press ? in Finder to display the cheatsheet above. Generally, everything in brackets only applies to the uppercase version of the key.
  • Move: m marks the current selection as "to be moved." The next paste-operation p moves the files. A move can be aborted via esc.
  • Cross-move: If you have exactly two Finder windows open, x moves the selection to the other window, and X copies the selection to the other window.
  • Context-menu: Can be opened with c and navigated via hjkl. Press esc, q, or c to close the context-menu.
  • Find mode is triggered via f, works similar to f in vim, expecting another character afterward. For example, fh jumps to the next file that starts with the letter h.
  • Toggle -bkp suffix: Add suffix -bkp to the file. If it already has such a suffix, remove it. Useful for debugging as well.
  • Tab goes to the next file in alphabetical order, even when the view is not sorted alphabetically. (This is actually a built-in feature of Finder, but worth mentioning since barely anyone knows about it.)
  • Copy/Paste file content: Y copies the content of the selected file, while P pastes text from the clipboard into the selected file (appending).

[!NOTE] Pressing return in a prompt window, for example when replacing a file, mistakenly puts you in Insert Mode. Unfortunately, Karabiner is not able to detect whether the front window is a regular Finder window or a prompt. The workaround is to either press esc to go back to Normal Mode, or to use tab and then space to select the correct action in the prompt window.

Installation

This plugin requires you to have English as your System UI language. (You can set the language via: System Settings → General → Language & Region → Preferred Languages)

  1. Run this in your terminal:

    ```bash brew install karabiner-elements # Install Karabiner (if not already installed)

    worktree="https://raw.githubusercontent.com/chrisgrieser/finder-vim-mode/main" open "karabiner://karabiner/assets/complex_modifications/import?url=$worktree/finder-vim.json" curl -sL "$worktree/extras/cheatsheet.png" --create-dirs --output "$HOME/.config/karabiner/assets/finder-vim-mode/cheatsheet.png" curl -sL "$worktree/extras/notificator" --create-dirs --output "$HOME/.config/karabiner/assets/finder-vim-mode/notificator"

    set default view to "List"

    defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"

    optional: disable desktop icons & make desktop unfocussable

    defaults write com.apple.finder CreateDesktop false

    restart Finder for changes to take effect

    killall Finder ```

  2. Activate the plugin: ImportEnable

  3. Karabiner users: If you already use Karabiner and have another modification affecting the Capslock key, the other modification must come below the Finder Vim Mode in the list of modifications. (Karabiner prioritizes modifications further on top of the list.) <!-- LTeX: enabled=false -->

  4. Alfred users: In the Appearance Options, you need to set the Focusing behavior to Compatibility Mode for Karabiner to detect Alfred being active. <!-- LTeX: enabled=true -->

  5. Spotlight users: You need to install the Spotlight add-on. The add-on has to be above the Finder Vim Mode in Karabiner's list of modifications.

    ```bash

    install Spotlight addon

    open "karabiner://karabiner/assets/complex_modifications/import?url=https://raw.githubusercontent.com/chrisgrieser/finder-vim-mode/main/addons/finder-vim-spotlight-addon.json" ```

Updates

Unfortunately, Karabiner has no mechanism for auto-updating plugins. Therefore, you have to install updates manually by re-running the code above. You can check the last commit date to see whether there has been an update:

Last commit shield

Caveats

Since Karabiner plugins are only hotkey re-mappings without proper scripting mechanisms, this plugin has some limitations: - Only List view is supported. - If you use the mouse to click buttons, you can end up in the wrong mode. In that case, you can press esc to get back to Normal Mode. - File selection dialogues from other apps (for example to upload a file in the browser) are not supported. - Unfortunately, it is not possible to have a vimrc or to let the user configure the keybindings themselves in any way, at least not with a Karabiner plugin. If you want to rebind keys, you have to change the respective key manually in the JSON file. - If you have set custom keybindings for Finder, they can potentially interfere. It is therefore recommended to unset them. - The plugin has been tested with the US and German keyboard layout. It should mostly also work for other layouts.

Build

Karabiner plugins are essentially hotkey configurations in form of a JSON file. The amount of configurations for this plugin is rather large; the resulting JSON file is ~8000 lines of code. To make that ankommt manageable, this plugin is written in YAML where features such as anchors and aliases reduce the lines of code to ~1300.

If you want to fork this plugin, it is recommended to work with the YAML file and "compile" it to the JSON required by Karabiner. You can do so with yq:

```bash

explode() is required to resolve the anchors and aliases

yq --output-format=json 'explode(.)' finder-vim.yaml > finder-vim.json ```

Credits

About the developer

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.

Buy Me a Coffee at ko-fi.com

Owner

  • Name: Chris Grieser
  • Login: chrisgrieser
  • Kind: user
  • Location: Berlin, Germany
  • Company: Technical University of Berlin

Researcher in sociology & software developer

GitHub Events

Total
  • Issues event: 3
  • Watch event: 20
  • Delete event: 4
  • Issue comment event: 5
  • Push event: 31
  • Pull request event: 8
  • Fork event: 1
  • Create event: 4
Last Year
  • Issues event: 3
  • Watch event: 20
  • Delete event: 4
  • Issue comment event: 5
  • Push event: 31
  • Pull request event: 8
  • Fork event: 1
  • Create event: 4

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 208
  • Total Committers: 2
  • Avg Commits per committer: 104.0
  • Development Distribution Score (DDS): 0.014
Past Year
  • Commits: 38
  • Committers: 2
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.079
Top Committers
Name Email Commits
pseudometa 7****r 205
dependabot[bot] 4****] 3

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 5
  • Total pull requests: 2
  • Average time to close issues: 3 days
  • Average time to close pull requests: 37 minutes
  • Total issue authors: 5
  • Total pull request authors: 1
  • Average comments per issue: 2.8
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: about 3 hours
  • Average time to close pull requests: 37 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 4.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • deferred (1)
  • jdrupal-dev (1)
  • jonch070 (1)
  • ryanwwest (1)
  • chrisgrieser (1)
  • bassamsdata (1)
Pull Request Authors
  • dependabot[bot] (5)
Top Labels
Issue Labels
bug (2) enhancement (1) help wanted (1)
Pull Request Labels
dependencies (5) github_actions (1)

Dependencies

.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • actions/create-release v1 composite
  • actions/upload-release-asset v1 composite