@@ -62,7 +62,7 @@ autocmd BufNewFile,BufReadPost *.md set filetype=markdown
62
62
autocmd BufNewFile ,BufReadPost * if &filetype == " " | setlocal filetype = text | endif
63
63
64
64
" Set tabstop shiftwidth expandtab listchars
65
- autocmd FileType * set ts = 2 | set sw = 2 | set et | set lcs = tab :▒░ | set list
65
+ autocmd FileType * set ts = 2 | set sw = 2 | set et | set lcs = tab :▒░ | set list | call s: UpdateReadingMode ()
66
66
autocmd FileType go,make set noet | set nolist
67
67
autocmd FileType go,make,proto,markdown set ts = 4 | set sw = 4
68
68
@@ -125,6 +125,27 @@ nmap <leader>= :vertical resize +2<CR>
125
125
" reset all error checking: Stop the highlighting, close locationlist
126
126
noremap <esc><esc><esc><esc> :nohl<cr> :lclose<cr>
127
127
128
+ " reading mode
129
+ function ! s: UpdateReadingMode ()
130
+ if exists (' t:reading' ) && t :reading
131
+ set nolist
132
+ ShowTrailingWhitespaceOff
133
+ else
134
+ set list
135
+ ShowTrailingWhitespaceOn
136
+ endif
137
+ endfunc
138
+ function ! s: ToggleReadingMode ()
139
+ if exists (' t:reading' ) && t :reading
140
+ let t :reading = 0
141
+ else
142
+ let t :reading = 1
143
+ endif
144
+ call s: UpdateReadingMode ()
145
+ endfunc
146
+ command ! ToggleReadingMode call s: ToggleReadingMode ()
147
+ noremap <space><space><space><space> :ToggleReadingMode<CR>
148
+
128
149
" =========================================================
129
150
set rtp += ~/.vim/bundle/Vundle.vim " set the runtime path to include Vundle and initialize
130
151
call vundle#begin (' ~/.vim/bundle' ) " Specify a directory for plugins: begin('~/some/path/here')
@@ -216,6 +237,11 @@ let g:multi_cursor_skip_key='<C-x>'
216
237
let g: multi_cursor_prev_key= ' <C-e>'
217
238
let g: multi_cursor_quit_key= ' <Esc>'
218
239
240
+ " =========================================================
241
+ " Configuration: vim-scripts/ShowTrailingWhitespace
242
+ command ! - bar ShowTrailingWhitespaceOn call ShowTrailingWhitespace#Set (1 ,1 )
243
+ command ! - bar ShowTrailingWhitespaceOff call ShowTrailingWhitespace#Set (0 ,1 )
244
+
219
245
" =========================================================
220
246
" Configuration: mileszs/ack.vim
221
247
" Just like |:Ack| but instead of the |quickfix| list,
0 commit comments