Vim Utility Plugin

Source: Internet
Author: User
Tags prototype definition sorted by name tag name

The IDE under Windows has some useful features, such as Sourceinsight Shift-f8 highlighting, ctrl-m viewing bookmarks, codeblocks F11 switching source and header files, quick code completion, source file Symbol window, Here are some plug-ins to enable vim to implement these functions, which can be directly copied to the. Vim/plugin directory. symbol highlighting

Mark.vim
http://www.vim.org/scripts/script.php?script_id=1238

<leader>m  mark or cancel the highlight of the symbol on the cursor
<leader>n  If the symbol at the cursor is highlighted, clear the highlight of the current word, or clear all the symbols
Mark strengthening

Showmarks
http://www.vim.org/scripts/script.php?script_id=152

After you set a tag, it displays the name of the tag in your Vim window and highlights the line.
Configuration:

Let
showmarks_enable = 1
"show which marks let
showmarks_include =" ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ "
" "hilight Lower & Upper marks let
showmarks_hlline _lower = 1 Let
showmarks_hlline_upper = 1
"Ignore help, Quickfix, non-modifiable buffers let
Showmarks_igno Re_type = "HQM"

First, enable the plug-in to be showmarks, and then define Showmarks to show only all uppercase and lowercase tags, and highlight the two tags, the file type is help, Quickfix, and a buffer that cannot be modified, the location of the tag is not displayed.

Showmarks has defined some shortcut keys:

<LEADER>MT   -Open/close Showmarks plugin
<leader>mo   -Force open Showmarks plug-in
<LEADER>MH   -Clears the tag for the current line
<leader>ma   -Clears all tags in the current buffer
<leader>mm   

Marks browser:a Graphical Marks Browser
http://www.vim.org/scripts/script.php?script_id=1706

Use the: Marksbrowser command to open the Browse window, enter a sign, press D to remove the tag.
If you want to keep the tag Browse window open continuously, add in VIMRC:

Let marksclosewhenselected = 0 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
"" "" "" "" "
nmap <silent> <leader>mk:MarksBrowser<cr>
header file Jump

A.vim
Http://www.vim.org/scripts/script.php?script_id=31
Switch between source file and header file

: A  Source file header file switching
: As up and down partition window after switching
: AV vertical split window after switching
: At the new label switch

to the cursor where the word as the filename open
: IH  switch to the cursor file
: IHS split window after switch to the cursor file
: IHV vertical split window after switching
: IHT new label after switching
symbol Window

Taglist.vim:Source Code Browser (supports C + +, Java, Perl, Python, Tcl, sql, PHP, etc)
http://www.vim.org/scripts/script.php?script_id=273

Download the zip file and unzip, put Taglist.vim into the plugin directory, taglist.txt into the doc directory, into the doc directory, in Vim to execute: helptags command to add Help files.

Let Tlist_show_one_file = 1         "does not display tag for multiple files at the same time, only displays the current file's let
Tlist_exit_onlywindow = 1       " If the TagList window is the last window, Then quit vim let
Tlist_use_right_window = 1 to      display the TagList window in the right window, which is the default

Run under the VIM command line: The Tlisttoggle command can open the TagList window and run again: Tlisttoggle closes.

Setting Tlist_sort_type to "name" allows the taglist to be sorted by tag name, which is sorted by default in the order in which the tag appears in the file.
If you want to automatically open the TagList window after you start vim, set the Tlist_auto_open to 1.
If you want to automatically close the TagList window after you select the tag, set Tlist_close_on_select to 1.
When you use: Tlisttoggle to open the TagList window, if you want the input focus to be in the TagList window, set Tlist_gainfocus_on_toggleopen to 1.
Tlist_winheight and Tlist_winwidth can set the height and width of the taglist window. Tlist_use_horiz_window 1 Sets the TagList window to display horizontally.

The following commands are supported in the tag window:

<CR>          jump to the cursor at the position defined by tag to             preview the tag definition, but do not jump
o             in a newly opened window to display the cursor under the tag
<Space>       Display the cursor under the tag's prototype definition
u             Update taglist window in the tag
s             change sort, in sorted by name and in order of occurrence to switch between the
x             taglist window zoom in and zoom out, Easy to view longer tag
+             Open a folded, with Zo
-fold the             tag up, with ZC
*             Open all folded, with zr
=             fold All the tags together, with ZM
q             Close taglist window
<F1>          Show Help
Supertab

Supertab:do all your insert-mode completion with Tab.
http://www.vim.org/scripts/script.php?script_id=1643

Supertab use is very simple, as long as the input variable name or path name, such as the TAB key, you can get the list of previously entered symbols, and through the tab cycle selection.

About the complement method see also: Help Ins-completion
Ctrl-n and ctrl-p keyword completion
Ctrl-x,ctrl-] According to the tag complement

Add these two sentences to your ~/.VIMRC file:

Let g:supertabdefaultcompletiontype= "<C-X><C-]>"
setting Press <Tab> default complement method, default is <C-P>

Let g:supertabretaincompletiontype=2
"0-do not record the last complement mode
" 1-remember the last complement, until you change it with the other full command
"2-remember the last complementary way, Until you press ESC to exit insert mode
My Settings

The company's vim version is 6.3, and the above plugin only marks browser to support vim 7.
My configuration for these several plugins is:

"Showmarks let
showmarks_enable = 0 let
showmarks_include =" Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz "
nmap <leader>md <leader>mh

" Alternate Headfile
map <silent> <F11>:a<cr>

"TagList let
tlist_show_one_file = 1
Let Tlist_exit_onlywindow = 1
nmap tt:tlisttoggle<cr>

"markset
map <F8> <plug>markset

Showmarks if enabled, start Vim will be a period of time to highlight the bookmark, so the default to it off, feel the use of MD to delete a bookmark more reasonable point;
Use the F11 shortcut key to switch the header file, TT to open the TagList window;
Because of the Showmarks shortcut key, Markset <leader>m will have a delay time, so directly with F8 to highlight. Reference

http://blog.csdn.net/liuyuan185442111/article/details/51471093
http://blog.csdn.net/liuyuan185442111/ article/details/51485803
http://easwy.com/blog/archives/advanced-vim-skills-advanced-move-method/
http:/ /blog.csdn.net/vaqeteart/article/details/4146618
Http://easwy.com/blog/archives/ advanced-vim-skills-omin-complete/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.