• Stars
    star
    506
  • Rank 87,236 (Top 2 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created about 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sidebar for Emacs leveraging Dired

Dired Sidebar

https://travis-ci.org/jojojames/dired-sidebar.svg?branch=master https://melpa.org/packages/dired-sidebar-badge.svg https://stable.melpa.org/packages/dired-sidebar-badge.svg

Screenshots

With VsCode Icons & Spacemacs Light ./screenshots/vscode.png

With All the Icons & Solarized Light ./screenshots/one.png

With Arrows & Seoul-256 ./screenshots/arrows.png

With Text UI & Doom Peacock ./screenshots/tui.png

Installation

Melpa

I recommend using use-package.

(use-package dired-sidebar
  :ensure t
  :commands (dired-sidebar-toggle-sidebar))

Minimal Bootstrap using Git

git clone https://github.com/jojojames/dired-sidebar
cd dired-sidebar
pwd # [Put this in load path.]

git clone https://github.com/Fuco1/dired-hacks
cd dired-hacks
pwd # [Put this in load path.]

Add config to Emacs:

(add-to-list 'load-path "path from pwd")
(require 'dired-sidebar)
M-x dired-sidebar-toggle-sidebar

My Settings

(use-package dired-sidebar
  :bind (("C-x C-n" . dired-sidebar-toggle-sidebar))
  :ensure t
  :commands (dired-sidebar-toggle-sidebar)
  :init
  (add-hook 'dired-sidebar-mode-hook
            (lambda ()
              (unless (file-remote-p default-directory)
                (auto-revert-mode))))
  :config
  (push 'toggle-window-split dired-sidebar-toggle-hidden-commands)
  (push 'rotate-windows dired-sidebar-toggle-hidden-commands)

  (setq dired-sidebar-subtree-line-prefix "__")
  (setq dired-sidebar-theme 'vscode)
  (setq dired-sidebar-use-term-integration t)
  (setq dired-sidebar-use-custom-font t))

For configuration, I recommend looking at the defcustoms in dired-sidebar.el.

Sidebar can also be toggled together with ibuffer-sidebar.

(defun sidebar-toggle ()
  "Toggle both `dired-sidebar' and `ibuffer-sidebar'."
  (interactive)
  (dired-sidebar-toggle-sidebar)
  (ibuffer-sidebar-toggle-sidebar))

Features

Dired

As a result of using dired as a base, many features and functionality already exist in a polished state with standard keybindings an Emacs user will already be familiar with. Because of this dired-sidebar’s codebase can stay small and lean, serving as the glue to several different packages.

Fast

Having used the alternatives listed below, in my opinion, dired-sidebar is the fastest of the bunch.

Trying to open and navigate in emacs/src/lisp (or another directory I’ve forgotten) led to writing my own sidebar as I was not satisfied with the speed of the other drawers.

Multiple Frames

Sidebar may be used in multiple frames with each frame having its own sidebar state.

File Following

Sidebar can be periodically set to refresh to reflect the currently selected file.

When Sidebar is initially opened, folders will be automatically expanded to point to the current file.

Mouse Support

Close/expand folders and open files with left click.

Session Persistence

Leverages dired’s desktop-save-mode support for persistence.

Projectile

Integrated with projectile.

Sidebar opens up with projectile’s root as sidebar’s root. Sidebar will also automatically update its root when projectile changes root.

Dired Subtree

Integrated with dired-subtree.

Close and expand folders with dired-subtree.

Ace Window

Integrated with ace-window.

Select the window files are to be opened in.

File Watching / Automatic Refresh

dired-sidebar will automatically update to reflect file changes as well as after a few special commands.

Take a look at dired-sidebar-refresh-on-special-commands and dired-sidebar-special-refresh-commands for more configuration.

All The Icons

Uses all-the-icons for icons.

Terminal Support

Icons will be replaced with “+” and “-” to indicate folder nesting in terminals.

Evil

Keys are bound for evil.

Magit

Integrated with magit.

Toggling the sidebar in magit sets sidebar’s root at magit’s directory. If point was on a file in magit, point at the file upon opening dired-sidebar.

IBuffer

dired-sidebar will open sidebar and point at buffer’s file.

Dependencies

Only dired-subtree is required. The other integrations are optional and dynamically detected.

Alternatives

https://github.com/Alexander-Miller/treemacs

https://github.com/jaypei/emacs-neotree

https://github.com/sabof/project-explorer

Running Tests

cask
make compile
make lint
make test

Help Wanted

Look at issues page! :)

More Repositories

1

fussy

Emacs completion-style leveraging flx
Emacs Lisp
128
star
2

smart-jump

Emacs Lisp
121
star
3

ibuffer-sidebar

A sidebar for IBuffer
Emacs Lisp
69
star
4

vscode-icon-emacs

Utility package that return vscode icons for emacs
Emacs Lisp
48
star
5

matcha

Collection of transients with a generic interface to launch them
Emacs Lisp
45
star
6

PhxSocketCPP

A C++ library to communicate with Phoenix Channels
C++
12
star
7

flycheck-swiftlint

Flycheck extension for swiftlint
Emacs Lisp
12
star
8

gud-lldb

LLDB Frontend for Gud
Emacs Lisp
11
star
9

flycheck-jest

Flycheck extenstion for jest
Emacs Lisp
10
star
10

flymake-racket

Flymake extension for Racket
Emacs Lisp
9
star
11

media-thumbnail

Emacs thumbnails for media
Emacs Lisp
9
star
12

evil-integrations

Provides a sane set of defaults for use with Evil Mode.
7
star
13

flycheck-gradle

Flycheck extension for projects that use gradle
Emacs Lisp
6
star
14

foo_tunes

Utility to maintain libraries in foobar2000 & itunes
Python
4
star
15

flycheck-xcode

Flycheck extension for Xcode
Emacs Lisp
3
star
16

flymake-gradle

Flymake extension for gradle
Emacs Lisp
3
star
17

flymake-ktlint

Flymake extension for ktlint
Emacs Lisp
2
star
18

Objective-C

Learning Objective-C
C
2
star
19

.zsh

Shell
1
star
20

point_of_sales_restaurant_app

iOS Restaurant Management Application
C
1
star
21

fruity-theme

A port of Fruity Theme in Vim https://github.com/mitsuhiko/fruity-vim-colorscheme
Emacs Lisp
1
star
22

xamarin-okhttp-okio-binding

A binding of Square's Okio project for Xamarin/C#
C#
1
star
23

Xamarin-AndroidAsync-Binding

C# binding for https://github.com/koush/AndroidAsync, adapted from https://github.com/thefactory/AndroidAsync-Sharp
C#
1
star
24

.dotfiles

Emacs Lisp
1
star