I tend to use lines of hashes and dashes for formatting and breaking up code files (e.g., CSS files):
/* -------------------------------------------------------------------
* Layout Styles
* -----------------------------------------------------------------*/
In vim
I would use the command 80a-<ESC>
which would insert 80 -
characters from the location after the cursor.
I've poked around in the Sublime documentation, but haven't come across a good way of replicating the above vim
command in subl
. Vintage mode does not include support for this command sequence.
Is there a corresponding command that does something similar in Sublime or would a static snippet be the simplest solution?
To insert a new line below the current line in your code, hit Cmd–Return (Mac) or Ctrl–Enter(Windows). You can also insert a new line above the current line by using Cmd–Shift–Return(Mac) or Ctrl–Shift–Enter (Windows).
While you can place multiple text cursors in Sublime Text with Cmd–Click (Mac) or Ctrl–Click (Windows), here's another technique that comes in handy. Hold Ctrl–Shift (Mac) or Ctrl–Alt (Windows) and hit Up or Down Arrow to place an additional text cursor above or below the current cursor.
In Sublime Text, you can quickly jump to any line in the code. Hit Ctrl–G (Mac and Windows). Type in a line number and hit Return/Enter to go to that line.
I don't think there is any repeat character possibility. To do this with any character I think would require a plugin, but the basic functionality of inserting a big comment block can easily be achieved with a snippet:
Go to New Snippet
through the menus and add this code:
<snippet>
<content>
<![CDATA[
/* -------------------------------------------------------------------
* $0
* -----------------------------------------------------------------*/
]]>
</content>
<tabTrigger>comment</tabTrigger>
</snippet>
then save the snippet in your Packages\User
folder, as something.sublime-snippet
. Should work straight away, you just have to type comment
(or whatever you change it to..) then hit tab
, then actually write your comment title.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With