[Plugin] Workspace Nav: navigate the workspace directory tree using the keyboard

491 views
Skip to first unread message

Beau Fabry

unread,
Feb 2, 2014, 3:08:31 AM2/2/14
to light-table...@googlegroups.com
I was really missing the ability to navigate directory trees using the keyboard, like you can in NERDTree for vim. So I wrote a plugin to fix that :-)

If you install, the workspace sidebar now can grab focus and will do when you open it. There are commands to move around the directory structure, and I've provided both the obvious keymappings for those commands as well as the same mappings as NERDTree.

If you're used to NERDTree mappings then I recommend you add   ",d" ":ltexec workspace.show" to your vim mappings in user.behaviors so that ,d toggles the workspace sidebar open and closed.


Anyway, tis called Workspace Nav and should be available in the plugin manager now. https://github.com/bfabry/workspace-nav

Igor Korobov

unread,
Feb 2, 2014, 5:30:05 AM2/2/14
to light-table...@googlegroups.com
Nice! My Light Table setup becomes more keyboard friendly every day. Thank you!

Beau Fabry

unread,
Feb 3, 2014, 5:13:28 AM2/3/14
to light-table...@googlegroups.com
0.0.3 out:
  * If you use the mouse to open/close something, it switches your selection to there
  * Workspace scroll follows keyboard navigation
  * Added jump to top and jump to bottom of list. Obvious shortcuts for both vim and "normal" users provided.

Sean Corfield

unread,
Feb 3, 2014, 1:53:56 PM2/3/14
to light-table...@googlegroups.com
Very nice! Thank you!!

Sean
signature.asc

Beau Fabry

unread,
Feb 12, 2014, 3:16:58 AM2/12/14
to light-table...@googlegroups.com
0.0.4:
  * Add command to focus on open workspace, so you can navigate to an open workspace with the keyboard rather than toggling twice
  * Various cleanup and bugfixes. Seems more stable now.


On Sunday, February 2, 2014 7:08:31 PM UTC+11, Beau Fabry wrote:

Ghislain Hachey

unread,
Mar 10, 2014, 9:20:28 PM3/10/14
to light-table...@googlegroups.com

On Wednesday, February 12, 2014 4:16:58 PM UTC+8, Beau Fabry wrote:
0.0.4:
  * Add command to focus on open workspace, so you can navigate to an open workspace with the keyboard rather than toggling twice
  * Various cleanup and bugfixes. Seems more stable now.

Hi,

Thanks for this plugin, it's useful to me. I'm facing a some issues though:

* I can't get the focus to work with any of the key bindings I have tried. So I still need to toggle twice to get focus.
* When I have focus and go up and down the tree there are funny behaviors: the cursor can just disappear, the cursor can get stuck on a directory, the cursor can skip entire lists of directories, the cursor can go up and down while I keep on pressing down (or up). I have to either go end or home to get it back functional. These noticed behaviors are not random, they seem to recur on the exact same files (e.g. it will disappear or skip what exactly where it did before)

Maybe it's the way I have my key bindings? This is what I have added to my user.keymap.

:workspace.focused {"enter" [:lt.plugins.workspace-nav/open-selection]
                               "backspace" [:lt.plugins.workspace-nav/close-parent]
                               "up" [:lt.plugins.workspace-nav/navigate-north]
                               "down" [:lt.plugins.workspace-nav/navigate-south]
;; not working?!?        "ctrl-c home" [:lt.plugins.workspace-nav/focus]
                               "end" [:lt.plugins.workspace-nav/navigate-bottom]
                               "home" [:lt.plugins.workspace-nav/navigate-top]}


I'm using Workspace 0.0.4 on LT 0.6.4 in Linux Mint (based on Ubuntu 13.10). I have the latest Emacs Keybindings Behavior enabled.

Regards,

--
GH

Ghislain Hachey

unread,
Mar 10, 2014, 9:48:53 PM3/10/14
to light-table...@googlegroups.com


On Tuesday, March 11, 2014 9:20:28 AM UTC+8, Ghislain Hachey wrote:

* I can't get the focus to work with any of the key bindings I have tried. So I still need to toggle twice to get focus.
* When I have focus and go up and down the tree there are funny behaviors: the cursor can just disappear, the cursor can get stuck on a directory, the cursor can skip entire lists of directories, the cursor can go up and down while I keep on pressing down (or up). I have to either go end or home to get it back functional. These noticed behaviors are not random, they seem to recur on the exact same files (e.g. it will disappear or skip what exactly where it did before)


Hi,

I restarted LT and the second issue above seem to have disappeared completely. I still can't bind the focus command (with the open workspace) to a shortcut key though.

Thanks again for this.

--
GH

Beau Fabry

unread,
Mar 10, 2014, 10:04:53 PM3/10/14
to light-table...@googlegroups.com
The second issue is probably related to the various files/folders in your workspace changing while the session is running, there's no code yet to deal with problems caused by that and so restarting is the current workaround.

The first, you need to understand how the keybinding contexts work. The keybindings set under the "workspace.focused" tag are only active *while* the workspace is itself focused, so a binding to focus it doesn't make sense. You want to put the focus workspace binding under the :app key so it's available globally.

Ghislain Hachey

unread,
Mar 10, 2014, 11:03:49 PM3/10/14
to light-table...@googlegroups.com


On Tuesday, March 11, 2014 10:04:53 AM UTC+8, Beau Fabry wrote:
The first, you need to understand how the keybinding contexts work. The keybindings set under the "workspace.focused" tag are only active *while* the workspace is itself focused, so a binding to focus it doesn't make sense. You want to put the focus workspace binding under the :app key so it's available globally.


Ha yes, obvious now, thanks. I just started using LT and like it a lot. I got it to do most of what I was use to in Emacs in a couple of days, very cool.

--
GH

Beau Fabry

unread,
Mar 10, 2014, 11:22:09 PM3/10/14
to light-table...@googlegroups.com
Cool, glad I could help. Happy to accept PR's to fix the out-of-sync issue with the plugin btw, the code is fairly simple

Макс Муранов

unread,
Feb 2, 2017, 4:42:25 AM2/2/17
to Light Table Discussion
There's really no visual selection in this plugin or I have a bug?

Beau Fabry

unread,
Feb 2, 2017, 12:29:33 PM2/2/17
to Light Table Discussion
Probably a bug. I haven't used LT or updated the plugin in a few years. It used to have visual selection

Scott Bauer

unread,
Feb 2, 2017, 7:43:16 PM2/2/17
to Light Table Discussion
Just a heads up for everyone, but I have assumed ownership of this plugin at https://github.com/sbauer322/workspace-nav . With any luck, you should be able to expect bug fixes in the coming weeks.

Thank you for your stewardship of the plugin, Beau!

MarcusE1W

unread,
Apr 28, 2017, 7:27:25 AM4/28/17
to Light Table Discussion
Any news on this ?
I also do not get any visual feedback.
Effectively you cant see what's currently selected, but the keybord function works.

Scott Bauer

unread,
Apr 28, 2017, 8:18:26 AM4/28/17
to light-table...@googlegroups.com
Ah, sorry, it looks like I had fixed the visual selection but never made the push... ended up getting pulled away into some other problems and this fell by the wayside. I will take care of it this weekend.

--
You received this message because you are subscribed to the Google Groups "Light Table Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to light-table-discussion+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MarcusE1W

unread,
Apr 28, 2017, 2:40:10 PM4/28/17
to Light Table Discussion
Super thanks.

Excellent news
Message has been deleted

Max Muranov

unread,
May 7, 2017, 9:38:54 AM5/7/17
to Light Table Discussion
Updated plugin to 0.0.8. Many thanks for visual selection!

By the way there's a tiny bug: when I open empty folder, then go down and then go up again to this open empty folder, the plugin, it seems, try to select last item in that folder. But this folder is empty so I get an error:

Error: No protocol method IDeref.-deref defined for type null: 
    at Error (native)
    at cljs.core.missing_protocol (file:///D:/Programmas/LightTable/resources/app/core/node_modules/lighttable/bootstrap.js:1460:10)
    at cljs.core._deref (file:///D:/Programmas/LightTable/resources/app/core/node_modules/lighttable/bootstrap.js:2181:38)
    at cljs.core.deref (file:///D:/Programmas/LightTable/resources/app/core/node_modules/lighttable/bootstrap.js:12879:27)
   ...

If I close this folder with mouse, then I become able to navigate all folders again
Reply all
Reply to author
Forward
0 new messages