首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vim问题: Sparkup不适用于从运行的Vim会话打开的文件

Vim问题: Sparkup不适用于从运行的Vim会话打开的文件
EN

Stack Overflow用户
提问于 2011-02-05 19:09:20
回答 1查看 1.1K关注 0票数 2

如果我从命令提示符用Vim打开一个文件(例如: vim ~/.vimrc),Sparkup文本生成似乎工作得很好。例如,如果我插入:

代码语言:javascript
复制
html:xs

然后按下control + e,sparkup就会生成一个很好的HTML严格样板。但是,如果我随后从正在运行的Vim会话拆分到另一个文件,Sparkup将停止在新打开的文件中工作。完全有可能其他插件也会失去它们的功能。这是我的.vimrc文件:

代码语言:javascript
复制
set nocompatible    " use vim defaults
set number          " show line numbers
set tags=tags;$HOME/.vim/tags/ "recursively searches directory for 'tags' file
set expandtab       " tabs are converted to spac
set tabstop=4       " numbers of spaces of tab character
set shiftwidth=4    " numbers of spaces to (auto)indent
set showcmd         " display incomplete commands
set incsearch       " do incremental searching
set ruler           " show the cursor position all the time
set numberwidth=4   " line numbering takes up 5 spaces
set ignorecase      " ignore case when searching
set nowrap          " stop lines from wrapping
set incsearch       " show search matches as you type

call pathogen#helptags()
call pathogen#runtime_append_all_bundles()

filetype on            " enables filetype detection
filetype plugin on     " enables filetype specific plugins
filetype plugin indent on " Loads pyflake-vim's ftplugin files automatically when a Python buffer is opened

syntax on                 " syntax highlighing
colorscheme default

nmap <silent> <c-y> :NERDTreeToggle<CR>
nmap <silent> <c-o> :OpenBookmark 

" TagList Plugin Configuration
let Tlist_Ctags_Cmd='/usr/bin/ctags'       " point taglist to ctags
let Tlist_GainFocus_On_ToggleOpen = 1      " Focus on the taglist when its toggled
let Tlist_Close_On_Select = 1              " Close when something's selected
let Tlist_Use_Right_Window = 1             " Project uses the left window
let Tlist_File_Fold_Auto_Close = 1         " Close folds for inactive files

" Omnicompletion functions
set ofu=syntaxcomplete#complete
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS

au FileType py set expandtab

map <F2> :previous<CR>                  " map F2 to open previous buffer
map <F3> :next<CR>                      " map F3 to open next buffer
map <F5> :TlistToggle<CR>               " map F5 to toggle the Tag Listing
map <silent><C-Left> <C-T>              " taglist - map Ctrl-LeftArrow to jump to the method/property under your cursor
map <silent><C-Right> <C-]>             " taglist - map Ctrl-RhitArrow to jump back to your source code

" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l

" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc

highlight SpellBad term=reverse ctermbg=Gray ctermfg=Red

下面是我在~/.vim/bundles中的一些其他插件:

IndexedSearch nerdtree snipmate.vim vim-css-color vim-git vim-rails vim-ruby-debugger vim-supertab vim-t注释gist pyflakes vim textile.vim vim-cucumber vim-haml vim-repeat vim-shoulda vim-环绕vim-vividchalk pysmell vim-align vim-fugitivevim-markdown vim-ruby vim-sparkup vim-taglist

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-02-06 00:53:17

会不会是这个插件绑定到了一个给定的FileType,而当你改变窗口时,这个FileType就不一样了?

如果不起作用,试着把你的插件添加到ftplugins中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4906505

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档