Skip to content

FabianUntermoser/obsidian-neighbouring-files-plugin

Repository files navigation

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 navigational commands that let you quickly navigate to neighbouring files in your vault.

Use Case

  • Navigate from one weekly note to another (e.g., 2023-W172023-W18)
  • Move between daily notes (e.g., 2023-04-312023-05-01)
  • Browse sequentially numbered notes (e.g., A4A5)
  • Navigate through project files in a folder
obsidian-neighbouring-files.webm

Commands

Default Commands:

  • Navigate to next file
  • Navigate to prev file

Commands:

  • Navigate to next file (alphabetical)
  • Navigate to prev file (alphabetical)
  • Navigate to older file (creation timestamp)
  • Navigate to newer file (creation timestamp)
  • Navigate to older file (modified timestamp)
  • Navigate to newer file (modified timestamp)

Supported Sorting Modes:

  • Alphabetical: Ordered by file names.
  • By Modification Timestamp: Based on the file modification date.
  • By Creation Timestamp: Based on the file creation date.

Configuration

Default Sort Order

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

Included File Types

By default, navigation is restricted to markdown files. In the settings you can enable support for other file types:

  • Limit to Markdown files only
  • Include all file types
  • Specify additional file extensions to include

Loop Notes in Folder

  • When disabled: Navigation stops at the beginning/end of a folder
  • When enabled: Navigation loops back to the start/end when reaching the end/beginning

Configure VIMRC keybindings

Instead of configuring obsidian hotkeys to trigger the navigation commands, you can also use the obsidian-vimrc-support plugin to map more useful hotkeys such as gn or gp (Caveat: This only works when the editor mode is on).

Example .obsidian.vimrc.

" define navigation commands
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:newer-created
exmap older_file_modified    obcommand neighbouring-files:older-modified
exmap newer_file_modified    obcommand neighbouring-files:newer-modified
" add navigation mappings
nmap gn :next_file<cr>
nmap gp :prev_file<cr>

License

This project is licensed under MIT License.

About

Obsidian Plugin to navigate to the next and previous file in the current directory

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •