summaryrefslogtreecommitdiffstats
path: root/.vim/luke/prose.vim
blob: cf9470e086e42fc4fddb709ad064800d2c540ae1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
let g:ProseOn=0

function! ToggleProse()
    if !g:ProseOn
        call Prose()
    else
        call ProseOff()
    endif
endfunction

function! Prose()
    echo "Prose: On"
    let g:ProseOn=1

    noremap j gj
    noremap k gk
    noremap 0 g0
    noremap $ g$
    noremap A g$a
    noremap I g0i
    setlocal linebreak nonumber norelativenumber t_Co=0 foldcolumn=2
    hi! link FoldColumn Normal

endfunction

function! ProseOff()
    echo "Prose: Off"
    let g:ProseOn=0

    noremap j j
    noremap k k
    noremap 0 0
    noremap $ $
    noremap A A
    noremap I I
    setlocal nolinebreak number relativenumber t_Co=256 foldcolumn=0

endfunction