【发布时间】:2013-08-30 09:54:36
【问题描述】:
我在使用 vim undo 时遇到了很多麻烦。我在我的 ~/.vimrc 中设置了 'set 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>
【问题讨论】:
-
When 'undofile' is turned off the undo file is NOT deleted.你可以手动删除那些un~文件,并测试它们是否仍然由vim生成。 -
你不需要
filetype plugin on,因为上面的行已经完成了。 -
我有点困惑,为什么只用一个简单的
ls命令就可以看到这些文件。 Unix 系统通常会隐藏名称以“.”开头的文件,至少在默认设置下是这样。 -
@kent +1 romainl +1 我在我的 .bash_profile 中将 ls 别名为“alias ls='ls -FGaw'”,这对我查看所有内容很有用
-
我对@987654326@ 的评论是“离题”。
标签: vim