vim – Matchit不工作

前端之家收集整理的这篇文章主要介绍了vim – Matchit不工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Macvim 7.3快照57.我似乎没有得到匹配在任何我的文件中工作。

我打开标签上的%。它不需要我到结束标签

我的vimrc文件

  1. " Pathogen settings
  2. call pathogen#runtime_append_all_bundles()
  3. call pathogen#helptags()
  4.  
  5. set nocompatible
  6.  
  7. set number
  8. set ruler
  9. set cursorline
  10. Syntax on
  11.  
  12. " Disable all blinking
  13. set guicursor+=a:blinkon0
  14.  
  15. " Whitespace stuff
  16. set nowrap
  17. set tabstop=2
  18. set shiftwidth=2
  19. set expandtab
  20. set cindent
  21. set smartindent
  22. set autoindent
  23. set list listchars=tab:\ \,trail:·
  24.  
  25. " Searching
  26. set hlsearch
  27. set incsearch
  28. set ignorecase
  29. set smartcase
  30.  
  31. " Status bar
  32. set laststatus=2
  33.  
  34. " Start without the toolbar
  35. set guioptions-=T
  36.  
  37. " Default gui color scheme
  38. " "color default
  39. " color molokai
  40. color railscasts+
  41.  
  42. " Command-/ to toggle comments
  43. map <D-/> :TComment<CR>j
  44.  
  45. " Remember last location in file
  46. if has("autocmd")
  47. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  48. \| exe "normal g'\"" | endif
  49. endif
  50.  
  51. " Thorfile,Rakefile and Gemfile are Ruby
  52. au BufRead,BufNewFile {Gemfile,Rakefile,Thorfile,config.ru} set ft=ruby
  53.  
  54. " Open split buffers below instead of above current buffer
  55. set splitbelow
  56.  
  57. " Session options
  58. let g:session_autoload = 1
  59. let g:session_autosave = 1
  60.  
  61. " Buffer navigation
  62. map <C-K> <C-W><C-K>
  63. map <C-J> <C-W><C-W>
  64. map <C-H> <C-W><C-H>
  65. map <C-L> <C-W><C-L>
  66.  
  67. " Rails navigation options
  68. nmap <leader>rc :Rcontroller
  69. nmap <leader>rv :Rview
  70. nmap <leader>rm :Rmodel
  71.  
  72. " Tab completion
  73. " Also needed for better Rails navigation auto-completion
  74. set wildmode=list:longest,list:full
  75.  
  76. " Open up side panel left (NERDTree) and right(Tagbar)
  77. " nmap <leader>\ :NERDTreeToggle<CR> :TagbarToggle<CR>
  78. nmap <leader>\ :call ToggleNERDTreeAndTagbar()<CR>
  79.  
  80. " Allow single click for NERDTree
  81. let NERDTreeMouseMode = 3
  82. let g:NERDTreeWinSize = 30
  83. " autocmd VimEnter * NERDTree
  84.  
  85. " Tagbar options
  86. let tagbar_singleclick = 1
  87. let g:tagbar_sort = 0
  88. let g:tagbar_width = 30
  89. " autocmd VimEnter * nested TagbarOpen
  90.  
  91. " The Janus plugin sets this to noequalalways for the Zoominfo plugin
  92. " However,we want to set this to equalalways instead,since we want to
  93. " have equal window height when a new window is opened. i.e. via ctrl+w+s
  94. set equalalways
  95.  
  96. " Matchit already installed in newer versions of vim.
  97. " Don't need to add this onto pathogen bundle folder. We only need
  98. " to configure it.
  99. " Configure matchit so that it goes from opening tag to closing tag
  100. au FileType html,eruby,rb,css,js,xml runtime! macros/matchit.vim
  101.  
  102. " Set backup and swp dir. Don't forget to clear tmp dir out once in a while
  103. set backupdir=~/.vim/tmp/backup
  104. set directory=~/.vim/tmp/swp
  105.  
  106. " Detect if a tab was closed,and ensure that height of main window fills the screen (100% height)
  107. au TabEnter * let &lines = 100
  108.  
  109. " <leader>\ to open or close NERDTree and Tagbar,under the following conditions:
  110. " 1) Only close both if NERDTree and Tagbar are both opened
  111. " 2) Open both if NERDTree and Tagbar are closed OR if one is already opened
  112. function! ToggleNERDTreeAndTagbar()
  113. let w:jumpbacktohere = 1
  114.  
  115. " Detect which plugins are open
  116. if exists('t:NERDTreeBufName')
  117. let nerdtree_open = bufwinnr(t:NERDTreeBufName) != -1
  118. else
  119. let nerdtree_open = 0
  120. endif
  121. let tagbar_open = bufwinnr('__Tagbar__') != -1
  122.  
  123. " Perform the appropriate action
  124. if nerdtree_open && tagbar_open
  125. NERDTreeClose
  126. TagbarClose
  127. elseif nerdtree_open
  128. TagbarOpen
  129. elseif tagbar_open
  130. NERDTree
  131. else
  132. NERDTree
  133. TagbarOpen
  134. endif
  135.  
  136. " Jump back to the original window
  137. for window in range(1,winnr('$'))
  138. execute window . 'wincmd w'
  139. if exists('w:jumpbacktohere')
  140. unlet w:jumpbacktohere
  141. break
  142. endif
  143. endfor
  144. endfunction
The page of the matchit plugin说:

确保你有一条线

  1. :filetype plugin on

在你的vimrc文件。这使得文件类型插件,其中许多说明matchit.vim匹配对使用。

猜你在找的Bash相关文章