1.进入mac终端,输入如下命令
cd /usr/share/vim/
2. 打开文件vimrc,注意使用sudo
sudo vim vimrc
3. 输入你的密码
进入vimrc界面
在命令 set backspace=2 后main插入下面的命令
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("&#39;\"") > 0 && line ("&#39;\"") <&#61; line("$") |
\ exe "normal g&#39;\"" |
\ endif |
\ endif
4.保存并退出&#xff0c;就可以了