I've got a huge list of words (every single word in one line in a txt file) and certain words need to get capitalized manually (e.g. by hand), so I was looking if there's a shortcut in notepad++ (my editor currently) to automatically capitalize the first letter of a line but couldnt find one. Is there none? If not, can you advise me an alternative windows program to quickly do this by using a simple shortcut (so I can go through with the arrow-down key and use the shortcut whenever needed on a specific word)?
thanks a lot
This can be easily done if the first letters are latin characters. But this method does not work with non-latin (for example cyrillic) characters. Just press Ctrl+F, enable "Regular Expression" checkbox, and search for
^(.)
replace with (Replace All)
\u\1
". matches newline" checkbox has to be unchecked
Well, you can install the TextFX plugin and apply Sentense case.
Here you have some tricks (including this one).
http://a4apphack.com/featured/tricks-with-notepad
For those who have hard time following textual instructions, here is the screenshot. (answer credit to #Placido)
Enable Column Mode in N++ and then select the first column. change case to upper case.
There is a shortcut available in Notepad++ v7.3.2 to capitalize the first letter of a line(Sentence Case).
ALT + CTRL + U
Not sure about prior versions.
Firstly select the text and use ALT+U shortcut
Open you file in notepad++
Hit ctrl + F
Click on Replace tab
Put \n[the letter you wanna capitalize] inside "Find what" field
Put \n[the letter capitalized] inside the "Replace with" field
Set the search mode to "Extended"
Hit Replace All button
This will capitalize every first letter of a line.
You can modify this method to capitalize under other conditions
You can do it quick in an unortodox way, but you'll need TotalCommander.
Create new file with a name containing text you want to capitalize.
Select this file in TotalCommander.
Press Ctrl+M (Multirename Tool).
In "Uppercase/Lowercase" dropdown select "First of each word uppercase".
Under Windows.
There is a draw back: filename limits to 255 characters if i'm not mistaken.
And some special characters will be ommited (slashes, double quote, etc).
Also similar software like Far should work in the same way I think.
Have you tried recording a macro and then assigning it to a shortcut?
e.g. Your replacement could be:
Find what: (\A|[.!?]\s+)(\w+)
Replace with: $1\u$2
Tick 'In selection'
And then navigate to Macro → Modify Shortcut/Delete Macro... in the top menu and assign a shortcut.
This is the resulting macro that I extracted from C:\Users\%USERNAME%\AppData\Roaming\Notepad++\shortcuts.xml.
It uses the shortcut Ctrl + Shift + C
<Macro name="Capitalise" Ctrl="yes" Alt="no" Shift="yes" Key="67">
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1601" wParam="0" lParam="0" sParam="(\A|[.!?]\s+)(\w+)" />
<Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
<Action type="3" message="1602" wParam="0" lParam="0" sParam="$1\u$2" />
<Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
<Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
</Macro>
first you select the first column by pressing alt+ctrl+shift.
After seletion just press ctrl+U keys
Problem solved
You can do this quickly in MS Word by highliting the list and then using shift + f3
This will cycle through all-upper, all-lower or first letter caps.
Related
I know how to convert indent for a single file. I go to edit -> convert indent -> space/tab.
But I want to do this for all files under a directory.
I try click on a directory and then go to edit -> convert indent, but the options are grayed out.
You can use the shortcut Ctrl+ALT+L (Windows/Linux) or ⌥⌘+L (MAC OS X) and select the Rearrange entries option to reformat the code in the current file or reformat a module or directory.
You can also Right-click a module, file, or directory from the context menu and select Reformat Code and also select the Rearrange entries option.
This will convert the indents for all files/directories selected:
This works on most of the Jetbrains IDES (iDea, PyCharm, WebStorm, RubyMine, and so on.)
It seems there is no such dedicated option in IntelliJ, but you could just work around it using a "low-level" Replace All action.
Open the Edit → Find → Replace in Files... dialog
In case you want to convert spaces to tabs, you should
Enter in the Find field (i.e. four spaces (or whatever number of spaces the project is currently indented with))
Press the Regex search modifier (Alt + X)
Enter \t in the Replace field
NB: In case you have valid strings with 4+ spaces in them, they will get replaced too. In most use cases, however, this is not happening.
In case you want to convert tabs to spaces, you should do the same as above, but swap the Find and Replace field contents
NB: Again, if you have valid strings with tabs in them, they will get replaced too. I haven't had this use case, because I've only needed to convert in the opposite direction.
You will probably also want to set a File mask in order not to replace spaces in code-irrelevant files
I'm making the switch over from ST3 and I would like to replicate one of the search behaviours that I frequently used in ST3.
When I used Sublime Text 3, I would frequently press Ctrl + P to bring up the "Goto Anything" panel.
It looks like this:
As you can see, the ST3, uses fuzzy string matching to match any path and file name in your project.
So for example typing
ze vi help will match any file which contains that sequential list of characters in it's file path.
On the other hand, when you use PHPStorm for "Search Everywhere" it only searches the class name or the file name.
Is there a way to include this functionality? I would like PHPStorm to search the filepath and filename, rather than the PHP class names in the files.
If you miss a fuzzy file search like the one in Sublime, please vote for IDEABKL-6959
You can use double shift, it is called "search everywhere"
What I did, I remapped double shift to cmd+p
This feature will finally be available in version 2017.3!
As of now you can only search the path while using / - so for example if you have a file in app/http/controller/somecontroller.php you can search it via ttp/lle/con.
BUT: The feature has been implemented in the new build, which is already available in an Early Access Programm
(see https://blog.jetbrains.com/phpstorm/2017/09/phpstorm-2017-3-eap-173-2290/)
I don't know how the functionality in Sublime works exactly, but in PhpStorm you can use 3 ways of searching everywhere, as you can see here.
Cmd + O will search by class name.
Cmd + Shift + O will search by file name.
Cmd + Alt + O will search by symbol (properties, methods, etc)
If you want to search for all files with help in their path, I am pretty sure you can do a file search with Cmd + Shift + O and then type help/*.
The keys are to include the forward slash /, otherwise it will search for files containing help somewhere in their filename.
And also use the wildcard *, otherwise it will search for folder names with those characters.
Update: you can also click Shift twice, and it will allow the same kind of search, but in files, classes, symbols and even PhpStorm tools - all at a time.
In IntelliJ IDEA 11 or 12, with an HTML file open, typing
<img src=
causes automatic insertion of double quotes, resulting in
<img src=""
Since I type ahead of where I read, this usually means I end up with something like
<img src=""image.png" alt="Image"/>"
How do I prevent double-quotes from being inserted automatically after attribute names?
In Intellij IDEA 14 and 15 (see #Zook's comment for IDEA 13), the option is now
Windows:
Menu File→Settings→Editor→General→Smart Keys→Add quotes for attribute value on typing '=' and attribute completion (under XML/HTML section on the right side of the Settings dialog)
Mac:
Preferences→Editor→General→Smart Keys→Add quotes for attribute value on typing '='
I don't know if it was the same for previous versions, but what actually happens in IDEA 14 is it automatically inserts both quotes and puts the cursor inside them. That's fine, but then when you type what you expect to be your opening double-quote, the smart punctuation mechanism thinks you're closing the quotes and skips you over the automatically-inserted close quote (the same as it does in e.g. java code when you type a closing parenthesis when it has already auto-inserted one). So you wind up with the cursor after the pair of quotes, typing your attribute value. This seems consistent with the original observation.
I would actually consider this a bug in IDEA but I guess the fact that opening and closing punctuation are the same symbol in this case makes things complicated. The smart punctuation mechanism would need to know to ignore the first quote you typed, but if you actually wanted to type an empty attribute value like src="", it would need to ignore the first quote and then jump over the close quote for the second one. Fiddly, but not impossible.
I've tried it with IDEA 12 and double quotes are inserted only after you start completing src attribute and press Enter or type = to confirm the completion. It doesn't happen automatically, you invoke completion that inserts quotes.
There is no option to control it, so you will have to break your habit to insert quotes manually and use Enter instead.
It's also possible to use the template completion with:
imgTab to generate <img src="" alt=""> with the caret inside first pair quotes.
Then just enter the image file name, Tab, enter alt text.
You can always submit a feature request to disable adding quotes on attributes completion.
Just change Input Language from "US - International" to "US". Switching to just "US" fixed the problem.
Read IntelliJ thread
Our company uses an old app which reads TSQL from a .INI file. Due to how the app process the INI file the TSQL has to be all on one line. I use Poor Mans TSQL Formatter to get everything nice and tidy for things like SPs, but am wondering if there's something out there to do the reverse - take nicely formatted TSQL and shove it all onto one line (removing carriage returns , line breaks etc).
I'm working in SSMS but also use Notepad++, and will happily use some other editor if it has the functionality.
Using Notepad++ (Without any plugin)
After lot's of googling I found that there are no plugins like TextFX and PoorMansTSqlFormatter are available in x64 bit version of notepad++ even not needed.
Notepad++ --> Write Query --> Edit --> Blank Options --> Remove Unnecessary Blank and EOL.
That's it.
Using Notepad++
Select the statement that is over multiple lines then on the menu: TextFX>TextFX Edit>Unwrap Text
And for even greater ease you can assign it to a keyboard shortcut using the shortcut mapper (Settings>Shortcut Mapper)
You can use the minify comment to remove all the unnecessary space in the Poor Mans TSQL Formatter
[minify]
[/minify]
I like Martin's answer and that is probably the way to go. But I'll point out that you can just use string manipulation to turn carriage returns and line feeds into spaces. This is particularly easy in the later versions of SSMS that enable limted use of regex in the find/replace dialog.
In SQL Server 2012:
Highlight the selected text and use 'Find and Replace' (ctrl + h)
Check: use Regular Expressions
Find: \n
Replace with: LEAVE BLANK
In many text editors that are aimed at programmers, if the user has a selection that spans more than 1 line and presses the TAB key, those lines are indented by 1 TAB (or a number of spaces, depending on how the editor is configured).
However, this does not seem to be the default behavior of Notepad++. Is there a way I can do this in Notepad++, or is there a plugin that I can get to allow me to do this?
Edit: Upon additional testing, SHIFT-TAB correctly un-indents the lines as expected, but only a tab simply inserts a tab wherever the carat is. This is in version 5.4.5 Unicode
The problem was with the QuickText plugin. After removing it, indent worked as normal.
Capslock + Tab to indent multiple lines at once. Highlight the text first.
The problem with the new version of QuickText seems to be that it is set to react to the TAB key. Previously it was set to use CTRL-ENTER. If you change the key combination in the shortcut mapper then your TAB key should start working again, and QuickText should also work (with whatever new key you've assigned).
It works fine for my v. 5.4.5 of Notepad++. I just select multiple lines and press TAB.
If you want TAB to be replaced by SPACE than you need to go Settings > Preferences and select Edit Components tab. Next check Replace by spaces check box in Tab Setting section.
Update: In a newer version of Notepad++ this option is in Settings > Preferences > Language section.
If you're using QuickText and like pressing Tab for it, you can otherwise change the indentation key.
Go Settings > Shortcup Mapper > Scintilla Command. Look at the number 10.
I changed 10 to : CTRL + ALT + RIGHT and
11 to : CTRL+ ALT+ LEFT.
Now I think it's even better than the TABL / SHIFT + TAB as default.
I have Notepad++ 5.3.1 (UNICODE). I haven't done any magic and it works fine for me as described by you.
Maybe it depends on the (programming/markup/...) "Language"?
Just install the NppAutoIndent plug-in, select Plugins > NppAutoIndent > Ignore Language and then Plugins > NppAutoIndent > Smart Indent.
Notepad++ will only auto-insert subsequent indents if you manually indent the first line in a block; otherwise you can re-indent your code after the fact using TextFX > TextFX Edit > Reindent C++ code.
in Notepad++v6.1.8 (Unicode) it works after removing the QuickText plugin.
To increase indent - Press and hold TAB
To decrease indent - Press and hold TAB + SHIFT