|
1 | 1 | " The default vimrc file. |
2 | 2 | " |
3 | 3 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 | | -" Last change: 2017 Jun 13 |
| 4 | +" Last change: 2019 Jan 26 |
5 | 5 | " |
6 | 6 | " This is loaded if no vimrc file was found. |
7 | 7 | " Except when Vim is run with "-u NONE" or "-C". |
@@ -90,33 +90,28 @@ if &t_Co > 2 || has("gui_running") |
90 | 90 | let c_comment_strings=1 |
91 | 91 | endif |
92 | 92 |
|
93 | | -" Only do this part when compiled with support for autocommands. |
94 | | -if has("autocmd") |
95 | | - |
96 | | - " Enable file type detection. |
97 | | - " Use the default filetype settings, so that mail gets 'tw' set to 72, |
98 | | - " 'cindent' is on in C files, etc. |
99 | | - " Also load indent files, to automatically do language-dependent indenting. |
100 | | - " Revert with ":filetype off". |
101 | | - filetype plugin indent on |
102 | | - |
103 | | - " Put these in an autocmd group, so that you can revert them with: |
104 | | - " ":augroup vimStartup | au! | augroup END" |
105 | | - augroup vimStartup |
106 | | - au! |
107 | | - |
108 | | - " When editing a file, always jump to the last known cursor position. |
109 | | - " Don't do it when the position is invalid, when inside an event handler |
110 | | - " (happens when dropping a file on gvim) and for a commit message (it's |
111 | | - " likely a different one than last time). |
112 | | - autocmd BufReadPost * |
113 | | - \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' |
114 | | - \ | exe "normal! g`\"" |
115 | | - \ | endif |
116 | | - |
117 | | - augroup END |
118 | | - |
119 | | -endif " has("autocmd") |
| 93 | +" Enable file type detection. |
| 94 | +" Use the default filetype settings, so that mail gets 'tw' set to 72, |
| 95 | +" 'cindent' is on in C files, etc. |
| 96 | +" Also load indent files, to automatically do language-dependent indenting. |
| 97 | +" Revert with ":filetype off". |
| 98 | +filetype plugin indent on |
| 99 | + |
| 100 | +" Put these in an autocmd group, so that you can revert them with: |
| 101 | +" ":augroup vimStartup | au! | augroup END" |
| 102 | +augroup vimStartup |
| 103 | + au! |
| 104 | + |
| 105 | + " When editing a file, always jump to the last known cursor position. |
| 106 | + " Don't do it when the position is invalid, when inside an event handler |
| 107 | + " (happens when dropping a file on gvim) and for a commit message (it's |
| 108 | + " likely a different one than last time). |
| 109 | + autocmd BufReadPost * |
| 110 | + \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' |
| 111 | + \ | exe "normal! g`\"" |
| 112 | + \ | endif |
| 113 | + |
| 114 | +augroup END |
120 | 115 |
|
121 | 116 | " Convenient command to see the difference between the current buffer and the |
122 | 117 | " file it was loaded from, thus the changes you made. |
|
0 commit comments