[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 那如何让vim自动定¡酢酢酢?次编辑过涨鼽m呢



高超 wrote:
> 果然很好用,谢谢。
> 
> 那如何让vim自动定位到文件上次编辑过的位置呢?用redhat的时候,
> vim就是这样的,一个很方便的设计,但是装了debian/sid之后,这个
> 功能默认没有打开,怎么开启呢?
> 
> 在用户目录下存在.viminfo这个文件,并且vim的历史记录都保存在里
> 面了。
> 

将以下加入 .vimrc

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependentindenting.
  filetype plugin indent on

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal g`\"" |
    \ endif

endif " has("autocmd")

-- 
-Rex, geek by nature linux by choice
1024D/E3F86E4C = 36CE D9DD 46F4 2187 3C5C  927D D5D9 4B51 E3F8 6E4C

-- 
To UNSUBSCRIBE, email to debian-chinese-big5-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.



Reply to: