Neighbouring Files

approved

by fabianuntermoser

Navigate to the next and previous file in the current directory.

★ 29 stars↓ 9,520 downloadsUpdated 1mo agoMIT

Navigate to Neighbouring Files

GitHub GitHub Repo stars GitHub forks GitHub contributors GitHub closed issues GitHub closed pull requests GitHub last commit

This Obsidian plugin adds commands to quickly navigate between neighbouring files.

Installation

Install from the Obsidian community store.

Demo

Navigating with shortcuts

obsidian-neighbouring-files.webm

Navigating with the mobile floating action button

mobile-fab.mp4

Commands

  • Navigate to next/prev file (file explorer sort, alphabetical, dfs)
  • Navigate to older/newer file (creation timestamp, modification timestamp)
  • Folder up/down
  • Next/prev folder

Configuration

Sort Order

The default command uses the same sort order as the File explorer. Set a fallback in the plugin settings.

Included File Types

Markdown only by default, otherwise all file types or specific extensions.

Loop Notes in Folder

  • Disabled: navigation stops at the folder edges
  • Enabled: navigation loops back to the first / last note

Continue Across Folders

  • Disabled: navigation stays within the current folder
  • Enabled: navigation continues into adjacent folders

Mobile Navigation Button (FAB)

On mobile, a floating button appears when a note is open. Gestures:

  • Swipe left / right / up / down: run a command (defaults: left = next, right = prev, up = folder up, down = folder down)
  • Tap: run a command (default: none)
  • Double-tap: run a command (default: none)
  • Long-press: open FAB settings
  • Long-press + drag: reposition the button

Set gestures and haptics under Mobile in the settings, or by long-pressing the button.

Keybindings

Map keys with the obsidian-vimrc-support plugin, for example gn or gp.

Caveat: works only when editor mode is on.

Example .obsidian.vimrc:

" navigation to neighbouring files
exmap next_file obcommand neighbouring-files:next
exmap prev_file obcommand neighbouring-files:prev
exmap next_file_alphabetical obcommand neighbouring-files:next-alphabetical
exmap prev_file_alphabetical obcommand neighbouring-files:prev-alphabetical
exmap older_file_created obcommand neighbouring-files:older-created
exmap newer_file_created obcommand neighbouring-files:next-created
exmap older_file_modified obcommand neighbouring-files:older-modified
exmap newer_file_modified obcommand neighbouring-files:next-modified
exmap folder_up obcommand neighbouring-files:folder-up
exmap folder_down obcommand neighbouring-files:folder-down
exmap folder_next obcommand neighbouring-files:folder-next
exmap folder_prev obcommand neighbouring-files:folder-prev
nmap gn :next_file<cr>
nmap gp :prev_file<cr>
nmap fu :folder_up<cr>
nmap fd :folder_down<cr>
nmap fn :folder_next<cr>
nmap fp :folder_prev<cr>

Contributing

Open source on GitHub. Issues and PRs welcome.

Releasing

  1. make changeset, then open the pull request.
  2. Run the community branch scan: https://community.obsidian.md/account/plugins/neighbouring-files/review-branch
  3. Merge it green.
  4. make release, then push the release/<version> branch and take it through steps 1 to 3.
  5. PUBLISH_OK=1 make publish
  6. Publish the draft release on GitHub.

License

MIT License.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.