.vimrc中包含什么?[关闭]


157

Vi和Vim允许进行非常棒的自定义,通常将其存储在.vimrc文件中。程序员的典型功能是语法突出显示,智能缩进等。

.vimrc中隐藏了哪些其他用于生产性编程的技巧?

我对重构,自动类和类似的生产力宏特别感兴趣,尤其是对于C#。


11
我认为您应该已经要求人们发布他们评论的 vim配置文件。
innaM

为什么不在github上分享这些东西呢?我在git下有我的整个.vim文件夹,都可以在这里看到:github.com/lsdr/vim-folder
lsdr

1
我不认为整个.vimrcs都有用。如果一堆人都支持答案,那么您是否只是将整个内容放入系统中?片段有用得多,就像有用的别名或函数列表比整个。(bash | z)rc文件要好得多。
熊恰亚诺夫,09年

Answers:


104

你自找的 :-)

"{{{Auto Commands

" Automatically cd into the directory that the file is in
autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')

" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif

" Restore cursor position to where it was before
augroup JumpCursorOnEdit
   au!
   autocmd BufReadPost *
            \ if expand("<afile>:p:h") !=? $TEMP |
            \   if line("'\"") > 1 && line("'\"") <= line("$") |
            \     let JumpCursorOnEdit_foo = line("'\"") |
            \     let b:doopenfold = 1 |
            \     if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
            \        let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
            \        let b:doopenfold = 2 |
            \     endif |
            \     exe JumpCursorOnEdit_foo |
            \   endif |
            \ endif
   " Need to postpone using "zv" until after reading the modelines.
   autocmd BufWinEnter *
            \ if exists("b:doopenfold") |
            \   exe "normal zv" |
            \   if(b:doopenfold > 1) |
            \       exe  "+".1 |
            \   endif |
            \   unlet b:doopenfold |
            \ endif
augroup END

"}}}

"{{{Misc Settings

" Necesary  for lots of cool vim things
set nocompatible

" This shows what you are typing as a command.  I love this!
set showcmd

" Folding Stuffs
set foldmethod=marker

" Needed for Syntax Highlighting and stuff
filetype on
filetype plugin on
syntax enable
set grepprg=grep\ -nH\ $*

" Who doesn't like autoindent?
set autoindent

" Spaces are better than a tab character
set expandtab
set smarttab

" Who wants an 8 character tab?  Not me!
set shiftwidth=3
set softtabstop=3

" Use english for spellchecking, but don't spellcheck by default
if version >= 700
   set spl=en spell
   set nospell
endif

" Real men use gcc
"compiler gcc

" Cool tab completion stuff
set wildmenu
set wildmode=list:longest,full

" Enable mouse support in console
set mouse=a

" Got backspace?
set backspace=2

" Line Numbers PWN!
set number

" Ignoring case is a fun trick
set ignorecase

" And so is Artificial Intellegence!
set smartcase

" This is totally awesome - remap jj to escape in insert mode.  You'll never type jj anyway, so it's great!
inoremap jj <Esc>

nnoremap JJJJ <Nop>

" Incremental searching is sexy
set incsearch

" Highlight things that we find with the search
set hlsearch

" Since I use linux, I want this
let g:clipbrdDefaultReg = '+'

" When I close a tab, remove the buffer
set nohidden

" Set off the other paren
highlight MatchParen ctermbg=4
" }}}

"{{{Look and Feel

" Favorite Color Scheme
if has("gui_running")
   colorscheme inkpot
   " Remove Toolbar
   set guioptions-=T
   "Terminus is AWESOME
   set guifont=Terminus\ 9
else
   colorscheme metacosm
endif

"Status line gnarliness
set laststatus=2
set statusline=%F%m%r%h%w\ (%{&ff}){%Y}\ [%l,%v][%p%%]

" }}}

"{{{ Functions

"{{{ Open URL in browser

function! Browser ()
   let line = getline (".")
   let line = matchstr (line, "http[^   ]*")
   exec "!konqueror ".line
endfunction

"}}}

"{{{Theme Rotating
let themeindex=0
function! RotateColorTheme()
   let y = -1
   while y == -1
      let colorstring = "inkpot#ron#blue#elflord#evening#koehler#murphy#pablo#desert#torte#"
      let x = match( colorstring, "#", g:themeindex )
      let y = match( colorstring, "#", x + 1 )
      let g:themeindex = x + 1
      if y == -1
         let g:themeindex = 0
      else
         let themestring = strpart(colorstring, x + 1, y - x - 1)
         return ":colorscheme ".themestring
      endif
   endwhile
endfunction
" }}}

"{{{ Paste Toggle
let paste_mode = 0 " 0 = normal, 1 = paste

func! Paste_on_off()
   if g:paste_mode == 0
      set paste
      let g:paste_mode = 1
   else
      set nopaste
      let g:paste_mode = 0
   endif
   return
endfunc
"}}}

"{{{ Todo List Mode

function! TodoListMode()
   e ~/.todo.otl
   Calendar
   wincmd l
   set foldlevel=1
   tabnew ~/.notes.txt
   tabfirst
   " or 'norm! zMzr'
endfunction

"}}}

"}}}

"{{{ Mappings

" Open Url on this line with the browser \w
map <Leader>w :call Browser ()<CR>

" Open the Project Plugin <F2>
nnoremap <silent> <F2> :Project<CR>

" Open the Project Plugin
nnoremap <silent> <Leader>pal  :Project .vimproject<CR>

" TODO Mode
nnoremap <silent> <Leader>todo :execute TodoListMode()<CR>

" Open the TagList Plugin <F3>
nnoremap <silent> <F3> :Tlist<CR>

" Next Tab
nnoremap <silent> <C-Right> :tabnext<CR>

" Previous Tab
nnoremap <silent> <C-Left> :tabprevious<CR>

" New Tab
nnoremap <silent> <C-t> :tabnew<CR>

" Rotate Color Scheme <F8>
nnoremap <silent> <F8> :execute RotateColorTheme()<CR>

" DOS is for fools.
nnoremap <silent> <F9> :%s/$//g<CR>:%s// /g<CR>

" Paste Mode!  Dang! <F10>
nnoremap <silent> <F10> :call Paste_on_off()<CR>
set pastetoggle=<F10>

" Edit vimrc \ev
nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.vimrc<CR>

" Edit gvimrc \gv
nnoremap <silent> <Leader>gv :tabnew<CR>:e ~/.gvimrc<CR>

" Up and down are more logical with g..
nnoremap <silent> k gk
nnoremap <silent> j gj
inoremap <silent> <Up> <Esc>gka
inoremap <silent> <Down> <Esc>gja

" Good call Benjie (r for i)
nnoremap <silent> <Home> i <Esc>r
nnoremap <silent> <End> a <Esc>r

" Create Blank Newlines and stay in Normal mode
nnoremap <silent> zj o<Esc>
nnoremap <silent> zk O<Esc>

" Space will toggle folds!
nnoremap <space> za

" Search mappings: These will make it so that going to the next one in a
" search will center on the line it's found in.
map N Nzz
map n nzz

" Testing
set completeopt=longest,menuone,preview

inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<c-g>u\<cr>"
inoremap <expr> <c-n> pumvisible() ? "\<lt>c-n>" : "\<lt>c-n>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
inoremap <expr> <m-;> pumvisible() ? "\<lt>c-n>" : "\<lt>c-x>\<lt>c-o>\<lt>c-n>\<lt>c-p>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"

" Swap ; and :  Convenient.
nnoremap ; :
nnoremap : ;

" Fix email paragraphs
nnoremap <leader>par :%s/^>$//<CR>

"ly$O#{{{ "lpjjj_%A#}}}jjzajj

"}}}

"{{{Taglist configuration
let Tlist_Use_Right_Window = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_SingleClick = 1
let Tlist_Inc_Winwidth = 0
"}}}

let g:rct_completion_use_fri = 1
"let g:Tex_DefaultTargetFormat = "pdf"
let g:Tex_ViewRule_pdf = "kpdf"

filetype plugin indent on
syntax on

78
但是为什么3,设置shiftwidth = 3,设置softtabstop = 3 ...也许2或4,但是为什么3?
约翰

1
只是想知道,但是在插入模式下按j时,将jj映射到<Esc>不会给您带来一点延迟吗?
sykora

1
@sykora:是的,但是只要键入另一个字符(不是j),它就会出现。我做同样的事情,但是用jk代替,因为我认为打jk比打jj快。只有这会影响到我,才输入字母,所以也许kj会更好。
David Miani

2
@Johan:因为“三个是一个神奇的数字”。:)实际上,那只是骑自行车,但我也喜欢三个。:)
罗伯特·马赛奥利

4
如果真正的男人使用gcc,为什么不呢?(编译器gcc已被注释掉!)
Abdulsattar Mohammed

73

这不在我的.vimrc文件中,但是昨天我了解了该]p命令。就像粘贴粘贴缓冲区的内容一样p,但是它会自动调整缩进量以匹配光标所在的行!这对于移动代码非常有用。


您的意思是这类似于:set paste,p,:set nopaste吗?
hyperboreean

3
据我所知,:set paste选项对p命令没有任何影响,它只影响在插入模式下键入(或通过终端粘贴)的文本。所以不,这是一个不同的功能。
Greg Hewgill

1
不应该为此投票,因为它没有回答问题,但是我非常喜欢;)
gorsky 2010年

53

我使用以下命令将所有临时文件和备份文件保存在一个位置:

set backup
set backupdir=~/.vim/backup
set directory=~/.vim/tmp

到处保存混乱的工作目录。

您将必须首先创建这些目录,vim 不会为您创建它们。


2
我应该提一下,您必须自己创建这些目录,而vim不会为您这样做。
哈雷·霍尔科姆

这样可以正确处理多个相同的文件吗?(例如,如果您正在编辑同一代码的多个不同分支)
yungchin

不,这将覆盖具有相同名称的旧备份文件。如果有人可以解决这个问题,请告诉我。
哈雷·霍尔科姆

3
试试这个:au BufWritePre * let&bex ='-'。strftime(“%Y%m%d-%H%M%S”)。“ .vimbackup”(这是一行。)我也必须提到这一点:vim.wikia.com/wiki/VimTip962
Zsolt Botykai,

1
当跨多台机器打开Dropbox同步的文件时,这也使Vim免受抱怨。
科迪·赫斯

31

上面发布的某人(即Frew)有以下一行:

“自动cd到文件所在的目录:”

autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')

我自己做了类似的事情,直到发现内置的设置可以完成相同的事情:

set autochdir

我认为类似的情况在几次不同的时间发生在我身上。Vim具有许多不同的内置设置和选项,因此与搜索文档中的内置方法相比,有时滚动起来更快捷,更容易。


很棒的发现!我更喜欢使用内置的东西^ _ ^。另外,如果有|,这也不会失败 在文件名中。
贾维德·阿罕默德

2
autochdir有一些烦恼,我永远都无法解决(在加载命令行上给定的文件之前更改目录),并且我在SO的其他地方读到了autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /哪些内容具有相同的基本功能,但不会削弱命令行。
dash-tom-bang 2010年

我更喜欢将其设置为可选,并使用此命令输入当前文件的目录:cd%:h
staackuser2,2011年

28

我最新添加的内容是突出显示当前行

set cul                                           # highlight current line
hi CursorLine term=none cterm=none ctermbg=3      # adjust color

2
有什么办法可以从更多颜色中进行选择?
Fzs2

set cul和set cursorline有什么区别?
putolaruan 2010年

我只是使用“ set cul”在当前行下获得一行。游标线设置与语法突出显示太合我的口味了。
克拉斯·莫格伦

2
请参考以下脚本(vim.org/scripts/script.php?script_id=1349)以获取可用的颜色。可能需要为vim启用256色支持才能获得更多种类。
Brian Wigginton 2010年

1
@Claes实际上,set culset cursorline做完全相同的事情。
杰拉尔多·马塞特

24

2012年更新:我现在真的建议您检查一下vim-powerline,它已经取代了我的旧状态线脚本,尽管目前缺少我想念的一些功能。


我想说的是,我的vimrc中的statusline东西可能是最有趣/最有用的(从此处的vimrc作者和此处的相应博客文章中摘录)。

屏幕截图:

状态行http://img34.imageshack.us/img34/849/statusline.png

码:

"recalculate the trailing whitespace warning when idle, and after saving
autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning

"return '[\s]' if trailing white space is detected
"return '' otherwise
function! StatuslineTrailingSpaceWarning()
    if !exists("b:statusline_trailing_space_warning")

        if !&modifiable
            let b:statusline_trailing_space_warning = ''
            return b:statusline_trailing_space_warning
        endif

        if search('\s\+$', 'nw') != 0
            let b:statusline_trailing_space_warning = '[\s]'
        else
            let b:statusline_trailing_space_warning = ''
        endif
    endif
    return b:statusline_trailing_space_warning
endfunction


"return the syntax highlight group under the cursor ''
function! StatuslineCurrentHighlight()
    let name = synIDattr(synID(line('.'),col('.'),1),'name')
    if name == ''
        return ''
    else
        return '[' . name . ']'
    endif
endfunction

"recalculate the tab warning flag when idle and after writing
autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning

"return '[&et]' if &et is set wrong
"return '[mixed-indenting]' if spaces and tabs are used to indent
"return an empty string if everything is fine
function! StatuslineTabWarning()
    if !exists("b:statusline_tab_warning")
        let b:statusline_tab_warning = ''

        if !&modifiable
            return b:statusline_tab_warning
        endif

        let tabs = search('^\t', 'nw') != 0

        "find spaces that arent used as alignment in the first indent column
        let spaces = search('^ \{' . &ts . ',}[^\t]', 'nw') != 0

        if tabs && spaces
            let b:statusline_tab_warning = '[mixed-indenting]'
        elseif (spaces && !&et) || (tabs && &et)
            let b:statusline_tab_warning = '[&et]'
        endif
    endif
    return b:statusline_tab_warning
endfunction

"recalculate the long line warning when idle and after saving
autocmd cursorhold,bufwritepost * unlet! b:statusline_long_line_warning

"return a warning for "long lines" where "long" is either &textwidth or 80 (if
"no &textwidth is set)
"
"return '' if no long lines
"return '[#x,my,$z] if long lines are found, were x is the number of long
"lines, y is the median length of the long lines and z is the length of the
"longest line
function! StatuslineLongLineWarning()
    if !exists("b:statusline_long_line_warning")

        if !&modifiable
            let b:statusline_long_line_warning = ''
            return b:statusline_long_line_warning
        endif

        let long_line_lens = s:LongLines()

        if len(long_line_lens) > 0
            let b:statusline_long_line_warning = "[" .
                        \ '#' . len(long_line_lens) . "," .
                        \ 'm' . s:Median(long_line_lens) . "," .
                        \ '$' . max(long_line_lens) . "]"
        else
            let b:statusline_long_line_warning = ""
        endif
    endif
    return b:statusline_long_line_warning
endfunction

"return a list containing the lengths of the long lines in this buffer
function! s:LongLines()
    let threshold = (&tw ? &tw : 80)
    let spaces = repeat(" ", &ts)

    let long_line_lens = []

    let i = 1
    while i <= line("$")
        let len = strlen(substitute(getline(i), '\t', spaces, 'g'))
        if len > threshold
            call add(long_line_lens, len)
        endif
        let i += 1
    endwhile

    return long_line_lens
endfunction

"find the median of the given array of numbers
function! s:Median(nums)
    let nums = sort(a:nums)
    let l = len(nums)

    if l % 2 == 1
        let i = (l-1) / 2
        return nums[i]
    else
        return (nums[l/2] + nums[(l/2)-1]) / 2
    endif
endfunction


"statusline setup
set statusline=%f "tail of the filename

"display a warning if fileformat isnt unix
set statusline+=%#warningmsg#
set statusline+=%{&ff!='unix'?'['.&ff.']':''}
set statusline+=%*

"display a warning if file encoding isnt utf-8
set statusline+=%#warningmsg#
set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''}
set statusline+=%*

set statusline+=%h "help file flag
set statusline+=%y "filetype
set statusline+=%r "read only flag
set statusline+=%m "modified flag

"display a warning if &et is wrong, or we have mixed-indenting
set statusline+=%#error#
set statusline+=%{StatuslineTabWarning()}
set statusline+=%*

set statusline+=%{StatuslineTrailingSpaceWarning()}

set statusline+=%{StatuslineLongLineWarning()}

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

"display a warning if &paste is set
set statusline+=%#error#
set statusline+=%{&paste?'[paste]':''}
set statusline+=%*

set statusline+=%= "left/right separator

function! SlSpace()
    if exists("*GetSpaceMovement")
        return "[" . GetSpaceMovement() . "]"
    else
        return ""
    endif
endfunc
set statusline+=%{SlSpace()}

set statusline+=%{StatuslineCurrentHighlight()}\ \ "current highlight
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
set laststatus=2

除其他事项外,它在状态行上通知通常的标准文件信息,但还包括其他事项,例如:set粘贴警告,混合缩进,尾随空格等。如果您对代码格式特别感兴趣,则非常有用。

此外,如屏幕截图所示,将其与syntastic结合使用 可在其上突出显示任何语法错误(假设您选择的语言已捆绑了相关的语法检查器。


我在上面遇到了麻烦。LongLines()中缺少条件。我将其更改为“而我<阈值”,但是在该条件下被调用的len也丢失了。关于镜头有什么想法吗?
阿里

没关系,我在这里找到了真实的东西:dotfiles.org/~gregf/.vimrc
Ali

@pug现在内部服务器错误。=(您能给我提示还是将.vimrc的相关部分粘贴到某处?
Anton Strogonoff 2011年

@Anton修复了代码格式弄乱的粘贴。现在应该很好。我也建议您将其粘贴在plugin / statusline.vim文件中,以防止您使用.vimrc时出现混乱。
加文·吉尔摩

@Gavin的作品很棒,谢谢您的修复和提示!我曾经autocmd BufEnter *.py match OverLength /\%81v.\+/在.vimrc中使用过类似的东西来突出显示长行,但是您的方法可能不会那么分散注意力。另外,状态栏中的语法检查结果是一件很酷的事情!
2011年

19

我的迷你版:

syntax on
set background=dark
set shiftwidth=2
set tabstop=2

if has("autocmd")
  filetype plugin indent on
endif

set showcmd             " Show (partial) command in status line.
set showmatch           " Show matching brackets.
set ignorecase          " Do case insensitive matching
set smartcase           " Do smart case matching
set incsearch           " Incremental search
set hidden              " Hide buffers when they are abandoned

大版本,收集自各地:

syntax on
set background=dark
set ruler                     " show the line number on the bar
set more                      " use more prompt
set autoread                  " watch for file changes
set number                    " line numbers
set hidden
set noautowrite               " don't automagically write on :next
set lazyredraw                " don't redraw when don't have to
set showmode
set showcmd
set nocompatible              " vim, not vi
set autoindent smartindent    " auto/smart indent
set smarttab                  " tab and backspace are smart
set tabstop=2                 " 6 spaces
set shiftwidth=2
set scrolloff=5               " keep at least 5 lines above/below
set sidescrolloff=5           " keep at least 5 lines left/right
set history=200
set backspace=indent,eol,start
set linebreak
set cmdheight=2               " command line two lines high
set undolevels=1000           " 1000 undos
set updatecount=100           " switch every 100 chars
set complete=.,w,b,u,U,t,i,d  " do lots of scanning on tab completion
set ttyfast                   " we have a fast terminal
set noerrorbells              " No error bells please
set shell=bash
set fileformats=unix
set ff=unix
filetype on                   " Enable filetype detection
filetype indent on            " Enable filetype-specific indenting
filetype plugin on            " Enable filetype-specific plugins
set wildmode=longest:full
set wildmenu                  " menu has tab completion
let maplocalleader=','        " all my macros start with ,
set laststatus=2

"  searching
set incsearch                 " incremental search
set ignorecase                " search ignoring case
set hlsearch                  " highlight the search
set showmatch                 " show matching bracket
set diffopt=filler,iwhite     " ignore all whitespace and sync

"  backup
set backup
set backupdir=~/.vim_backup
set viminfo=%100,'100,/100,h,\"500,:100,n~/.viminfo
"set viminfo='100,f1

" spelling
if v:version >= 700
  " Enable spell check for text files
  autocmd BufNewFile,BufRead *.txt setlocal spell spelllang=en
endif

" mappings
" toggle list mode
nmap <LocalLeader>tl :set list!<cr>
" toggle paste mode
nmap <LocalLeader>pp :set paste!<cr>

仅供参考,'smartindent'已过时(用cindent代替),并且在使用文件类型缩进时不执行任何操作,并且仅在
不起作用

13

有时候,最简单的事情最有价值。我的.vimrc中的2行是绝对必不可少的:

不 :
没关系;

nore \ ;改用了它,因为我将其,用作<leader>
aehlke 2010年

3
但是它是做什么的呢?:)
HenrikBjørnskov2010年

6
分号是很少使用的命令。冒号是一种非常普通的命令,用于进入命令行模式。相互重新映射可以使您无需按Shift键即可进入命令行模式,从而节省了小指的肌肉。
William Pursell,2010年

7
在法语键盘上,不需要'shift'来写',',';' 和':'...但是'\','['和']'确实很痛苦。
奥利维尔·庞斯

12

杂项 设置:

  1. 关闭烦人的错误提示:

    set noerrorbells
    set visualbell
    set t_vb=
    
  2. 使用换行符使光标按预期移动:

    inoremap <Down> <C-o>gj
    inoremap <Up> <C-o>gk
    
  3. ctags在目录中查找“标签”文件,直到找到一个:

    set tags=tags;/
    
  4. 使用Python语法显示SCons文件:

    autocmd BufReadPre,BufNewFile SConstruct set filetype=python
    autocmd BufReadPre,BufNewFile SConscript set filetype=python
    

在SConstruct文件中添加#!/ usr / bin / python,它将触发Vim的内置文件类型检测魔术
richq

有没有更好的办法,使j/ k移动与换行预期?我不想g每次都按。
2012年

8

我不是世界上最先进的vim'er,但这是我挑选的一些

function! Mosh_Tab_Or_Complete()
    if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
        return "\<C-N>"
    else
        return "\<Tab>"
endfunction

inoremap <Tab> <C-R>=Mosh_Tab_Or_Complete()<CR>

使制表符自动完成功能确定要在其中放置单词还是实际的制表符(4个空格)。

map cc :.,$s/^ *//<CR>

从此处删除所有打开的空格到文件末尾。由于某种原因,我发现这很有用。

set nu! 
set nobackup

显示行号,不要创建那些烦人的备份文件。无论如何,我从未从旧备份中还原任何内容。

imap ii <C-[>

在插入时,按两次i进入命令模式。我从来没有碰到连续2个i的单词或变量,因此我不必用手指离开主行或按多个键来回切换。


3
ii的有趣映射...非常有趣。这是一个很酷的主意-尽管我担心这会严重影响我使用“香草” vim的能力。
thomasrutter

我一直在与;; 很长一段时间,并且没有遇到任何问题。当被迫使用香草vi / vim时,我立即记得使用愚蠢的[esc]键(这是我多年来讨厌vim的原因之一!)。对我而言,此设置绝对必要。没有它,我永远不会愿意使用vi(m)。<br>我喜欢使用'ii'而不是';;'的想法:更直观,几乎像切换一样。
iconoclast

另一种可能性是使用Ctrl-C离开插入模式。它几乎与Escape一样(使我烦恼的唯一区别是在可视块的线条上进行操作)。
2011年

8

我对vimrc进行了评论,带有readline-esque(emacs)键绑定:

if version >= 700

"------ Meta ------"

" clear all autocommands! (this comment must be on its own line)
autocmd!

set nocompatible                " break away from old vi compatibility
set fileformats=unix,dos,mac    " support all three newline formats
set viminfo=                    " don't use or save viminfo files

"------ Console UI & Text display ------"

set cmdheight=1                 " explicitly set the height of the command line
set showcmd                     " Show (partial) command in status line.
set number                      " yay line numbers
set ruler                       " show current position at bottom
set noerrorbells                " don't whine
set visualbell t_vb=            " and don't make faces
set lazyredraw                  " don't redraw while in macros
set scrolloff=5                 " keep at least 5 lines around the cursor
set wrap                        " soft wrap long lines
set list                        " show invisible characters
set listchars=tab:>·,trail:·    " but only show tabs and trailing whitespace
set report=0                    " report back on all changes
set shortmess=atI               " shorten messages and don't show intro
set wildmenu                    " turn on wild menu :e <Tab>
set wildmode=list:longest       " set wildmenu to list choice
if has('syntax')
    syntax on
    " Remember that rxvt-unicode has 88 colors by default; enable this only if
    " you are using the 256-color patch
    if &term == 'rxvt-unicode'
        set t_Co=256
    endif

    if &t_Co == 256
        colorscheme xoria256
    else
        colorscheme peachpuff
    endif
endif

"------ Text editing and searching behavior ------"

set nohlsearch                  " turn off highlighting for searched expressions
set incsearch                   " highlight as we search however
set matchtime=5                 " blink matching chars for .x seconds
set mouse=a                     " try to use a mouse in the console (wimp!)
set ignorecase                  " set case insensitivity
set smartcase                   " unless there's a capital letter
set completeopt=menu,longest,preview " more autocomplete <Ctrl>-P options
set nostartofline               " leave my cursor position alone!
set backspace=2                 " equiv to :set backspace=indent,eol,start
set textwidth=80                " we like 80 columns
set showmatch                   " show matching brackets
set formatoptions=tcrql         " t - autowrap to textwidth
                                " c - autowrap comments to textwidth
                                " r - autoinsert comment leader with <Enter>
                                " q - allow formatting of comments with :gq
                                " l - don't format already long lines

"------ Indents and tabs ------"

set autoindent                  " set the cursor at same indent as line above
set smartindent                 " try to be smart about indenting (C-style)
set expandtab                   " expand <Tab>s with spaces; death to tabs!
set shiftwidth=4                " spaces for each step of (auto)indent
set softtabstop=4               " set virtual tab stop (compat for 8-wide tabs)
set tabstop=8                   " for proper display of files with tabs
set shiftround                  " always round indents to multiple of shiftwidth
set copyindent                  " use existing indents for new indents
set preserveindent              " save as much indent structure as possible
filetype plugin indent on       " load filetype plugins and indent settings

"------ Key bindings ------"

" Remap broken meta-keys that send ^[
for n in range(97,122) " ASCII a-z
    let c = nr2char(n)
    exec "set <M-". c .">=\e". c
    exec "map  \e". c ." <M-". c .">"
    exec "map! \e". c ." <M-". c .">"
endfor

""" Emacs keybindings
" first move the window command because we'll be taking it over
noremap <C-x> <C-w>
" Movement left/right
noremap! <C-b> <Left>
noremap! <C-f> <Right>
" word left/right
noremap  <M-b> b
noremap! <M-b> <C-o>b
noremap  <M-f> w
noremap! <M-f> <C-o>w
" line start/end
noremap  <C-a> ^
noremap! <C-a> <Esc>I
noremap  <C-e> $
noremap! <C-e> <Esc>A
" Rubout word / line and enter insert mode
noremap  <C-w> i<C-w>
noremap  <C-u> i<C-u>
" Forward delete char / word / line and enter insert mode
noremap! <C-d> <C-o>x
noremap  <M-d> dw
noremap! <M-d> <C-o>dw
noremap  <C-k> Da
noremap! <C-k> <C-o>D
" Undo / Redo and enter normal mode
noremap  <C-_> u
noremap! <C-_> <C-o>u<Esc><Right>
noremap! <C-r> <C-o><C-r><Esc>

" Remap <C-space> to word completion
noremap! <Nul> <C-n>

" OS X paste (pretty poor implementation)
if has('mac')
    noremap  √ :r!pbpaste<CR>
    noremap! √ <Esc>√
endif

""" screen.vim REPL: http://github.com/ervandew/vimfiles
" send paragraph to parallel process
vmap <C-c><C-c> :ScreenSend<CR>
nmap <C-c><C-c> mCvip<C-c><C-c>`C
imap <C-c><C-c> <Esc><C-c><C-c><Right>
" set shell region height
let g:ScreenShellHeight = 12


"------ Filetypes ------"

" Vimscript
autocmd FileType vim setlocal expandtab shiftwidth=4 tabstop=8 softtabstop=4

" Shell
autocmd FileType sh setlocal expandtab shiftwidth=4 tabstop=8 softtabstop=4

" Lisp
autocmd Filetype lisp,scheme setlocal equalprg=~/.vim/bin/lispindent.lisp expandtab shiftwidth=2 tabstop=8 softtabstop=2

" Ruby
autocmd FileType ruby setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2

" PHP
autocmd FileType php setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4

" X?HTML & XML
autocmd FileType html,xhtml,xml setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2

" CSS
autocmd FileType css setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4

" JavaScript
" autocmd BufRead,BufNewFile *.json setfiletype javascript
autocmd FileType javascript setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
let javascript_enable_domhtmlcss=1

"------ END VIM-500 ------"

endif " version >= 500

仅供参考,'smartindent'已过时(用cindent代替),并且在使用文件类型缩进时不执行任何操作,并且仅在
不起作用

7
syntax on
set cindent
set ts=4
set sw=4
set backspace=2
set laststatus=2
set nohlsearch
set modeline
set modelines=3
set ai
map Q gq

set vb t_vb=

set nowrap
set ss=5
set is
set scs
set ru

map <F2> <Esc>:w<CR>
map! <F2> <Esc>:w<CR>

map <F10> <Esc>:qa<CR>
map! <F10> <Esc>:qa<CR>

map <F9>  <Esc>:wqa<CR>
map! <F9>  <Esc>:wqa<CR>

inoremap <s-up> <Esc><c-w>W<Ins>
inoremap <s-down> <Esc><c-w>w<Ins>

nnoremap <s-up> <c-w>W
nnoremap <s-down> <c-w>w

" Fancy middle-line <CR>
inoremap <C-CR> <Esc>o
nnoremap <C-CR> o

" This is the way I like my quotation marks and various braces
inoremap '' ''<Left>
inoremap "" ""<Left>
inoremap () ()<Left>
inoremap <> <><Left>
inoremap {} {}<Left>
inoremap [] []<Left>
inoremap () ()<Left>

" Quickly set comma or semicolon at the end of the string
inoremap ,, <End>,
inoremap ;; <End>;
au FileType python inoremap :: <End>:


au FileType perl,python set foldlevel=0
au FileType perl,python set foldcolumn=4
au FileType perl,python set fen
au FileType perl        set fdm=syntax
au FileType python      set fdm=indent
au FileType perl,python set fdn=4
au FileType perl,python set fml=10
au FileType perl,python set fdo=block,hor,mark,percent,quickfix,search,tag,undo,search

au FileType perl,python abbr sefl self
au FileType perl abbr sjoft shift
au FileType perl abbr DUmper Dumper

function! ToggleNumberRow()
       if !exists("g:NumberRow") || 0 == g:NumberRow
               let g:NumberRow = 1
               call ReverseNumberRow()
       else
               let g:NumberRow = 0
               call NormalizeNumberRow()
       endif
endfunction


" Reverse the number row characters
function! ReverseNumberRow()
       " map each number to its shift-key character
       inoremap 1 !
       inoremap 2 @
       inoremap 3 #
       inoremap 4 $
       inoremap 5 %
       inoremap 6 ^
       inoremap 7 &
       inoremap 8 *
       inoremap 9 (
       inoremap 0 )
       inoremap - _
    inoremap 90 ()<Left>
       " and then the opposite
       inoremap ! 1
       inoremap @ 2
       inoremap # 3
       inoremap $ 4
       inoremap % 5
       inoremap ^ 6
       inoremap & 7
       inoremap * 8
       inoremap ( 9
       inoremap ) 0
       inoremap _ -
endfunction

" DO the opposite to ReverseNumberRow -- give everything back
function! NormalizeNumberRow()
       iunmap 1
       iunmap 2
       iunmap 3
       iunmap 4
       iunmap 5
       iunmap 6
       iunmap 7
       iunmap 8
       iunmap 9
       iunmap 0
       iunmap -
       "------
       iunmap !
       iunmap @
       iunmap #
       iunmap $
       iunmap %
       iunmap ^
       iunmap &
       iunmap *
       iunmap (
       iunmap )
       iunmap _
       inoremap () ()<Left>
endfunction

"call ToggleNumberRow()
nnoremap <M-n> :call ToggleNumberRow()<CR>

" Add use <CWORD> at the top of the file
function! UseWord(word)
       let spec_cases = {'Dumper': 'Data::Dumper'}
       let my_word = a:word
       if has_key(spec_cases, my_word)
               let my_word = spec_cases[my_word]
       endif

       let was_used = search("^use.*" . my_word, "bw")

       if was_used > 0
               echo "Used already"
               return 0
       endif

       let last_use = search("^use", "bW")
       if 0 == last_use
               last_use = search("^package", "bW")
               if 0 == last_use
                       last_use = 1
               endif
       endif

       let use_string = "use " . my_word . ";"
       let res = append(last_use, use_string)
       return 1
endfunction

function! UseCWord()
       let cline = line(".")
       let ccol = col(".")
       let ch = UseWord(expand("<cword>"))
       normal mu
       call cursor(cline + ch, ccol)

endfunction

function! GetWords(pattern)
       let cline = line(".")
       let ccol = col(".")
       call cursor(1,1)

       let temp_dict = {}
       let cpos = searchpos(a:pattern)
       while cpos[0] != 0
               let temp_dict[expand("<cword>")] = 1
               let cpos = searchpos(a:pattern, 'W')
       endwhile

       call cursor(cline, ccol)
       return keys(temp_dict)
endfunction

" Append the list of words, that match the pattern after cursor
function! AppendWordsLike(pattern)
       let word_list = sort(GetWords(a:pattern))
       call append(line("."), word_list)
endfunction


nnoremap <F7>  :call UseCWord()<CR>

" Useful to mark some code lines as debug statements
function! MarkDebug()
       let cline = line(".")
       let ctext = getline(cline)
       call setline(cline, ctext . "##_DEBUG_")
endfunction

" Easily remove debug statements
function! RemoveDebug()
       %g/#_DEBUG_/d
endfunction

au FileType perl,python inoremap <M-d> <Esc>:call MarkDebug()<CR><Ins>
au FileType perl,python inoremap <F6> <Esc>:call RemoveDebug()<CR><Ins>
au FileType perl,python nnoremap <F6> :call RemoveDebug()<CR>

" end Perl settings

nnoremap <silent> <F8> :TlistToggle<CR>
inoremap <silent> <F8> <Esc>:TlistToggle<CR><Esc>

function! AlwaysCD()
       if bufname("") !~ "^scp://" && bufname("") !~ "^sftp://" && bufname("") !~ "^ftp://"
               lcd %:p:h
       endif
endfunction
autocmd BufEnter * call AlwaysCD()

function! DeleteRedundantSpaces()
       let cline = line(".")
       let ccol = col(".")
       silent! %s/\s\+$//g
       call cursor(cline, ccol)
endfunction
au BufWrite * call DeleteRedundantSpaces()

set nobackup
set nowritebackup
set cul

colorscheme evening

autocmd FileType python set formatoptions=wcrq2l
autocmd FileType python set inc="^\s*from"
autocmd FileType python so /usr/share/vim/vim72/indent/python.vim

autocmd FileType c      set si
autocmd FileType mail   set noai
autocmd FileType mail   set ts=3
autocmd FileType mail   set tw=78
autocmd FileType mail   set shiftwidth=3
autocmd FileType mail   set expandtab
autocmd FileType xslt   set ts=4
autocmd FileType xslt   set shiftwidth=4
autocmd FileType txt    set ts=3
autocmd FileType txt    set tw=78
autocmd FileType txt    set expandtab

" Move cursor together with the screen
noremap <c-j> j<c-e>
noremap <c-k> k<c-y>

" Better Marks
nnoremap ' `

6

一些常见拼写错误的修复为我节省了可观的时间:

:command WQ wq
:command Wq wq
:command W w
:command Q q

iab anf and
iab adn and
iab ans and
iab teh the
iab thre there

25
我不喜欢这样-只会训练错误。
Svante

我喜欢这样的话:而且,那里,但不是为了保存并退出
sixtyfootersdude 2010年

3
@Svante,通常我会同意,除了我的命令中也有此设置外,我倾向于经常保存或经常保存/退出。通常,我的小指拿起Shift键的时间太慢,而BAM的另一端却变成大写字母,这很烦人!
法郎

1
在ADM3A终端上并为其编写了vi,该终端具有冒号(:)的指定键,因此您无需按Shift键。如果您重新映射在正常/可视模式下根本不使用的键(例如空格键),则不会遇到太多问题。nnoremap <Space>:和vnomap <Space>: en.wikipedia.org/wiki/File
KB_Terminal_ADM3A.svg

我喜欢用save / quit命令,但不喜欢单词。如果您在没有安全网的情况下犯了错误,Vim会告诉您您的错误。如果在没有自动更正的情况下将其拼写为“ teh”,您将不会注意到,而且看起来会毫无学问。
罗伯特·马丁

5

我没有意识到我的3200 .vimrc行中有多少条仅用于满足我的古怪需求,因此在这里列出这些内容就显得毫无用处。但这也许就是Vim如此有用的原因...

iab AlP ABCDEFGHIJKLMNOPQRSTUVWXYZ
iab MoN January February March April May June July August September October November December
iab MoO Jan Feb Mar Apr May Jun Jul Aug Sep Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
iab NuM 12345678901234567890123456789012345678901234567890123456789012345678901234567890 
iab RuL ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

" Highlight every other line
map ,<Tab> :set hls<CR>/\\n.*\\n/<CR>

" This is for working across multiple xterms and/or gvims
" Transfer/read and write one block of text between vim sessions (capture whole line):
" Write
nmap ;w :. w! ~/.vimxfer<CR>
" Read
nmap ;r :r ~/.vimxfer<CR>
" Append 
nmap ;a :. w! >>~/.vimxfer<CR>

5

我的242行.vimrc并不是那么有趣,但是由于没有人提到它,所以我觉得除了默认映射之外,我还必须共享两个最重要的映射,这些映射增强了我的工作流程:

map <C-j> :bprev<CR>
map <C-k> :bnext<CR>
set hidden " this will go along

认真地说,切换缓冲区是经常要做事情。Windows,当然可以,但是一切都不能很好地适合屏幕。

相似的一组地图,用于快速浏览错误(请参见quickfix)和grep结果:

map <C-n> :cn<CR>
map <C-m> :cp<CR>

简单,轻松,高效。


自从Vim获得了制表符支持以来,我在缓冲区之间切换的机会还很少。我将键盘上的“后退”和“前进”额外键映射到了选项卡导航命令。
唐·雷巴

@Don Reba,您知道,这些选项卡仅复制了某些缓冲区的功能。因此,“使用”缓冲区或制表符没有太大区别。纯粹主义者会说,选项卡旨在将任务组织到单独的区域,仅此而已。我只想说缓冲区具有所有的便利,如果需要更高的抽象,我可以使用制表符将其保留给其他内容。:)
nperson325681 2010年

4

set nobackup 
set nocp
set tabstop=4
set shiftwidth=4
set et
set ignorecase

set ai
set ruler
set showcmd
set incsearch
set dir=$temp       " Make swap live in the %TEMP% directory
syn on

" Load the color scheme
colo inkpot

4

我在vim内部使用cscope(充分利用了多个缓冲区)。我使用control-K启动大多数命令(我记得从ctags窃取的命令)。另外,我已经生成了.cscope.out文件。

如果has(“ cscope”)

set cscopeprg=/usr/local/bin/cscope
set cscopetagorder=0
set cscopetag
set cscopepathcomp=3
set nocscopeverbose
cs add .cscope.out
set csverb

"
" cscope find
"
" 0 or s: Find this C symbol
" 1 or d: Find this definition
" 2 or g: Find functions called by this function
" 3 or c: Find functions calling this function
" 4 or t: Find assignments to
" 6 or e: Find this egrep pattern
" 7 or f: Find this file
" 8 or i: Find files #including this file
" 
map ^Ks     :cs find 0 <C-R>=expand("<cword>")<CR><CR>
map ^Kd     :cs find 1 <C-R>=expand("<cword>")<CR><CR>
map ^Kg     :cs find 2 <C-R>=expand("<cword>")<CR><CR>
map ^Kc     :cs find 3 <C-R>=expand("<cword>")<CR><CR>
map ^Kt     :cs find 4 <C-R>=expand("<cword>")<CR><CR>
map ^Ke     :cs find 6 <C-R>=expand("<cword>")<CR><CR>
map ^Kf     :cs find 7 <C-R>=expand("<cfile>")<CR><CR>
map ^Ki     :cs find 8 <C-R>=expand("%")<CR><CR>

万一



3

我使用的是OS X,因此其中一些在其他平台上可能具有更好的默认设置,但无论如何:

syntax on
set tabstop=4
set expandtab
set shiftwidth=4

1
您可能需要查找softtabstop并使用而不是tabstop。保留tabstop其默认值8将有助于读取他人使用标签创建的文件。
格雷格(Greg Hewgill)

6
OSX与选项卡有什么关系?
aehlke'2

3
map = }{!}fmt^M}
map + }{!}fmt -p '> '^M}
set showmatch

=用于重新格式化普通段落。+用于重新格式化引用电子邮件中的段落。showmatch用于在键入封闭的括号或方括号时闪烁匹配的括号/方括号。


3

使用目录树中的第一个可用的“标签”文件:

:set tags=tags;/

左右用于切换缓冲区,而不移动光标:

map <right> <ESC>:bn<RETURN>
map <left> <ESC>:bp<RETURN>

一次按一下即可禁用搜索突出显示:

map - :nohls<cr>

3
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent cindent 
set encoding=utf-8 fileencoding=utf-8
set nobackup nowritebackup noswapfile autoread
set number
set hlsearch incsearch ignorecase smartcase

if has("gui_running")
    set lines=35 columns=140
    colorscheme ir_black
else
    colorscheme darkblue
endif

" bash like auto-completion
set wildmenu
set wildmode=list:longest

inoremap <C-j> <Esc>

" for lusty explorer
noremap glr \lr
noremap glf \lf
noremap glb \lb

" use ctrl-h/j/k/l to switch between splits
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h

" Nerd tree stuff
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
noremap gn :NERDTree<Cr>

" cd to the current file's directory
noremap gc :lcd %:h<Cr>

我喜欢您的配置中发生的很多事情。每行if has("gui_running"),和凉爽地图有多套。我已经将大部分配置复制到了我的文件中。谢谢!
贾斯汀力

3

把它放在你的vimrc中:

imap <C-l> <Space>=><Space>

再也不用考虑再输入一个hashrocket了。是的,我知道您不需要在Ruby 1.9中。但是没关系。

我的完整vimrc在这里


这是一个好主意,但我建议仅将其映射为红宝石文件:autocmd FileType ruby imap <C-l> <Space>=><Space>
csexton 2011年

您能解释一下对不了解Ruby的Emacs人员的作用吗?
托马斯,

这会在Vim的插入模式中添加Control-L热键,以自动键入带有空格(=>)的hashrocket。hashrocket是Ruby哈希的键值运算符。
dpogg1 2011年

2

好吧,您必须自己清理我的配置。玩得开心。通常,这只是我想要的设置,包括映射和与语法相关的随机内容,以及折叠设置和一些插件配置,tex编译解析器等。

顺便说一句,我发现极为有用的是“光标下的突出显示文字”:

 highlight flicker cterm=bold ctermfg=white
 au CursorMoved <buffer> exe 'match flicker /\V\<'.escape(expand('<cword>'), '/').'\>/'

请注意,仅ctermtermfg用于,因为我不使用gvim。如果您希望这样工作,请分别gvimgui和替换它们guifg


如何在打开多个窗口的情况下使用它?它似乎只能与作为第一个缓冲区启动的主缓冲区一起使用。
ohnoes

2

我试图使我的.vimrc尽可能普遍地有用。

一个方便的技巧是.gpg文件的处理程序可以安全地编辑它们:

au BufNewFile,BufReadPre *.gpg :set secure vimi= noswap noback nowriteback hist=0 binary
au BufReadPost *.gpg :%!gpg -d 2>/dev/null
au BufWritePre *.gpg :%!gpg -e -r 'name@email.com' 2>/dev/null
au BufWritePost *.gpg u

2

1)我喜欢状态行(带有文件名,ascii值(十进制),十六进制值以及标准行,cols和%):

set statusline=%t%h%m%r%=[%b\ 0x%02B]\ \ \ %l,%c%V\ %P
" Always show a status line
set laststatus=2
"make the command line 1 line high
set cmdheight=1

2)我也喜欢拆分窗口的映射。

" <space> switches to the next window (give it a second)
" <space>n switches to the next window
" <space><space> switches to the next window and maximizes it
" <space>= Equalizes the size of all windows
" + Increases the size of the current window
" - Decreases the size of the current window

 :map <space> <c-W>w
:map <space>n <c-W>w
:map <space><space> <c-W>w<c-W>_
:map <space>= <c-W>=
if bufwinnr(1)
  map + <c-W>+
  map - <c-W>-
endif

2

我的.vimrc中实际上没有多少内容(即使它有850行)。大多数情况下,设置和一些常见和简单的映射我懒得提取到插件中。

如果您是用“自动分类”来表示“模板文件”,那么我使用的是模板扩展器插件 -在同一站点上,您会找到我为C&C ++编辑定义的ftplugins,有些可能适合我猜是C#。

关于重构方面,http://vim.wikia.com上有专门针对此主题的技巧。IIRC示例代码适用于C#。它启发了我一个仍然需要大量工作的重构插件(实际上需要重构)。

您应该查看vim邮件列表的档案,特别是有关将vim用作有效IDE的主题。别忘了看一下:make,标签,...

HTH,


2

我的.vimrc包括(除其他更有用的东西外)以下行:

set statusline=%2*%n\|%<%*%-.40F%2*\|\ %2*%M\ %3*%=%1*\ %1*%2.6l%2*x%1*%1.9(%c%V%)%2*[%1*%P%2*]%1*%2B

为高中决赛学习时,我感到无聊。


您能解释一下这是什么吗?
Vijay Dev

它显示一条状态行,其中包含缓冲区编号,文件名,修改状态,缓冲区内的位置以及光标下方字符的十六进制代码。格式和颜色很好。
Tadeusz A.Kadłubowski09年

1

这是我的.vimrc。我使用Gvim 7.2

set guioptions=em
set showtabline=2
set softtabstop=2
set shiftwidth=2
set tabstop=2

" Use spaces instead of tabs
set expandtab
set autoindent

" Colors and fonts
colorscheme inkpot
set guifont=Consolas:h11:cANSI

"TAB navigation like firefox
:nmap <C-S-tab> :tabprevious<cr>
:nmap <C-tab> :tabnext<cr>
:imap <C-S-tab> <ESC>:tabprevious<cr>i
:imap <C-tab> <ESC>:tabnext<cr>i
:nmap <C-t> :tabnew<cr>
:imap <C-t> <ESC>:tabnew<cr>i
:map <C-w> :tabclose<cr>

" No Backups and line numbers
set nobackup
set number
set nuw=6

" swp files are saved to %Temp% folder
set dir=$temp
" sets the default size of gvim on open
set lines=40 columns=90

1

我里面有.vimrc什么?

ngn@macavity:~$ cat .vimrc
" This file intentionally left blank

实际的配置文件位于 ~/.vim/ :)

而且大多数内容都掩盖了其他人的努力,而这些努力公然地适应vim.org了我的编辑优势。


2
我几乎有这个功能,但是如果您使用这些功能,.vimrc需要包含“设置不兼容”设置,不是吗?至少删除它会导致大量错误!
richq
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.