Comments (13)
Thanks for your suggestion. I'll work on it when I have time.
from smartmarkdown.
A simple of version of feature can be accomplished by add the following to the bottom* of SmartMarkdown/Default.sublime-keymap
:
{ "keys": ["tab"], "command": "indent", "context":
[
{ "key": "selector", "operator": "equal", "operand": "markup.list" }
]
},
{ "keys": ["shift+tab"], "command": "unindent", "context":
[
{ "key": "selector", "operator": "equal", "operand": "markup.list" },
// Should we enable the following setting check?
// { "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
]
}
* The position is important: as it should override the Shift+Tab global fold. I actually don't like that binding very much, but I'm not sure if something else would be an improvement.
Edit: Ah, I see the commit I made in my branch triggers a comment here. Well, the commit just includes the code above.
from smartmarkdown.
Scratch that. The default Markdown syntax does not play very nice when the caret is at the end of the document like so:
* List
* |
I cobbled together an improved version using regex, which includes support for (almost) all of the various Pandoc lists: 1b5c095
Testers?
from smartmarkdown.
Wait, you know there are ctrl+[
and crtl+]
- works everywhere and exactly as you expect?
I mean, sure maybe other keystrokes would be more convinient, but implicitness is bad:
if I press shift+tab in list it will unindented... but I meant to fold all;
if I press shift+tab in paragraph it will fold... but I meant to unindent.
See?
from smartmarkdown.
ctrl/command + [ and ] certainly work, but my use case comes from experience with word processors such as microsoft word where hitting tab at the beginning of a bulleted list item indents that item. Tab indentation is nice because it's a learned behavior from other programs. ctrl/cmd + [ and ] are fine when I'm coding, but when I'm taking notes or quickly inputting items in a list that will be turned into HTML, it's nice to just hit enter then tab to quickly nest a list. Also, you could use shift+alt+tab instead of shift+tab or leave it up to the user to decide. I'd personally use shift+tab to unindent more than I would to fold all, but certainly that's just me and what I use markdown for.
from smartmarkdown.
@jeffnuss I understand, e.g. I had used Tomboy for a long time.
But you know how they say: the further into the woods, the more firewood.
-
shift+alt+tab switches windows in Windows (at least 7)
-
plain text doesn't make good alignment (as e.g. MS Word or Tomboy) so if one want to make it they should use whitespaces or tabs
example of alignment:
* First paragraph.
Continued.
* Second paragraph.
Now it may be acomplished just by hitting tab.
So I just saying that such small issue will demand too much time for making, testing, and configuring - does it really worth it, taking in account of ctrl+[/]?
from smartmarkdown.
Let me throw in a couple of thoughts:
I get what @vovkkk is saying in terms of testing, but I think that, with a little fine-tuning, what I have posted above is okay for most use. (Unless I've missed something blindingly obvious.)
Now, if the objection is that it breaks expected behaviour, it's very simple to hide it behind a setting such as "quick_indent_lists"
for those of us who prefer it. I think this situation is more of an issue with the Emacs-heritage of the fold/unfold all binding, since these bindings are quite Sublimish.
Also, they may look the same but what Ctrl+[
& Ctrl+]
do is to push and pull the beginning of the line. Whereas Tab
subordinates the idea on the current line to the idea on the previous one, while Shift+Tab
makes the current line's idea parallel to an earlier one.
I'm not kidding. It would be great if it was possible to move logical units around using Ctrl+Shift+Up
/Down
. Any takers?
@jeffnuss If you use the bindings, let me know how it goes :)
from smartmarkdown.
Got a chance to play with the bindings and they work great. This is exactly what I was looking for. Thanks.
from smartmarkdown.
Cool. Let me know if you notice any weirdness. I just squashed a bug @vovkkk pointed out to me (hopefully, for good) that was interfering with folding headings. Just grab the last two keybindings from here: https://github.com/alehandrof/SmartMarkdown/blob/develop/Default.sublime-keymap
from smartmarkdown.
@demon386 I've been using this for awhile and it's both useful and robust (I think). Shall I open a PR?
from smartmarkdown.
I haven't been actively pounding on it and trying to break it, but I haven't had an issues with it, so you have my vote.
from smartmarkdown.
I'm putting together a package of Markdown stuff I've made for my own use. If @demon386 isn't interested (which I can understand, as SmartMarkdown does some higher-level stuff) I will publish these in that form for easy update & maintenance.
from smartmarkdown.
@alehandrof This functionality is good (in fact Org mode has that too)! Please submit a PR is possible. Thanks!
from smartmarkdown.
Related Issues (20)
- Highlighting of embedded latex?
- Does not find pandoc on Windows
- Is it possible to do code folding using mouse? HOT 2
- Smart Fold Lists
- Pasting over lists
- No such file or directory: 'pandoc'
- 6 seconds to global-fold with 3000 headings HOT 1
- Emphasis wrapping of highlighted text
- Blank line before lower-numbered (higher-level) heading HOT 3
- Support for Markdown in Fountain files
- Unexpected behaviour in Smart Tables
- Moving columns in tables
- I'm such a fan of this plugin.. made a small screencast
- Cannot indent code that contains a pipe "|"
- "Outline View" HOT 1
- Why it doesn't work? HOT 6
- how to render html/pdf with pandoc?
- [Feature request] Disable smart_list option
- Add option to disable the error highlighting
- Slight adjustment to make smart_folding work — perhaps document?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartmarkdown.