-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some changes to make it work like Emacs vertical file completion. #185
base: master
Are you sure you want to change the base?
Changes from 3 commits
c6c13fd
988b8a5
9066872
c4dcae7
26a17b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,6 @@ | |
// A default initial value to fill the create new file input path with. | ||
"default_initial": "", | ||
|
||
// When renaming a file it will we pre populated with the file existing filename. | ||
"autofill_path_the_existing": false, | ||
|
||
// A boolean defining if cursor text should be used. Text bound by single or | ||
// double quotes or within a region will be used. If multiple cursors | ||
// are used, the earliest selection containing a region or existing | ||
|
@@ -182,5 +179,8 @@ | |
"empty_filename_action": false, | ||
|
||
// When specifying initial input, this boolean will place the cursor prior to the .<content> | ||
"cursor_before_extension": false | ||
"cursor_before_extension": false, | ||
|
||
// Ignore regex patters | ||
"filter_regex": ["\\.DS_Store", "\\.git"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This setting needs more context. I'd guess it is for filtering out the completions, but guessing is all I can do from reading this. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,20 @@ | |
"context": [{ | ||
"key": "setting.anf_panel" | ||
}] | ||
} | ||
}, | ||
{"keys": ["ctrl+n"],"command": "advanced_new_file_next", | ||
"context": [{"key": "setting.anf_panel"}] | ||
}, | ||
{"keys": ["ctrl+p"],"command": "advanced_new_file_prev", | ||
"context": [{"key": "setting.anf_panel"}] | ||
}, | ||
{"keys": ["ctrl+l"],"command": "advanced_new_file_updir", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why L? Is that how emacs does it? Please add some comments above the binding to explain their inspiration because I (for example) wouldn't know otherwise. Probably to the readme as well. |
||
"context": [{"key": "setting.anf_panel"}] | ||
}, | ||
{"keys": ["enter"],"command": "advanced_new_file_confirm", | ||
"context": [{"key": "setting.anf_panel"}] | ||
}, | ||
Comment on lines
+21
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this prevent submitting the inserted new file name when the completion list is not visible? It would also not match the native completions UX if |
||
{"keys": ["ctrl+j"],"command": "insert", "args": {"characters": "\t"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose this is how tab completion works currently, but I find that questionable when you could instead bind the tab key to a proper command instead. |
||
"context": [{"key": "setting.anf_panel"}] | ||
}, | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,25 +12,25 @@ Note with either method, you may need to restart Sublime Text 2 for the plugin t | |
Installation through [package control](http://wbond.net/sublime_packages/package_control) is recommended. It will handle updating your packages as they become available. To install, do the following. | ||
|
||
* In the Command Palette, enter `Package Control: Install Package` | ||
* Search for `ANF` to see the list of available commands | ||
* Search for `AdvancedNewFile` | ||
|
||
### Manual | ||
Clone or copy this repository into the packages directory. You will need to rename the folder to `AdvancedNewFile` if using this method. By default, the Package directory is located at: | ||
|
||
* OS X: ~/Library/Application Support/Sublime Text 2/Packages/ | ||
* Windows: %APPDATA%/Sublime Text 2/Packages/ | ||
* Windows: %APPDATA%/Roaming/Sublime Text 2/Packages/ | ||
* Linux: ~/.config/sublime-text-2/Packages/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commit removed ST2 (and Python 2.6) support by changing the |
||
|
||
or | ||
|
||
* OS X: ~/Library/Application Support/Sublime Text 3/Packages/ | ||
* Windows: %APPDATA%/Sublime Text 3/Packages/ | ||
* Windows: %APPDATA%/Roaming/Sublime Text 3/Packages/ | ||
* Linux: ~/.config/sublime-text-3/Packages/ | ||
|
||
Depending on your install on windows, the ST packages path may be `%APPDATA%/Sublime Text 2/...` | ||
|
||
## Usage | ||
Simply bring up the AdvancedNewFile input through the appropriate [key binding](https://github.com/skuroda/Sublime-AdvancedNewFile#keymaps). Then, enter the path, along with the file name into the input field. Upon pressing enter, the file will be created. In addition, if the directories specified do not yet exists, they will also be created. For more advanced usage of this plugin, be sure to look at [Advanced Path Usage](https://github.com/skuroda/Sublime-AdvancedNewFile#advanced-path-usage). By default, the path to the file being created will be filled shown in the status bar as you enter the path information. | ||
Simply bring up the AdvancedNewFile input through the appropriate [key binding](https://github.com/skuroda/Sublime-AdvancedNewFile). Then, enter the path, along with the file name into the input field. Upon pressing enter, the file will be created. In addition, if the directories specified do not yet exists, they will also be created. For more advanced usage of this plugin, be sure to look at [Advanced Path Usage](https://github.com/skuroda/Sublime-AdvancedNewFile#advanced-path-usage). By default, the path to the file being created will be filled shown in the status bar as you enter the path information. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the "key binding" link supposed to point to? (needs to be updated for the repo move, too) A mention of the command palette would also be nice. |
||
|
||
**Default directory:** | ||
The default directory is specified by the `default_root` setting. By default, it will be the top directory of the folders listed in the window. If this cannot be resolved, the home directory will be used. See [Settings](https://github.com/skuroda/Sublime-AdvancedNewFile#settings) (`default_root`) for more information. | ||
|
@@ -233,7 +233,7 @@ To begin at the home directory simply start with `~/` like you would in the shel | |
#### Aliases: | ||
You can create an alias to quickly navigate to a directory. Simply type in the alias followed by a colon. Then specify the path as you would normally. Note, in an event a specified alias conflicts with a [predefined alias](https://github.com/skuroda/Sublime-AdvancedNewFile#predefined-aliases), the specified alias will take precedence. | ||
|
||
Alias paths may be relative or absolute. If a relative path is specified, the `alias_root` setting will be used as the base. When specifying absolute paths, be sure to use the system specific style (e.g. Windows `C:\\Users\\username\\Desktop`, OS X and Linux `/home/username/desktop/`). In addition, you may specify an alias from the home directory by using `~/`. | ||
Alias paths may be relative or absolute. If a relative path is specified, the `alias_root` setting will be used as the base. When specifying absolute paths, be sure to use the system specific style (e.g. Windows `C:\\Users\\username\\Desktop`, OS X and Linix `/home/username/desktop/`). In addition, you may specify an alias from the home directory by using `~/`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This introduced a typo. |
||
|
||
If an invalid alias is specified, an error pop up will be displayed when trying to create the file. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I questioned why the setting was removed, but in hindsight it never made it into a release (a5f062b), the name is questionable, I'm not sure if the code even works, and the behavior is somewhat as well, though I can see the appeal. Regardless, the opposite should have been the default.
A mention of that in the commit message (and having it in a separate comment) would have been nice, though.