# Tag Info

16

To help answer your original question, you can check where a setting was last set with the :verbose command. :verbose set conceallevel This will display a message similar to: conceallevel=2 Last set from ~/.vim/plugged/indentLine/after/plugin/indentLine.vim Note that :verbose simply runs a command with a specified verbosity, so if you wish to check ...

14

You could try the following command: :let c=0 | g/^* /let c+=1 | s//\=c.'. ' First it initializes the variable c (let c=0), then it executes the global command g which looks for the pattern ^* (a beginning of line, followed by an asterisk and a space). Whenever a line containing this pattern is found, the global command executes the command: let c+=1 | s//...

13

Those chars are hidden because the conceal feature as you can see on the vim-markdown source. You can adjust how to this feature is applied to text using the option conceallevel. Setting it to 0 will always show the text. :set conceallevel=0

10

While I mostly agree with @romainl comment (markdown was made to be explicit enough not to need a preview) you can do this in different ways: [OSX / Unix] The instant-markdown plugin is a solution. You need to have node.js installed and to use the following command: [sudo] npm -g install instant-markdown-d You also need to have the packages xdg-utils, ...

9

In the past I had similar problem with function signatures. Here is solution adapted to your problem. Add to .vimrc: au CursorMovedI *.md call ModifyTextWidth() " Use only within *.md files function! ModifyTextWidth() if getline(".")=~'^.*$.*$(.*)$' " If the line ends with Markdown link - set big value for textwidth setlocal textwidth=500 ... 9 This only works with a recent Vim version (that has :h v_g_CTRL-A): Block-select the list bullets (*) and replace them with 0 (cursor is on first *): Ctrl-v j j r 0. Reselect previous block and increment with counter: gv g Ctrl-a ... and that's it :) (If you want to have a dot after each number, change 1st step to: Ctrl-v j j s 0 . Esc) 9 Visually select the lines and execute this substitution command: :'<,'>s/*/\=line('.') - line("'<") + 1 . '.' See :help sub-replace-expression, :help line(), and :help '<. To avoid having to select the lines, backward and forward searches with offsets can be used to specify the substitution range like this: :?^[^*]?+1,/^[^*]/-1s/*/\=line('.') ... 8 Since you don't have wrapping for comments enabled, the workaround in this Stack Overflow post can be used: set comments+=n:# set fo+=q This adds # as a comment marker (allowing nesting, so that ##, ###, etc. also count). I'd suggest leaving a space after # and using nb:# - some Markdown parsers require a space after #. The CommonMark spec also supports ... 7 This function is not thoroughly tested but it should provide a good enough bootstrap for your own experiments. In ~/.vim/after/ftplugin/markdown.vim: function! s:MDGoToSection() let raw_filename = expand('<cfile>') let arg = substitute(raw_filename, '$$[^#]*$$$$#\{1,6\}$$$$[^#]*$$', '+\/\2\\\\s\3 \1', 'g') execute "edit" arg endfunction ... 7 Ok, I found the plugin involved into this: is indentLine. It is reported in its README: it does not work if conceallevel is not set to 1 or 2, so it set this parameter to 2 by default. The side effect is that markdown files are terribly displayed, and you cannot edit them confortably... I found it out debugging my init.vim thanks to lsrdg link suggestion. ... 6 Quick answer: syntax match Todo "\s$" syntax match Error "\s\{2}$" syntax match Visual "\s\{3,}$" This uses match groups already available from your colorscheme to highlight differently 1,2 or 3+ trailing spaces. You can define your own match groups instead (with more meaningful names for your usage and colored as you please) - see h: match for a quick ...

6

Vim already comes with Markdown support so what happens is that you have two Markdown ftplugins doing the same thing. Since you "fixed" one (~/.vim/ftplugin/markdown.vim) without "fixing" the other ($VIMRUNTIME/ftplugin/markdown.vim), your fix is simply overridden by the built-in ftplugin. If you insist on disabling HTML support in markdown buffers you can ... 6 The original regex is ?^==\\+$ which means, searching backwards (?) for start-of-line (^), followed by =, followed by another = which can be repeated several times (\+ qualifier, followed by end-of-line (\$). The backslash needs to be doubled, because the regex is embedded into a double-quoted string, read :h expr-quote why this is needed). If you want to ...

5

Markdown has a concept of a "paragraph" different from that of MS Word. In MS Word, all text wrapping is "soft wrapped"—that is, you keep typing text without pressing "Enter" (or "Return") until you have finished an entire paragraph. In Markdown, you can do that, but more often markdown source will be "hard wrapped"—in other words, while typing a paragraph ...

5

Try something like that: highlight htmlBold gui=bold guifg=#af0000 ctermfg=124 highlight htmlItalic gui=italic guifg=#ff8700 ctermfg=214

5

Even simpler: the a flag for 'formatoptions' enables automatic formatting of paragraphs whenever text is inserted or deleted. See :help fo-table for details on 'formatoptions' flags and :help autoformat. :set formatoptions+=a gq and gw will format the lines that the following motion moves over. Formatting is done with one of three methods: ...

4

If you're willing to change the way you write your Markdown slightly, you could fix this simply by introducing an extra blank line between your headings and the following text: # this is a h1 this is the text of the file i want to reformat This is how I personally format my atx-style Markdown headers, anyway: I think it looks better and is easier to read.

4

Vim creates marks for the beginning and the end of the last visual selection in the current buffer. You can use '< to move to the beginning and '> to move to end. In this way you can conveniently add any text you want before and after the visual selection. For example, I have a map for inserting a LaTeX underline command that spans the current visual ...

4

Maybe you could try defining a custom object li for list item. This way you could operate on it with any operator including >. A way to do that is to define a visual mapping with :xnoremap which selects your object. Then you would define your list item object with :onoremap li :normal vli<CR>. The :onoremap mapping would tell Vim that whenever ...

4

By default, the asterisk is one of the comment leaders, and the formatoptions setting defaults to having c and q in it. The q and comments is what you are running into. You can remove q from formatoptions like this: set fo-=q or unset the comment leaders: set comments= (note: no space or anything after the equals) You can set up your vimrc (or ...

4

The 'mail' ft plugin (at least in vim 7.4) does this by making '>' a comment leader, like this: set comments+=n:> The "n:" means that they can be nested, as they often are in email. You probably don't need that, but might want some of the other options, like 'b' to require a space after the leader set comments+=b:> or, for just plain, do set ...

4

Mathematical equations cannot be displayed in Vim in this way: Vim has no means of rendering them, as @BLayer explains in his answer. However, mathematical symbols you can indeed display using Vim's conceal feature, as you suggest in your tags. The following commands will replace various mathsy HTML entities with their corresponding Unicode characters: :...

3

Markdown folding: As ana found out, for markdown specifically make sure that you have let g:markdown_folding = 1 or folding wont be "turned on". General folding tips: Vim won't fold automatically, try putting your cursor over the text and doing zc. This should close the fold. If you want some visual context even when it's not folded try the foldcolumn ...

3

As I said in the comments on my setup gf didn't opened the file because # was in isfname, so using set isfname-=# allowed gf to jump to the file. As I also said I think the feature to go to a section of the file is not built in so you can try this function: function! MarkdownGF() " Get the filename under the cursor let cfile=expand('<cfile>') ...

3

Adding/removing/toggling comments is a common request. As such there are a few approaches Commenting Plugins Using a plugin like commentary (which I use), Nerd Commenter, EnhCommentify, tComment, ..., etc make managing comments for all sorts of filetypes much easier as well has giving a consistent interface. For example commentary use gcc to toggle an ...

3

If you have known start and end delimiters, you should use regions (:h :syn-region): syntax region Emphasis start="\\\@<!\z(_\)" skip="\%(\s\|\\\)\@<=\z1\|\z1\k" end="\\\@<!\z1" keepend contains=Strong,Strike syntax region Strong start="\\\@<!\z(\*\)" skip="\%(\s\|\\\)\@<=\z1\|\z1\k" end="\\\@<!\z1" keepend contains=Emphasis,Strike syntax ...

3

The default Vim syntax file for markdown does not define any regions that should be folded. If you set foldmethod in your .vimrc to syntax, then that means, syntax based folding does not work for markdown. If a plugin did set it, you might want to check with the author of the plugin, why syntax based folding does not work for you. You can check, where this ...

3

The following solution should work on most Linux systems. It requires a relatively updated xclip tool. For a solution that works on MacOS/OSX, see @Rich's answer. I've proposed a solution that maps <leader>p instead of remapping p, since I think this is a much saner approach. The function SaveFile will inspect the clipboard with xclip. If there is an ...

3

My interpretation is that the OP is looking for rendering of markup into fancy, graphical depictions of equations and formulae. If instead the question is about simple substitutions of Unicode mathematical characters then @Rich has a nice answer. vim is a text editor. It can display parallel, uniformly sized and spaced rows of Unicode characters and ...

3

This is the expected behavior of the plugin when you create a file in your vimwiki the filetype is set to vimwiki. If you don't want files created outside of the wiki directory to have this filetype you can follow this issue and add the following line to your .vimrc: let g:vimwiki_global_ext = 0

Only top voted, non community-wiki answers of a minimum length are eligible