tamasgal
tamasgal

Reputation: 26259

How to define a custom `textwidth` for BASH in VIM editing mode

The setting in my .vimrc is

set textwidth=79

however, this affects the BASH-prompt as well, since I'm using the vi editing mode.

Is there a way to set it for bash independently?

If not, is there an option to show somehow a ruler on the right side at the 79th column?

Upvotes: 2

Views: 191

Answers (1)

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200193

Setting textwidth only for files should do what you want. Change the line

set textwidth=79

into this:

if has("autocmd")
  autocmd FileType * set textwidth=79
endif

Upvotes: 2

Related Questions