In Vim 7, Ctrl-X Ctrl-O shows a list of possible values but I find this sequence of keys to be too long when I frequently use the autocomplete feature. For instance, in an HTML file, I'd like to see the list automatically popup after I type a < followed by one or two letters. In a CSS file, I'd like to see the list after I hit the ":" key. Is there a way to set this up?
To activate the omnicompletion on typing a ":" you can use
the following mapping.
imap : :<c-x><c-o>
The disadvantage is that each time you press ":" omnicompletion will
be activated, even when typing ":" in comments or in any other context
in which you do not want omnicompletion.
I have mapped ctrl-space to active omnicompletion:
imap <c-space> <c-x><c-o>
This gives me the choice to activate omni whenever I need it.
Another alternative that I found easier is just to press tab two times when you want autocomplete, and one time for regular tab.
Add the following line to your ~/.vimrc
imap <tab><tab> <c-x><c-o>
Related
I open a table inside the GUI of MS Access. I mark a cell which contains:
Myriam
I hit ctrl + c to copy it. I open a new document in Notepad++ and copy with strg + v. The result is:
"Myriam
Myriam"
I get two lines instead of one! There are 27 thousand entries in that column and ONLY for this one I observe this behaviour. I was able to track it down to this level, but now I'm clueless about the 'why' ... ?
Using the "Zoom" feature (ShiftF2) in Access revealed that the field actually did contain
Myriam
Myriam
This was probably due to a user accidentally hitting CtrlEnter during data entry, which added the newline and made the field look empty, so they typed the name in a second time.
I have 430 HTML files of different organization's contact us web pages, I was given this files to extract emails from.
This regex simple code I came up with detects and finds emails throughout the files
\S*#\S*
My Problem
I'm trying to select everything besides the emails so I can use Notepad++'s "Replace All in All Opened Documents" function to delete everything besides the emails. Is this possible with regular expressions?
Is there anyway I can select everything outside of the regular expression provided above?
Make sure you have a recent version of Notepad++ installed to have the necessary regex support:
Find what : (^|\s+)[^#]+(\s+|$)
Replace with : \n
🔘 Regular expression
The . matches newline option does not influence the action.
You need to remove all text that does not match some pattern.
You need to match and capture the emails with a (...) capture group and then you need to just match everything else.
Use a pattern like this: ( + your_pattern + )|., and replace with $1.
Or, use:
([^\s<>"]+#[^\s<>"]+)|.
or
(\b[A-Za-z0-9._%+-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b)|.
Replace with: $1
Then, you might want to use Edit -> Blank Operations -> Remove Unnecessary Blank and EOL menu option.
Is it possible to create PhpStorm shortcut through double keystrokes? For example by pressing f character twice.
create every arbitrary shortcut is possible via autoHotKey . for my case create a comma.ahk script with the code below:
:*:ff::
send, {end},{enter}
Return
then run the script. that enough to make you free from going to end of line ,press the comma key and at last going to a new line!
In my project file extension is .ttcn and all the function in that file start with testcase name_of_the_function.
Is there any Sublime plugin exist that can list all the function that is start with keyword testcase followed by test case name?
FYI, most of the common programming languages sublime list all the functions name with shortcut ctrl'r. Thanks in advance for any suggestion or recommendation !
You can use the Find in Files functionality (Find -> Find in Files...). In the Find: field, make sure the first button (Regex) is selected, as well as the last two (Context and Use Buffer), then enter ^testcase. Add the directory you'd like to search in the Where: field, and make sure the Replace: field is empty. Hit the Find button, and a new tab will open showing all lines that begin with testcase.
I'm new to MySQL and I am facing a little problem that I couldn't find an answer to in any previous thread here, so I was hoping someone could help, okay here it is:
When typing a request on mysql (on the terminal) you can just press enter to make it stand on many lines instead of one, but how do you get back to a previous line ?
I tried the arrow buttons and it didn't work, neither did the backspace button, any help is welcome, thank you in advance!
The mysql command uses the readline library. Each input line is edited independently, so once you press Return you can no longer go back and modify that line. The arrow keys will recall the line, but it's inserted into the current line being edited, and appends to the query.
So the solution is to NOT press Return until you've finished typing the whole query.
If you mean to show previously entered lines in order to send them again, according to the MySQL website, it should work via the up/down keys.
[...] the up-arrow and down-arrow keys move up and down through the set of previously entered line
http://dev.mysql.com/doc/refman/5.0/en/mysql-tips.html