128

Vim with Markdown, how to remove blankspace after bullet point? - Stack Overflow

 6 years ago
source link: https://stackoverflow.com/questions/46876387/vim-with-markdown-how-to-remove-blankspace-after-bullet-point
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

2 Answers

Indenting a new line to match prior lines is a vim option autoindent, smartindent or cindent which you can turn off.


      *'autoindent'* *'ai'* *'noautoindent'* *'noai'*

'autoindent' 'ai' boolean (default off) local to buffer
Copy indent from current line when starting a new line (typing in Insert mode or when using the "o" or "O" command). If you do not type anything on the new line except or CTRL-D and then type , CTRL-O or , the indent is deleted again. Moving the cursor to another line has the same effect, unless the 'I' flag is included in 'cpoptions'.
When autoindent is on, formatting (with the "gq" command or when you reach 'textwidth' in Insert mode) uses the indentation of the first line.
When 'smartindent' or 'cindent' is on the indent is changed in a different way.
The 'autoindent' option is reset when the 'paste' option is set. {small difference from Vi: After the indent is deleted when typing or , the cursor position when moving up or down is after the deleted indent; Vi puts the cursor somewhere in the deleted indent}.


       *'smartindent'* *'si'* *'nosmartindent'* *'nosi'*

'smartindent' 'si' boolean (default off)
local to buffer
{not in Vi}
{not available when compiled without the
|+smartindent| feature}
Do smart autoindenting when starting a new line. Works for C-like programs, but can also be used for other languages. 'cindent' does something like this, works better in most cases, but is more strict, see |C-indenting|. When 'cindent' is on or 'indentexpr' is set, setting 'si' has no effect. 'indentexpr' is a more advanced alternative.
Normally 'autoindent' should also be on when using 'smartindent'. An indent is automatically inserted: - After a line ending in '{'.
- After a line starting with a keyword from 'cinwords'.
- Before a line starting with '}' (only with the "O" command).
When typing '}' as the first character in a new line, that line is given the same indent as the matching '{'.
When typing '#' as the first character in a new line, the indent for that line is removed, the '#' is put in the first column. The indent is restored for the next line. If you don't want this, use this mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
When using the ">>" command, lines starting with '#' are not shifted right.
NOTE: 'smartindent' is reset when 'compatible' is set. When 'paste' is set smart indenting is disabled.


         *'cindent'* *'cin'* *'nocindent'* *'nocin'*

'cindent' 'cin' boolean (default off)
local to buffer
{not in Vi}
{not available when compiled without the |+cindent| feature}
Enables automatic C program indenting. See 'cinkeys' to set the keys that trigger reindenting in insert mode and 'cinoptions' to set your preferred indent style.
If 'indentexpr' is not empty, it overrules 'cindent'. If 'lisp' is not on and both 'indentexpr' and 'equalprg' are empty, the "=" operator indents using this algorithm rather than calling an external program.
See |C-indenting|.
When you don't like the way 'cindent' works, try the 'smartindent' option or 'indentexpr'.
This option is not used when 'paste' is set.
NOTE: This option is reset when 'compatible' is set.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK