surround

MySQL select before after row

北慕城南 提交于 2019-12-03 06:38:47
This is the example table: Column | 1st record | 2nd record | 3rd record | 4th record | etc<br /> id (primary) | 1 | 5 | 8 | 12 | etc<br /> name | name 1 | name 2 | name 3 | name 4 | etc<br /> date | date 1 | date 2 | date 3 | date 4 | etc<br /> callValue (unique) | val1 | val2 | val3 | val4 | etc I select one row that is the data to show (for example: row with callValue: val3). But I cannot find a solution for this: I need to select previous and next row. So, in this example, I need to get data from rows vallValue: val4 and callValue: val2, or id: 5 and id: 12. It cannot be done with id = id

Surround two words with quotes in Vim

自作多情 提交于 2019-12-03 05:56:35
I am working with vim-surround and the following text. (* is the place of the cursor) This is a lo*ng line and I want to highlight two words I want to surround both the words long and line within quotes, so that it becomes This is a "long line" and I want to highlight two words Is it possible to do it without getting into visual mode? Try: ys2w" ( ys takes a motion or text object, and then the character with which you want to surround). Press b first and then ys2w" When using surround commands, I find the most logical solution is to sequence the "marking" and the "surrounding" operations. Thus

Replacing quote marks around strings in Vim?

被刻印的时光 ゝ 提交于 2019-12-03 03:06:42
问题 I have something akin to <Foobar Name='Hello There'/> and need to change the single quotation marks to double quotation marks. I tried :s/\'.*\'/\"\0\" but it ended up producing <Foobar Name="'Hello There'"/> . Replacing the \0 with \1 only produced a blank string inside the double quotes - is there some special syntax I'm missing that I need to make only the found string ("Hello There") inside the quotation marks assign to \1 ? 回答1: You need to use groupings: :s/\'\(.*\)\'/\"\1\" This way

Replacing quote marks around strings in Vim?

↘锁芯ラ 提交于 2019-12-02 15:11:44
I have something akin to <Foobar Name='Hello There'/> and need to change the single quotation marks to double quotation marks. I tried :s/\'.*\'/\"\0\" but it ended up producing <Foobar Name="'Hello There'"/> . Replacing the \0 with \1 only produced a blank string inside the double quotes - is there some special syntax I'm missing that I need to make only the found string ("Hello There") inside the quotation marks assign to \1 ? You need to use groupings: :s/\'\(.*\)\'/\"\1\" This way argument 1 (ie, \1) will correspond to whatever is delimited by \( and \). There's also surround.vim , if you

How do I match a pattern with optional surrounding quotes?

好久不见. 提交于 2019-11-30 11:44:55
How would one write a regex that matches a pattern that can contain quotes, but if it does, must have matching quotes at the beginning and end? "?(pattern)"? Will not work because it will allow patterns that begin with a quote but don't end with one. "(pattern)"|(pattern) Will work, but is repetitive. Is there a better way to do that without repeating the pattern? You can get a solution without repeating by making use of backreferences and conditionals : /^(")?(pattern)(?(1)\1|)$/ Matches: pattern "pattern" Doesn't match: "pattern pattern" This pattern is somewhat complex, however. It first