sponsor Vim development Vim logo Vim Book Ad

number marks : showing marks using number array in color, easy to trace.

 script karma  Rating 46/18, Downloaded by 3092  Comments, bugs, improvements  Vim wiki

created by
Hongli Gao
 
script type
utility
 
description
You can show your marks using number array in color, and you can delete one or all marks(now, you can replace a mark to another place). The color depend on your color scheme setting. You easy to trace the marks using hot key, move to ahead or behind. The mark's number make you easy to understand where you are. And you also can save and reload these marks in a file.

这个脚本显示用带颜色的数字标明的[标记],你可以删除你不想用的某个[标记],或者用F4键全部删掉所有的[标记](现在也可以把一个标记移动位置,而不改变他的数字标号)。带颜色的数字[标记]使你更容易了解当前行在代码中的位置,方便理解代码。[标记]的颜色依赖于你的颜色设定文件。不同的颜色风格可能又不同的[标记]颜色式样。你可以很方便的使用快捷键向前或者向后跟踪你的[标记]。你也可以保存你的[标记]到你指定的文件夹下面,然后以后再次打开所有的[标记]。

# 两个重要更新,移动标记和在不同的tab页之间跳转, 如果你有两个以上的tab页的话。
" ##  You can set marks only less 100.  ##
" ##  If you have more than two tabpage, you can jump from one tabpage to another one.  ##

这个脚本因为signs的显示的原因,所以只提供最大99个[标记]。

screenshot / 抓图
http://wiki.ubuntu.org.cn/images/b/b6/Vim_marks.PNG

USAGE:
1:make a mark, or delete it:
  ctrl + F2
  mm
2:move to ahead mark:          
  shift + F2
  mv
3:move to next mark:                          
  F2
  mb
4:delete all marks:
  F4
5:moving a mark:
  m.
  (press m. at the one mark, and move the cursor to another line, press m. again. )
6:save marks
  F6, input a name, press ENTER
7:reload marks
  F5, input a name, press ENTER

用法:
(下面所有的操作都是在非插入模式下,光标置于你要操作的行)
1:设定一个[标记],或者取消这个[标记]
    按Ctrl+F2 或者 mm (快速连着按两下m字母键)
2:向前移动
   按 shift + F2 或者 mv (快速按字母m和字母v键)
3:向后移动
   按 F2 或者 mb
4:取消所有的[标记]
    按F4键    (按取消后,再次标记时候重新从01到99开始标数)
5:移动一个[标记]
    把光标移动到一个有标记的行,按m. 这时这个标记改变颜色,
    然后把光标移到一个没有标记的行,再一次按m.  则把刚才的
   标记移动到当前行。
6:保存标记
   按F6,输入一个名称,按回车。
7:读入标记
   按F5,输入一个以保存过的名称,按回车。
 
install details
Unzip marks_corey.zip into your vim's plugin folder.
----------------------
" If you want to save the marks to a file. Do it like below:
" Put the one line
" let g:Signs_file_path_corey='c:\'
" into your gvimrc or _vimrc, change it to your path.
<F6>   # Save marks.
<F5>   # reload signs.

简单的解压这个压缩文件到你的vim的plugin文件夹下。
如果要使用[标记]保存功能,最好你要在你的gvimrc,或者_vimrc里面设置
let g:Signs_file_path_corey='c:\' <<你可以修改成你的有读写权限的文件夹。
<F6>   # 保存所有〔标记〕
<F5>   # 恢复所有〔标记〕

 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
marks_corey.zip 1.4 2010-08-27 7.3 Hongli Gao Afford two hotkeys,
<F5> load marks' file,
<F6> save marks to a file.

--NOTED  THIS------------------------
Add

let g:Signs_file_path_corey='c:'

to your gvimrc, change it to your path.
-----------------------------
提供两个新的快捷键,
按F5读入标记文件,
按F6保存标记到文件里。
-----------------------------------
注意,你的gvimrc文件里面需要加入以下一行。

let g:Signs_file_path_corey='c:'

并且改成你自己喜欢的目录。
marks_corey.zip 1.3 2009-08-27 7.0 Hongli Gao If the buffer is not in the buffer list the sign cannot be added when you reload the marks from a file.
当你重新读取保存在文件里的标记时,如果那个标记所在的buffer没有在当前的buffer list里面的时候,不能正确的显示标记。
marks_corey.zip 1.2 2008-04-14 7.0 Hongli Gao I'm sorry for updating frequently, this time only for optimizing!
1:reduce screen flash rate when jumping with tabpage.
2:reuse the biggest number for the marks.

抱歉这么频繁更新,这次是为了优化的目的!
1:当在tabpage之间跳转得时候,降低画面闪烁
2:重新使用被删除的最大号码,也就是在一处不停的使用mm,号码不再无限增长
marks_corey.zip 1.0 2008-04-12 7.0 Hongli Gao New functions, now you can moving a mark to another place.
and you can jump marks from one tabpage to another one,
this depends on whether you have more than two tabpages at one time, otherwise jumping will be in one window. So I call this copy 1.0.
But this not very good at two windows in one tabpage, I will improve it in future.

添加实用功能, 就是移动一个标记到另一个位置。
同时实现了在不同tabpage页中间跳转标记的功能。
如果你跳转标记的时候使用了两个以上的tab页,那么就在tab页之间
跳转,并且可以在新tab页里面打开当前没有打开的文件。
但是目前没有很好的实现一个tab页里面有多个窗口的问题。
以后解决这个问题。
marks_corey.zip 0.2 2008-03-25 7.0 Hongli Gao just unzip this file and cover your old version file.
解压后,覆盖原来的文件就可以。

fixed a makeing number bug, when you restore the marks from a file. Before this, you restore marks, then the script will makeing number from 01.

修复一个错误,读取保存在文件里的标记后,再次追加标记时,会重新开始从01编号。如果不使用标记保存功能不会有这个问题。
marks_corey.zip 0.1 2008-03-20 7.0 Hongli Gao Initial upload
ip used for rating: 3.142.53.68

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github