blob: a90c276507ca2d925d0c4b0114c09424438dcb23 (
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
39
40
|
" Don't wrap by default, but use \w to toggle it on or off quickly
set nowrap
nnoremap <silent>
\ <Leader>w
\ :<C-U>setlocal wrap! wrap?<CR>
" When wrapping text, if a line is so long that not all of it can be shown on
" the screen, show as much as possible anyway; by default Vim fills the left
" column with @ symbols instead, which I don't find very helpful
set display=lastline
" Clearly show when the start or end of the row does not correspond to the
" start and end of the line
set listchars+=precedes:<,extends:>
" When wrapping, j and k should move by screen row, and not to the same
" column number in the previous logical line, which feels very clumsy and is
" seldom particularly helpful; you can use n| to jump to the nth column in a
" line anyway if you need to
nnoremap j gj
nnoremap k gk
" Line break settings and mappings
if has('linebreak')
" Break lines at word boundaries if possible
set linebreak
" Precede continued lines with '...'
set showbreak=...
" If we have the option, indent wrapped lines as much as the first line
if exists('+breakindent')
set breakindent
endif
" \b toggles copy-pasteable linebreak settings
nmap <Leader>b <Plug>CopyLinebreakToggle
endif
|