Skip to content

Commit

Permalink
Merge pull request #61 from ddavison/fix-60
Browse files Browse the repository at this point in the history
adding new setting 🍀
  • Loading branch information
ddavison committed Feb 17, 2015
2 parents 3d38208 + 913c81b commit a141893
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 2,090 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,21 @@ node_modules
*.iml
.idea/
spec/fixtures/sample.txt
# Created by https://www.gitignore.io

### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
*.sublime-project

# sftp configuration file
sftp-config.json

45 changes: 42 additions & 3 deletions keymaps/sublime-tabs.cson
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,59 @@
'cmd-c': 'tree-view:copy'
'cmd-x': 'tree-view:cut'
'cmd-v': 'tree-view:paste'
'ctrl-f': 'tree-view:expand-directory'
'ctrl-b': 'tree-view:collapse-directory'
'cmd-k right': 'tree-view:open-selected-entry-right'
'cmd-k l': 'tree-view:open-selected-entry-right'
'cmd-k left': 'tree-view:open-selected-entry-left'
'cmd-k h': 'tree-view:open-selected-entry-left'
'cmd-k up': 'tree-view:open-selected-entry-up'
'cmd-k k': 'tree-view:open-selected-entry-up'
'cmd-k down': 'tree-view:open-selected-entry-down'
'cmd-k j': 'tree-view:open-selected-entry-down'
'cmd-1': 'tree-view:open-selected-entry-in-pane-1'
'cmd-2': 'tree-view:open-selected-entry-in-pane-2'
'cmd-3': 'tree-view:open-selected-entry-in-pane-3'
'cmd-4': 'tree-view:open-selected-entry-in-pane-4'
'cmd-5': 'tree-view:open-selected-entry-in-pane-5'
'cmd-6': 'tree-view:open-selected-entry-in-pane-6'
'cmd-7': 'tree-view:open-selected-entry-in-pane-7'
'cmd-8': 'tree-view:open-selected-entry-in-pane-8'
'cmd-9': 'tree-view:open-selected-entry-in-pane-9'

'.platform-win32 .tree-view, .platform-linux .tree-view':
'ctrl-c': 'tree-view:copy'
'ctrl-x': 'tree-view:cut'
'ctrl-v': 'tree-view:paste'
'ctrl-k right': 'tree-view:open-selected-entry-right'
'ctrl-k l': 'tree-view:open-selected-entry-right'
'ctrl-k left': 'tree-view:open-selected-entry-left'
'ctrl-k h': 'tree-view:open-selected-entry-left'
'ctrl-k up': 'tree-view:open-selected-entry-up'
'ctrl-k k': 'tree-view:open-selected-entry-up'
'ctrl-k down': 'tree-view:open-selected-entry-down'
'ctrl-k j': 'tree-view:open-selected-entry-down'
'ctrl-1': 'tree-view:open-selected-entry-in-pane-1'
'ctrl-2': 'tree-view:open-selected-entry-in-pane-2'
'ctrl-3': 'tree-view:open-selected-entry-in-pane-3'
'ctrl-4': 'tree-view:open-selected-entry-in-pane-4'
'ctrl-5': 'tree-view:open-selected-entry-in-pane-5'
'ctrl-6': 'tree-view:open-selected-entry-in-pane-6'
'ctrl-7': 'tree-view:open-selected-entry-in-pane-7'
'ctrl-8': 'tree-view:open-selected-entry-in-pane-8'
'ctrl-9': 'tree-view:open-selected-entry-in-pane-9'

'.tree-view':
'right': 'tree-view:expand-directory'
'ctrl-]': 'tree-view:expand-directory'
'l': 'tree-view:expand-directory'
'ctrl-f': 'tree-view:expand-directory'
'left': 'tree-view:collapse-directory'
'ctrl-[': 'tree-view:collapse-directory'
'alt-ctrl-]': 'tree-view:recursive-expand-directory'
'alt-right': 'tree-view:recursive-expand-directory'
'alt-ctrl-[': 'tree-view:recursive-collapse-directory'
'alt-left': 'tree-view:recursive-collapse-directory'
'h': 'tree-view:collapse-directory'
'ctrl-b': 'tree-view:collapse-directory'
'enter': 'tree-view:open-selected-entry'
'ctrl-C': 'tree-view:copy-full-path'
'm': 'tree-view:move'
Expand All @@ -40,7 +78,8 @@
'backspace': 'tree-view:remove'
'k': 'core:move-up'
'j': 'core:move-down'
'i': 'tree-view:toggle-vcs-ignored-files'

'.tree-view-dialog .mini.editor':
'.tree-view-dialog atom-text-editor[mini]':
'enter': 'core:confirm'
'escape': 'core:cancel'
8 changes: 7 additions & 1 deletion lib/sublime-tabs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ module.exports =
configDefaults:
# tabs
showIcons: true

# tree view
hideVcsIgnoredFiles: false
hideIgnoredNames: false
showOnRightSide: false

sortFoldersBeforeFiles: true

treeView: null

activate: (@state) ->
Expand Down Expand Up @@ -92,6 +94,10 @@ module.exports =
atom.config.observe 'sublime-tabs.' + 'showOnRightSide', =>
@forceSettingKey('tree-view','showOnRightSide')

@forceSettingKey('tree-view','sortFoldersBeforeFiles')
atom.config.observe 'sublime-tabs.' + 'sortFoldersBeforeFiles', =>
@forceSettingKey('tree-view','sortFoldersBeforeFiles')

forceSettingKey: (masterKey, key) ->
value = atom.config.get 'sublime-tabs.' + "#{key}"
value ?= atom.config.getDefault 'sublime-tabs.' + "#{key}"
Expand Down
76 changes: 44 additions & 32 deletions menus/sublime-tree-view.cson
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,47 @@
]

'context-menu':
'.tree-view.full-menu':
'Add File': 'tree-view:add-file'
'Add Folder': 'tree-view:add-folder'
'Rename': 'tree-view:move'
'Duplicate': 'tree-view:duplicate'
'Delete': 'tree-view:remove'
'Copy': 'tree-view:copy'
'Cut': 'tree-view:cut'
'Paste': 'tree-view:paste'
'Copy Full Path': 'tree-view:copy-full-path'
'Copy Project Path': 'tree-view:copy-project-path'

'.platform-darwin .tree-view.full-menu':
'Show in Finder': 'tree-view:show-in-file-manager'

'.platform-win32 .tree-view.full-menu':
'Show in Explorer': 'tree-view:show-in-file-manager'

'.platform-linux .tree-view.full-menu':
'Show in File Manager': 'tree-view:show-in-file-manager'

'.tree-view.multi-select':
'Delete': 'tree-view:remove'
'Copy': 'tree-view:copy'
'Cut': 'tree-view:cut'
'Paste': 'tree-view:paste'

'.pane .item-views':
'Reveal in Tree View': 'tree-view:reveal-active-file'

'.pane .tab.active':
'Reveal in Tree View': 'tree-view:reveal-active-file'
'.tree-view.full-menu': [
{'label': 'Add File', 'command': 'tree-view:add-file'}
{'label': 'Add Folder', 'command': 'tree-view:add-folder'}
{'type': 'separator'}

{'label': 'Rename', 'command': 'tree-view:move'}
{'label': 'Duplicate', 'command': 'tree-view:duplicate'}
{'label': 'Delete', 'command': 'tree-view:remove'}
{'label': 'Copy', 'command': 'tree-view:copy'}
{'label': 'Cut', 'command': 'tree-view:cut'}
{'label': 'Paste', 'command': 'tree-view:paste'}
{'type': 'separator'}

{'label': 'Copy Full Path', 'command': 'tree-view:copy-full-path'}
{'label': 'Copy Project Path', 'command': 'tree-view:copy-project-path'}
{'label': 'Open In New Window', 'command': 'tree-view:open-in-new-window'}
]

'.platform-darwin .tree-view.full-menu': [
{'label': 'Show in Finder', 'command': 'tree-view:show-in-file-manager'}
]

'.platform-win32 .tree-view.full-menu': [
{'label': 'Show in Explorer', 'command': 'tree-view:show-in-file-manager'}
]

'.platform-linux .tree-view.full-menu': [
{'label': 'Show in File Manager', 'command': 'tree-view:show-in-file-manager'}
]

'.tree-view.multi-select': [
{'label': 'Delete', 'command': 'tree-view:remove'}
{'label': 'Copy', 'command': 'tree-view:copy'}
{'label': 'Cut', 'command': 'tree-view:cut'}
{'label': 'Paste', 'command': 'tree-view:paste'}
]

'atom-pane .item-views': [
{'label': 'Reveal in Tree View', 'command': 'tree-view:reveal-active-file'}
]

'atom-pane .tab.active': [
{'label': 'Reveal in Tree View', 'command': 'tree-view:reveal-active-file'}
]
Loading

0 comments on commit a141893

Please sign in to comment.