I am need a help to create comment section in sublime text 3 for each controller and method.
any idea for it please tell me.
other wise i want a created date and update date as like this #param any parameter pass are mention here
If you want to comment out or uncomment the selected text or current line then:
Windows: Ctrl+/
Mac: Command ⌘+/
Linux: Ctrl+/
Otherwise, use the menu: Edit > Comment
Block comment:
Windows/Linux: Ctrl+Shift+/
Mac: Command ⌘+Option/Alt+/
Related
I wondered if anyone could help me out.
In sublime text, when I want to shuffle some lines (for example if I had a list of colour names and wanted them in random order). I've been using Ctrl+Shift+P, and then writing shuffle to get the "Permute lines: Shuffle" command. This is fairly quick but I'd love to have a shortcut for it as I use it very often. I know there's a file I can change but I don't know how to write the command.
Many thanks in advance!
Items that appear in the command palette are stored in sublime-commands files. If you use the View Package File command from the command palette and enter sublime-commands as the filter text, the list of all files in all packages that add commands to the command palette will be displayed.
The first part of the filename shows you what package is contributing the command, and commands that are part of core Sublime are in the Default/ package, so choosing the file Default/Default.sublime-commands will show you the commands Sublime ships with (note that some packages include a file named Default.sublime-commands, so make sure you're picking the Default/ version).
If you look in that file and search for the command that you see in the command palette, you'll find this (reformatted here to not be all one line):
{
"caption": "Permute Lines: Shuffle",
"command": "permute_lines",
"args": {"operation": "shuffle"}
},
This shows you the command and args you need to apply in a key binding.
For commands that also appear in the menu (or are bound to other keys and you want to remap them) you can also open the Sublime console with View > Show Console in the menu and enter sublime.log_commands(True). Now when you choose a menu item or press a key, the command that is being executed will be logged for you. The logging remains in effect until you enter sublime.log_commands(False) in the console or restart Sublime.
In this case doing that and then choosing Edit > Permute Lines > Shuffle will log this in the console:
command: permute_lines {"operation": "shuffle"}
This shows the same command and arguments that are required (if any).
Is it possible to get the line numbers of selected text to pass to an external command?
Context: I'd like to integrate pyfmt into vim. Ideally, I'd like to be able to select some text and type some shortcut to have the selected text reformatted by pyfmt.
So far I've found that running !pyfmt -i % will format the whole file. pyfmt also supports a --lines START-END option. I'd like to be able to pass the line numbers of the beginning and end of the selected text to pyfmt so that only what I want to reformat gets reformatted. Is this possible?
Select the lines you want to format (preferably linewise, using capital V to enter visual mode), and then, without leaving visual mode, type :!pyfmt -i.
This will not give you the line numbers. Instead, it will filter the selected lines through the command and replace them with the output.
I will provide my case as follow and I think it can be customized to your case, easily.
I have a Vim-Plug plugin Plug 'tpope/vim-commentary', and it has a command: (l,r are line numbers)
:l,rCommentary
When you visual-selected lines in Vim and then press : you will get:
:'<,'>
Based on this observation the command I need is: (visual mode mapping)
vnoremap <silent> my_shortcut :Commentary<CR>gv
i.e. I just need :Commentary since when it execute : the '<,'> is added for you.
To understand <silent>: https://stackoverflow.com/a/962118/5290519
I have just started using the Vim plugin SnipMate. When I create an HTML file (with filetype .html), go into insert mode, and type "html" and a tab, I see this message at the bottom of my screen:
1* 1. Users/me/.vim/bundle/vim-snippets javascript-jquery default
2: 2. Users/me/.vim/bundle/vim-snippets html default
__InputList__
select snippet by name (filter: ; press <F1> for help) [glob]
I'm not sure why this is happening. How can I configure SnipMate so that it knows that when I type "html" I always want the second option?
Thanks.
This message was caused by an "html" snippet in the file vim-snippets/snippets/javascript/javascript-jquery.snippets. Once I commented that snippet out, the message stopped occurring.
Yep.
I had a similar error on the bottom of my vim screen:
1 1* 1. html bundle/vim-snippets html.snippets
2 2: 2. javascript bundle/vim-snippets javascript-jquery.snippets
There is already a snippet called html in the
~/.vim/bundle/vim-snippets/snippets/javascript-jquery.snippets file.
You should comment out these two lines with the # sign, like this:
'# snippet html
̈́'# ${1:obj}.html('${2:Some text and bold!}')
Someone should fix this problem.
Installing Vim plugins should be easy, not complicated! :-(
Sublime is able to add parentheses, brackets (curly and square), apostrophes, and quotes to highlighted text by default. I've tried but can't seem to find a way to have it remove those as well. What I'd like to be able to do is highlight some text that is surrounded by parentheses and have it remove those. Is there a good way to do that using snippets?
I suspect it can be done with use of allFollowingCharacter and allPrecedingCharacter but it seems those might be from a previous version of Sublime when those were in XML instead of the current JSON...?
Any help would be appreciated!
With surround you can do this. Install it via Package Control. (Package Control Installation)
Open the command palette:
CTRLSHIFTP on Linux and Windows,
CMDSHIFTP on Mac.
Search for Surround: delete surround and type in ( and Enter and you are done!
I'm surprised this question isn't searched more regularly!
BracketHighlighter is an excellent utility that includes convenient deleting of parenthesis. To cut to the chase, install BracketHighlighter and set bh_remove_brackets to whatever shortcut you'd like to be able to delete parentheses. Search up bh_remove_brackets in the example sublime keymap to see an example!
How do I comment or uncomment code in Textmate 2?
I came across How do I use a shortcut to comment out code automatically in Textmate? , but it's for Textmate 1.x, and "Bundles" > "Source" > "Comments" doesn't have "Comment line".
I'm using TextMate 2.0-beta.7.1.
I recall disabling command + / because it was causing problems while working on Rails apps, but I assumed that would just disable the keyboard shortcut, not the ability to comment and uncomment lines.
In TextMate 2.0.19 you can comment, or uncomment, a line or selection with the shortcut Cmd (⌘) + /.
If this shortcut doesn't work for you, you can do it like this :
Select Bundles in the menu bar
Select Source
Select Comments
Select Comment line
Happy coding 🖖
TIPS
Define a new shortcut for comment or uncomment
If the native shortcut doesn't work for you, define a new one like this :
Select Bundles in the menu bar
Select Edit Bundles...
Select Source
Select Menu Actions
Select Comments
Select Comment Line / Selection
Click on Key Equivalent
Type your shortcut
Close the Bundles editor
A prompt will ask you to confirm your changes
Test it!
Others useful shortcuts
Insert Block Comment : Option (Alt, ⌥) + Cmd (⌘) + /
Insert Comment Banner: Select the word or text you want to use as a banner and Ctrl (⌃) + Shift (⇧) + B
Insert Comment Header ( This will insert the name of the script and some useful details): You have to define it 😅 because in my case it was empty... I defined it with Ctrl (⌃) + Shift (⇧) + N
Use Help in TextMate 😉
Select Help in the menu bar
type "comment"
This will brings you directly to the option comment line. I suggest doing that first because in most cases, you will find the answer.
Bundles -> Source -> Menu Actions -> Comments -> Comment Line
Is that what you're looking for?