@@ -10,94 +10,94 @@ endif
10
10
11
11
" No need to duplicate work
12
12
if exists (' g:loaded_sensible' )
13
- finish
13
+ finish
14
14
endif
15
15
16
16
" Code taken from https://github.com/tpope/vim-sensible
17
17
" and (mostly comments) from https://github.com/sheerun/vimrc
18
18
"
19
19
" Only settings that matter for proper editing are left
20
20
if ! exists (' g:polyglot_disabled' ) || index (g: polyglot_disabled , ' sensible' )
21
- " Autoindent when starting new line, or using `o` or `O`.
22
- set autoindent
23
-
24
- " Allow backspace in insert mode.
25
- set backspace = indent ,eol ,start
26
-
27
- " Allow for mappings including `Esc`, while preserving
28
- " zero timeout after pressing it manually.
29
- " (only vim needs a fix for this)
30
- if ! has (' nvim' ) && &ttimeoutlen == -1
31
- set ttimeout
32
- set ttimeoutlen = 100
33
- endif
21
+ " Autoindent when starting new line, or using `o` or `O`.
22
+ set autoindent
23
+
24
+ " Allow backspace in insert mode.
25
+ set backspace = indent ,eol ,start
26
+
27
+ " Allow for mappings including `Esc`, while preserving
28
+ " zero timeout after pressing it manually.
29
+ " (only vim needs a fix for this)
30
+ if ! has (' nvim' ) && &ttimeoutlen == -1
31
+ set ttimeout
32
+ set ttimeoutlen = 100
33
+ endif
34
34
35
- " Enable highlighted case-insensitive incremential search.
36
- set incsearch
35
+ " Enable highlighted case-insensitive incremential search.
36
+ set incsearch
37
37
38
- " Use utf-8 encoding by default
39
- set encoding = utf- 8
38
+ " Use utf-8 encoding by default
39
+ set encoding = utf- 8
40
40
41
- " Set default whitespace characters when using `:set list`
42
- if &listchars == # ' eol:$'
43
- set listchars = tab :>\ ,trail: - ,extends: >,precedes: <,nbsp:+
44
- endif
41
+ " Set default whitespace characters when using `:set list`
42
+ if &listchars == # ' eol:$'
43
+ set listchars = tab :>\ ,trail: - ,extends: >,precedes: <,nbsp:+
44
+ endif
45
45
46
- " Delete comment character when joining commented lines
47
- if v: version > 703 || v: version == 703 && has (" patch541" )
48
- set formatoptions += j
49
- endif
46
+ " Delete comment character when joining commented lines
47
+ if v: version > 703 || v: version == 703 && has (" patch541" )
48
+ set formatoptions += j
49
+ endif
50
50
51
51
" Search upwards for tags file instead only locally
52
52
if has (' path_extra' )
53
- setglobal tags -= ./tags tags-=./ tags ; tags ^= ./tags ;
53
+ setglobal tags -= ./tags tags-=./ tags ; tags ^= ./tags ;
54
+ endif
55
+
56
+ " Fix issues with fish shell
57
+ " https://github.com/tpope/vim-sensible/issues/50
58
+ if &shell = ~# ' fish$' && (v: version < 704 || v: version == 704 && ! has (' patch276' ))
59
+ set shell = /usr/ bin /env\ bash
60
+ endif
61
+
62
+ " Reload unchanged files automatically.
63
+ set autoread
64
+
65
+ " Increase history size to 1000 items.
66
+ if &history < 1000
67
+ set history = 1000
68
+ endif
69
+
70
+ " Allow for up to 50 opened tabs on Vim start.
71
+ if &tabpagemax < 50
72
+ set tabpagemax = 50
73
+ endif
74
+
75
+ " Always save upper case variables to viminfo file.
76
+ if ! empty (&viminfo )
77
+ set viminfo ^= !
78
+ endif
79
+
80
+ " Don't save options in sessions and views
81
+ set sessionoptions -= options
82
+ set viewoptions -= options
83
+
84
+ " Allow color schemes to do bright colors without forcing bold.
85
+ if &t_Co == 8 && $TERM !~# ' ^Eterm'
86
+ set t_Co = 16
54
87
endif
55
88
56
- " Fix issues with fish shell
57
- " https://github.com/tpope/vim-sensible/issues/50
58
- if &shell = ~# ' fish$' && (v: version < 704 || v: version == 704 && ! has (' patch276' ))
59
- set shell = /usr/ bin /env\ bash
60
- endif
61
-
62
- " Reload unchanged files automatically.
63
- set autoread
64
-
65
- " Increase history size to 1000 items.
66
- if &history < 1000
67
- set history = 1000
68
- endif
69
-
70
- " Allow for up to 50 opened tabs on Vim start.
71
- if &tabpagemax < 50
72
- set tabpagemax = 50
73
- endif
74
-
75
- " Always save upper case variables to viminfo file.
76
- if ! empty (&viminfo )
77
- set viminfo ^= !
78
- endif
79
-
80
- " Don't save options in sessions and views
81
- set sessionoptions -= options
82
- set viewoptions -= options
83
-
84
- " Allow color schemes to do bright colors without forcing bold.
85
- if &t_Co == 8 && $TERM !~# ' ^Eterm'
86
- set t_Co = 16
87
- endif
88
-
89
- " Load matchit.vim, but only if the user hasn't installed a newer version.
90
- if ! exists (' g:loaded_matchit' ) && findfile (' plugin/matchit.vim' , &rtp ) == # ' '
91
- runtime ! macros/matchit.vim
92
- endif
93
-
94
- " `Ctrl-U` in insert mode deletes a lot. Use `Ctrl-G` u to first break undo,
95
- " so that you can undo `Ctrl-U` without undoing what you typed before it.
96
- if empty (mapcheck (' <C-U>' , ' i' ))
97
- inoremap <C-U> <C-G> u<C-U>
98
- endif
99
-
100
- if empty (mapcheck (' <C-W>' , ' i' ))
101
- inoremap <C-W> <C-G> u<C-W>
102
- endif
89
+ " Load matchit.vim, but only if the user hasn't installed a newer version.
90
+ if ! exists (' g:loaded_matchit' ) && findfile (' plugin/matchit.vim' , &rtp ) == # ' '
91
+ runtime ! macros/matchit.vim
92
+ endif
93
+
94
+ " `Ctrl-U` in insert mode deletes a lot. Use `Ctrl-G` u to first break undo,
95
+ " so that you can undo `Ctrl-U` without undoing what you typed before it.
96
+ if empty (mapcheck (' <C-U>' , ' i' ))
97
+ inoremap <C-U> <C-G> u<C-U>
98
+ endif
99
+
100
+ if empty (mapcheck (' <C-W>' , ' i' ))
101
+ inoremap <C-W> <C-G> u<C-W>
102
+ endif
103
103
endif
0 commit comments