Thursday, March 27, 2014

Bullet lists autoformatting for text files in vim

In ~/.vim/after/ftplugin create a file text.vim containing
" Vim filetype plugin file
" Language: text
" Maintainer: Alexander Lobov 
" Last Change: 2014 Mar 27

" Only do this when not done yet for this buffer

if exists("b:did_ftplugin")
  finish
endif

" Don't load another plugin for this buffer
let b:did_ftplugin = 1

setlocal autoindent
setlocal formatoptions=tcroqln
The main strings are
setlocal autoindent
setlocal formatoptions=tcroqln
You .vimrc file should have
  filetype plugin indent on
line.

No comments:

Post a Comment