我似乎无法使任何xml.vim插件适用于我的vim设置。我尝试了两个(https://www.vim.org/scripts/script.php?script_id=1397及其前身https://www.vim.org/scripts/script.php?script_id=301)。他们似乎完全无功能。我试图从vim(:help xml C-d)中查看他们的文档,除了默认的xml语法帮助之外什么都没有出现。
我一直在使用病原体安装它们,标准方式(例如git clone https://github.com/sukima/xmledit.git ~/.vim/bundle/xmledit
)。安装完成后,我尝试打开一个test.xml文件来加载helptext,但没有结果。
我看到此处发布的其他问题没有解决方案,但它没有帮助:turn on xml.vim ftplugin in vim
那么,有谁知道为什么会出错?这是通过Windows子系统Linux在Ubuntu上运行的,但我有其他工作插件(tslime和vim-slime)。
编辑:在看了这个之后,我尝试了:脚本名和插件(当前xmledit)似乎不在其中,尽管bundle / xmledit目录位于runtimepath。以下是bundle / xmledit的内容:
xmledit/
├── build.vim
├── doc
│ └── xml-plugin.txt
├── ftplugin
│ ├── html.vim
│ ├── php.vim
│ ├── xhtml.vim
│ └── xml.vim
├── Makefile
├── README.mkd
└── tests
├── Gemfile
├── Gemfile.lock
├── Rakefile
├── README.md
└── spec
├── spec_helper.rb
└── xmledit_spec.rb
vim版本:7.4。包含补丁:1-1689,额外补丁:8.0.0056
.vimrc:
" mapleader definition has to be on top:
let mapleader="," " leader is comma
" necessary for pathogen:
execute pathogen#infect()
" the good settings:
set background=dark " obvious
set tabstop=4 " number of visual spaces per tab
set shiftwidth=4 " similar
set softtabstop=4 " number of spaces added/removed while editing
set expandtab " tabs become spaces
set smartindent " do smart indenting when starting a new line
set autoindent " copies previous indent when starting a newline
filetype indent on " makes filetype-based indenting work
set number " show line numbers
set wildmenu " cyclical menu for autocompletion
set showmatch " highlight matching bracket
set incsearch " search as you type
set hlsearch " highlight search results
" turn off search highlight
noremap <leader><space> :nohlsearch<CR>
" move vertically by visual line (don't skip over wrapped lines)
nnoremap j gj
nnoremap k gk
" highlight last inserted text - doesn't work??
" nnoremap gV `[v`]
" edit vimrc with ev
nnoremap <leader>ev :vsp ~/.vimrc<CR>
" load vimrc with sv
nnoremap <leader>sv :source ~/.vimrc<CR>
" save session (reopen with vim -S)
nnoremap <leader>s :mksession<CR>
" set html indentation lower:
autocmd FileType html setlocal softtabstop=2 shiftwidth=2 tabstop=2
" for scheme/lisp:
let g:tslime_ensure_trailing_newlines = 1
" don't use, but useful to have documented:
" set cursorline " highlight current line
" idk:
"highlight Normal ctermbg=LightGray
"syntax enable " enables syntax highlighting; not sure why this is disabled but it works anyway?
" FROM good vimrc
" CtrlP settings
"let g:ctrlp_match_window = 'bottom,order:ttb'
"let g:ctrlp_switch_buffer = 0
"let g:ctrlp_working_path_mode = 0
"let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" --- NOTES ---
" C-[ is escape.... ugh...
" also, somehow M-; is still getting through???
" mapleader is ,
" useful page: https://dougblack.io/words/a-good-vimrc.html
" most keybindings are from here
" RETURN TO:
" silver searcher? see good vimrc ^ for it
" also ctrl-p. I should get both of these
答案 0 :(得分:1)
好吧,它终于开始工作了。我通过尝试一些我认为对Vim 7.4不必要的东西来解决它:
我在filetype plugin on
之后添加了execute pathogen#infect()
行。
我在filetype off
之前向.vimrc添加了execute pathogen#infect()
行。
我还使用了:helptags
命令(我认为病原体自己做了)。
我没有耐心花更多时间确定解决问题所需的确切配置,但希望这足以解决类似问题。我的猜测是,打开文件类型插件是罪魁祸首。