How can I select additional occurrences of a word in TextMate 2? I do this in Sublime Text 2/3 by pressing Ctrl+D (Windows, Linux) or Cmd+D (macOS).
Updated answer
As indicated below, ⌃W (Select Word) is the shortcut in the current build.
Previous answer
Taken from the release notes for r9302:
Add two new action methods:
findNextAndModifySelection:
findPreviousAndModifySelection:
These find the next/previous occurrence of what’s on the find clipboard and selects that, but preserves the existing selection. One could e.g. add this to Keybindings.dict:
"#d" = ( "copySelectionToFindPboard:", "findNextAndModifySelection:" );
This binding will likely be default in an upcoming build, but bound to ⌃W (Select Word) and scoped to dyn.selection (so only when a word is already selected).
You can learn more about key binding files at:
http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
http://blog.macromates.com/2006/multi-stroke-key-bindings/
There are two macros here that do what you want.
They are hooked to ^-W and shift-^-W and have a dyn.selection context.
This lets ^-W select the current word as usual, but once a selection exists, it will extend the selection (using TM2's nifty ability to generate multiple selections).
I imagine allan will soon add something like this or better by default, but 'til then, this a a great feature!
Related
The website of Texstudio advertises block selection or multiple cursor functionality, but I could not figure out which key combination to use for this feature reading their horribly cryptic user-manual.
I am familiar with how text selection with multiple cursors works in Sublime Text, for instance. Those key combinations don't work here.
Would someone be kind enough to please tell me how to do this in Texstudio? Thanks.
The key combination for block selection is Shift+Ctrl+Alt (See Sect. 2.8.1 in Manual)
Press them all together and simultaneously move the mouse or cursors to select the text.
Alternatively, Ctrl+Alt can be used to place multiple cursors without selecting, even in the same line or in non adjacent lines.
Without the mouse, you can use Ctrl+Alt and Up/Down arrows keys to place multicursors.
And for special use cases, there is Edit/Searching/Select All Matches, to create multi cursors after searching text with the search bar.
Edit/Selection/Select All Occurernces is like Edit/Searching/Select All Matches, but for the current word (the one where the cursor is currently placed) rather than the search.
In TeXstudio 3.0.0, there are new commands Edit/Selection/Also Select Next|Prev Occurrence to create multiple cursors to the next|prev occurrence of the current word.
I wanted to cluster sentences based on their context and extract common keywords from similar context sentences.
For example
1. I need to go to home
2. I am eating
3. He will be going home tomorrow
4. He is at restaurant
Sentences 1 and 3 will be similar with keyword like go and home and maybe it's synonyms like travel and house .
Pre existing API will be helpful like using IBM Watson somehow
This API actually is doing what you are exactly asking for (Clustering sentences + giving key-words):
http://www.rxnlp.com/api-reference/cluster-sentences-api-reference/
Unfortunately the algorithm used for clustering and the for generating the key-words is not available.
Hope this helps.
You can use RapidMiner with Text Processing Extension.
Insert each sentence in a seperate file and put them all in a folder.
Put the operators and make a design like below.
Click on the Process Documents from files operator and in the right bar side choose "Edit list" on "Text directories" field. Then choose the folder that contains your files.
Double click on Process Documents from files operator and in the new window add the operators like below design(just the ones you need).
Then run your process.
I'm re-building a Lua to ES3 transpiler (a tool for converting Lua to cross-browser JavaScript). Before I start to spend my ideas on this transpiler, I want to ask if it's possible to convert Lua labels to ECMAScript 3. For example:
goto label;
:: label ::
print "skipped";
My first idea was to separate each body of statements in parts, e.g, when there's a label, its next statements must be stored as a entire next part:
some body
label (& statements)
other label (& statements)
and so on. Every statement that has a body (or the program chunk) gets a list of parts like this. Each part of a label should have its name stored in somewhere (e.g, in its own part object, inside a property).
Each part would be a function or would store a function on itself to be executed sequentially in relation to the others.
A goto statement would lookup its specific label to run its statement and invoke a ES return statement to stop the current statements execution.
The limitations of separating the body statements in this way is to access the variables and functions defined in different parts... So, is there a idea or answer for this? Is it impossible to have stable labels if converting them to ECMAScript?
I can't quite follow your idea, but it seems someone already solved the problem: JavaScript allows labelled continues, which, combined with dummy while loops, permit emulating goto within a function. (And unless I forgot something, that should be all you need for Lua.)
Compare pages 72-74 of the ECMAScript spec ed. #3 of 2000-03-24 to see that it should work in ES3, or just look at e.g. this answer to a question about goto in JS. As usual on the 'net, the URLs referenced there are dead but you can get summerofgoto.com [archived] at the awesome Internet Archive. (Outgoing GitHub link is also dead, but the scripts are also archived: parseScripts.js, goto.min.js or goto.js.)
I hope that's enough to get things running, good luck!
When I design a cell layout I usually assign a sample text, e.g. 'John Appleseed' to a 'name' label so I can easily see where the field is on the layout and check the composition. Otherwise there is an empty label on a white background. Obviously this text does not need to be translated as it will be always replaced by another value at runtime.
Is there any property I can set in the Object Inspector to exclude this text from .strings / XLIFF file? Translators usually charge per word, so I don't want to send those texts for translation.
For the time being I use '~' prefix and then remove those texts using a Ruby script, but I was wondering whether there is an easier way to do it.
Unfortunately, if you are using ibtool (and you do not really have an alternative) you cannot exclude words directly.
What you can do, is to edit the XLIFF file after you export it and add the attribute translate="no" on the strings you want to exclude. You should make sure that your translators use a XLIFF-compatible tool to translate.
But, imho, this is not any better than your way.
Also see question 1, question 2 and ibtool's manual.
I have been using VMS EDT for a while. I would be editing/ replacing large number of lines in the text files and saving it as a different version.
As for as I am aware, the only way to delete the characters in the text file is pressing delete key. This process is quite slow, as on one press, only one character is deleted.
Hence I wanted to know, Is there a way to quickly select multiple lines in vms edit?
Do you mean EDT? If so, it's been a long time since I worked on VMS much, and I don't have a system running it on which to confirm the following. However, I found an old manual and Google turned up what look like a number of useful web sites, including this one. If you are using EDT, here's one method that should work:
Start EDT on the file you want to clean out.
If you are started in line mode, go into keypad mode by typing c and
Make sure you're at the top of the file (or the point at which you want to start deleting).
Mark the start of the text you want to delete by hitting the keypad "." key.
Move to the end of the text you want to delete. If you want to go to the end of the file, hit the GOLD key (probably the keypad "7" if you're logged in remotely) and then the keypad "4".
Press the keypad "6" to cut the file's contents. Note that this puts the selected text into the cut/paste buffer. You can paste it at the cursor point with GOLD then the keypad "6".
You can also delete text from EDT's line mode using the D command. The syntax is
Dn1:n2
where n1 is the first line to delete and n2 is the last line to delete. I don't remember what happens if you do
D1:
and couldn't find that documented, but it may be worth a try if you want to delete the entire file's contents and don't know the last line number.
Good luck!
IMO - you'd be much better off using the TPU version of the VMS editor. It is the 'modern' ;) version of EDT so it has much the same keystrokes/keypad.
Command: 'edit/tpu'
Look at 'help edit' then select '/tpu'.
It has many more features and in your case selecting multiple lines is easy. Press 'select' key, move cursor, then either delete or copy. Not too special.
Ransom Fitch