Pandoc markdown vertical lines in grid - text

I use Pandoc (http://johnmacfarlane.net/pandoc/README.html) and its Markdown processor. When I convert the grid below to PDF (directly via LaTeX) using Pandoc, there are no vertical lines in PDF. How to obtain them?
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+

There is currently no way to add vertical lines, other than postprocessing pandoc's latex output, according to this bug https://github.com/jgm/pandoc/issues/922#issuecomment-38586467

I don't know of any way to do this directly. The only solution I know is to use pandoc to convert to LaTeX, then edit the table formatting in LaTeX.

Related

Resharper: I want all blocks in braces

I want to tell Resharper that if I have anything like
if (foo) { bar(); }
to turn it into
if (foo)
{
bar();
}
But I can't find the setting nor info on their support site.
Thanks!
Open your R# settings, go to ReSharper | Options | Code Editing | C# | Syntax Style and set Braces | In "if" statement to Enforce always:
Furthermore you have to go to ReSharper | Options | Code Editing | C# | Formatting Style | Line Breaks and Wrapping and disable Arrangement of embedded blocks | Keep existing arrangement of embedded blocks:

Creating simple tables in vim

Recently I've started discovering "deeper" vim and now I want to create a simple table without using any external plugins (I know it's bad, but I want to have some "know-how").
Let's say I want to have a table like this:
| name | address | phone |
|---------------------------------------------------------|
| John Adams | 1600 Pennsylvania Avenue | 0123456789 |
|---------------------------------------------------------|
| Sherlock Holmes | 221B Baker Street | 0987654321 |
|---------------------------------------------------------|
But how do I manage to make underscores till the end of the longest line and seperate columns with equal width? (In short way, no typing all by hand)
If you know the amount of the dashes needed then you can do:
{number}i-<ESC>
Where {number} is the amount of dashes needed. If you want to "learn" that automatically then you need to use VimL and strlen() function to first learn how many dashes are needed and then you can use append() to insert text below provided line.

Is it possible to stop the NERDTree window resizing when using Ctrl W Equals to make all split window equally sized in Vim?

Usually NERDTree doesn't get resized when I do this. But when I am working with a bunch of horizontal and vertical splits for a while, it can happen.
I don't know what the change in state of within the instance of Vim is that makes this issue happen during a vim session. I'm not sure if the number of splits makes a difference.
Usually I set up 4 splits, along with the NERDTree window on the left like this...
|--|-----|-----|
| | | |
|NT|-----|-----|
| | | |
|--|-----|-----|
When I do the equal split resize I end up with this when things go wrong...
|-----|-----|-----|
| | | |
| NT |-----|-----|
| | | |
|-----|-----|-----|
That's not the end of the world. The real problem is when I close a couple of splits it ends up like this...
|--------|--------|
| | |
| NT |--------|
| | |
|--------|--------|
... which is just silly and I have to exit Vim and start over.
I use Ctrl-w followed by = to carry out the equal resizing of vim splits.
I think this is a bug, perhaps in NERDTree. There is a "change of state" that causes this problem to start happening. It is when you do a Ctrl-w followed by 'o' to maximize one of the splits. I've reported this as an issue in the NERDTree github project at https://github.com/scrooloose/nerdtree/issues/644

How to convert split windows to tabs and vice versa in Vim

For example, I use 3 split windows to open 3 different files:
+---------------+-----------+
| | |
| window 1 | |
| | |
+---------------+ |
| | window 3 |
| | |
| window 2 | |
| | |
| | |
+---------------+-----------+
Now, I want to open them with 3 different tabs and vice versa
Is there any trick to achieve this? Or do I need any plugin?
Besides, if I want to display 3 buffers in 3 full screen windows (as opposed to a split window), what should I do?
Not sure if there is a plugin, which will do all splits at once. But there is a way to do it one at a time
For moving the current split into a new tab use
ctrl + w, T (shift + t)
repeat the above process for all splits.
Now for getting the tab in to split, you can make use of a plugin call "Tabmerge", download Tabmerge.vim from http://www.vim.org/scripts/script.php?script_id=1961 to ~/.vim/plugin
then to merge the tab use :Tabmerge [tab number] [top|bottom|left|right]
If you are careful with your buffer list, you can use :sball and :tab sball to open in windows or tabs, respectively.

Cucumber scenario with quotes in the text

I'd like to have quotes in my scenario data. It's not working when that data has quotes in it. An example modified from The Cucumber Book would be:
Then I should see the "<message>" message
Examples:
| type | message |
| Swiss | I love Swiss cheese |
| Blue | I love "Blue" cheese |
| Cheddar | I love Cheddar cheese |
In my particular case I get an undefined step definition message because of "Blue" in the second scenario above. Is there a way I should be escaping the quotes? (I've tried backslashes but that didn't make any difference.)
My guess is that your current step definition looks like:
Then /I should see the "([^"]+)" message/ do |message|
p message
end
The [^"] tells the regex to match anything except double-quotes. This would be why your "Blue" example does not match.
Given that you are only looking for one argument, it would be safe to do:
Then /I should see the "(.*)" message/ do |message|
p message
end
Using (.*) would match everything between the quotes, including the quotes around Blue.

Resources