aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2017-09-29 12:24:51 -0700
committerkatherine <shmibs@shmibbles.me>2017-09-29 12:24:51 -0700
commitcac1dda765feb39b2308b0dbc56c1da889e6216c (patch)
tree0e7a5860eb57d971b4e06025b275993399893264
parent27a5a4ad68430d1a983d54f97634a4c4c0b71e5d (diff)
downloaddotfiles-cac1dda765feb39b2308b0dbc56c1da889e6216c.tar.gz
add auto-wrapping mode toggle for tex/md/txt
-rw-r--r--.vimrc22
1 files changed, 19 insertions, 3 deletions
diff --git a/.vimrc b/.vimrc
index 75625f7..978db21 100644
--- a/.vimrc
+++ b/.vimrc
@@ -252,6 +252,16 @@ autocmd FileType text call Settings_text()
autocmd FileType vim call Settings_vim()
autocmd FileType zsh call Settings_shell()
+function! Settings_sub_wmodetoggle()
+ if &fo =~ 'a'
+ setlocal formatoptions-=a
+ echo 'wmode off'
+ else
+ setlocal formatoptions+=a
+ echo 'wmode on'
+ end
+endfunction
+
function! Settings_asm()
"settings
setlocal foldmethod=syntax
@@ -329,10 +339,11 @@ function! Settings_markdown()
setlocal shiftwidth=4
setlocal tabstop=4
setlocal softtabstop=4
- setlocal nojoinspaces "single-space sentences
+ setlocal nojoinspaces
setlocal spell
"mappings
nnoremap <buffer> -- O<Space>--><Esc>3hi<!--<Space>
+ nnoremap <buffer> <Leader>w :call Settings_sub_wmodetoggle()<CR>
endfunction
function! Settings_matlab()
@@ -382,6 +393,7 @@ function! Settings_tex()
setlocal noautoindent
setlocal nocindent
setlocal nosmartindent
+ setlocal nojoinspaces
setlocal shiftwidth=4
setlocal tabstop=4
setlocal softtabstop=4
@@ -391,17 +403,21 @@ function! Settings_tex()
nnoremap <buffer> <Leader>C :!latex -output-format=pdf "%"<CR>
nnoremap <buffer> <Leader>x :!xelatex -output-format=pdf "%"<CR><CR>
nnoremap <buffer> <Leader>X :!xelatex -output-format=pdf "%"<CR>
+ nnoremap <buffer> <Leader>w :call Settings_sub_wmodetoggle()<CR>
endfunction
function! Settings_text()
- setlocal formatoptions+=ta
+ "settings
+ setlocal formatoptions+=a
setlocal noautoindent
setlocal nocindent
setlocal nosmartindent
- setlocal nojoinspaces "single-space sentences
+ setlocal nojoinspaces
setlocal tabstop=4
setlocal softtabstop=4
setlocal spell
+ "mappings
+ nnoremap <buffer> <Leader>w :call Settings_sub_wmodetoggle()<CR>
endfunction
function! Settings_vim()