我在撤销维姆的问题上有很多麻烦。我在我的~/..vimrc中设置了noundofile,并附上了我的工作表的屏幕截图,让所有的.un~文件到处都是非常烦人。帮我个小忙谢谢!

下面是我的.vimrc
set nocompatible
exec pathogen#infect()
filetype plugin indent on
filetype plugin on
"syntax enable
syntax on
set background=light
set noundofile
let g:solarized_termtrans = 1
colorscheme solarized
set number
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
vnoremap < <gv
vnoremap > >gv
set runtimepath^=~/.vim/bundle/ctrlp.vim
autocmd FileType ruby set ft=ruby.rails
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
set nobackup " no backup files
set nowritebackup " only in case you don't want a backup file while editing
set noswapfile " no swap files
set clipboard=unnamed " use Mac clipboard for yank/paste/etc.
" expand %% to file dir
cnoremap %% <C-R>=expand('%:h').'/'<cr>
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set smarttab " insert tabs on the start of a line according to
" shiftwidth, not tabstop
set ts=2 sts=2 sw=2 expandtab "set two spaces by default
autocmd Filetype javascript setlocal et ts=2 sts=2 sw=2
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd Filetype html setlocal et ts=2 sts=2 sw=2
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd Filetype css setlocal et ts=2 sts=2 sw=2
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
au BufRead,BufNewFile *.hamlc set ft=haml
" Vim-pasta Settings
let g:pasta_disabled_filetypes = ['python', 'coffee', 'yaml']
" Indent Guide Settings
autocmd FileType html,css,ruby,eruby,javascript,php,xml,haml call indent_guides#enable()
set mouse=a
imap <C-l> <Space>=><Space>
"Make hashrocket with control-l
nmap <silent> <Leader>q :NERDTreeToggle<CR>发布于 2013-08-27 15:45:30
我个人喜欢持久的撤销功能。但是,您可以通过设置undodir来更改undofile的位置。
set undofile
set undodir=$HOME/.vim/vimundo如果这样做,必须首先通过运行$HOME/.vim/vimundo来确保存在
mkdir -p $HOME/.vim/vimundo(您仍然必须删除旧的目录,但至少它们不再扰乱工作目录)
如果需要,也可以对备份文件执行同样的操作。(:h backupdir)
其他关于你的音符。
exec pathogen#infect()
...
set runtimepath^=~/.vim/bundle/ctrlp.vim不应该需要set runtimepath^=~/.vim/bundle/ctrlp.vim,因为病原体应该已经将其附加到运行时路径。
正如@romainl所说,filetype plugin on是多余的。
发布于 2013-08-27 15:13:13
来自:help 'undofile'
boolean (default off)
[…]
When 'undofile' is turned off the undo file is NOT deleted.所以…
set noundofile,因为默认情况下它是关闭的,发布于 2019-01-08 17:27:31
注意,undofile特性是在Vim版本7.3中实现的。如果您使用的是早期版本,并将set undofile或set noundofile包含在您的.vimrc中,您将得到如下错误:
E518: Unknown option: noundofile检查Vim版本以防止这些错误的想法可以找到here。
https://stackoverflow.com/questions/18469033
复制相似问题