首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在哪里找到vim撤销设置,以及如何关闭它们?

在哪里找到vim撤销设置,以及如何关闭它们?
EN

Stack Overflow用户
提问于 2013-08-27 15:00:24
回答 3查看 1.8K关注 0票数 1

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

下面是我的.vimrc

代码语言:javascript
复制
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>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-08-27 15:45:30

我个人喜欢持久的撤销功能。但是,您可以通过设置undodir来更改undofile的位置。

代码语言:javascript
复制
set undofile
set undodir=$HOME/.vim/vimundo

如果这样做,必须首先通过运行$HOME/.vim/vimundo来确保存在

代码语言:javascript
复制
mkdir -p $HOME/.vim/vimundo

(您仍然必须删除旧的目录,但至少它们不再扰乱工作目录)

如果需要,也可以对备份文件执行同样的操作。(:h backupdir)

其他关于你的音符。

代码语言:javascript
复制
exec pathogen#infect()
...
set runtimepath^=~/.vim/bundle/ctrlp.vim

不应该需要set runtimepath^=~/.vim/bundle/ctrlp.vim,因为病原体应该已经将其附加到运行时路径。

正如@romainl所说,filetype plugin on是多余的。

票数 8
EN

Stack Overflow用户

发布于 2013-08-27 15:13:13

来自:help 'undofile'

代码语言:javascript
复制
boolean (default off)
[…]
When 'undofile' is turned off the undo file is NOT deleted.

所以…

  1. 您不需要set noundofile,因为默认情况下它是关闭的,
  2. 您需要自己移除所有这些文件。
票数 3
EN

Stack Overflow用户

发布于 2019-01-08 17:27:31

注意,undofile特性是在Vim版本7.3中实现的。如果您使用的是早期版本,并将set undofileset noundofile包含在您的.vimrc中,您将得到如下错误:

代码语言:javascript
复制
E518: Unknown option: noundofile

检查Vim版本以防止这些错误的想法可以找到here

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

https://stackoverflow.com/questions/18469033

复制
相关文章

相似问题

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