vim - Show Marks插件在大约4秒钟后导致 'pop in'出现标记

标签 vim vim-plugin

我在vim中使用Show Marks插件显示标记在哪里。可以使用\mt命令打开/关闭显示的标记。当我第一次打开文档时,标记已关闭,如下所示:

然后大约4秒后,对于来说,完全不起作用,左侧标记边距弹出,如下所示:

我有三个问题:

  • 这些默认标记是什么?
  • 为什么要花几秒钟才能显示它?
  • 如何强制标记边距在启动时激活/停用?


  • 这是.vimrc文件(我知道它很乱,但是用Walter E. Kurtz上校的话说:“您有权杀害我……但您无权审判我。”)
    set modeline                        "These two lines display the file name at the bottom
    set ls=2
    
    set undodir=~/.vim/undodir
    set undofile
    set undolevels=100    "maximum number of changes that can be undone
    set undoreload=10000 "maximum number lines to save for undo on a buffer reload
    
    "Keep undo history when switching buffers
    set hidden
    
    set nocompatible                    "Don't use vi-compatibility mode
    
    set backspace=2                     "Use the smart version of backspace
    
    set expandtab                       "Tab-related settings
    
    set number                                              "Line Numbers
    
    set shiftwidth=4
    set showcmd
    "set ts=4                                                "4 columns for tabs
    
    set smarttab
    
    set smartindent                                          "Indent every time you press enter
    
    set scrolloff=999                       "Cursor Always in middle
    
    set ruler                           "Always display row/column info 
    
    set tabpagemax=100                  "I want a lot of tabs
    
    set tags=tags;/
    
    imap jj <Esc>                       "Map jj to escape
    
    map <S-j> :bp<CR>           "Map F7 to previous tab
    
    map <S-k> :bn<CR>               "Map F7 to next tab
    
    map <Space> <PageDown>              "Map space bar to next page down
    
    set hlsearch "Highlight search strings
    
    "map <S-u> <C-u>                        "Map page movement keys to shift as well
    
    "map <S-d> <C-d>                        "Map page movement keys to shift as well
    
    "map <S-b> <C-b>                        "Map page movement keys to shift as well
    
    "map <S-f> <C-f>                        "Map page movement keys to shift as well
    
    map <F2> :NERDTreeToggle<CR>    "Toggle Nerd Tree on/off
    
    syntax on
    
    "for Syntastic
    
    function! BufSel(pattern)
      let bufcount = bufnr("$")
      let currbufnr = 1
      let nummatches = 0
      let firstmatchingbufnr = 0
      while currbufnr <= bufcount
        if(bufexists(currbufnr))
          let currbufname = bufname(currbufnr)
          if(match(currbufname, a:pattern) > -1)
            echo currbufnr . ": ". bufname(currbufnr)
            let nummatches += 1
            let firstmatchingbufnr = currbufnr
          endif
        endif
        let currbufnr = currbufnr + 1
      endwhile
      if(nummatches == 1)
        execute ":buffer ". firstmatchingbufnr
      elseif(nummatches > 1)
        let desiredbufnr = input("Enter buffer number: ")
        if(strlen(desiredbufnr) != 0)
          execute ":buffer ". desiredbufnr
        endif
      else
        echo "No matching buffers"
      endif
    endfunction
    
    "Bind the BufSel() function to a user-command
    command! -nargs=1 Bs :call BufSel("<args>")
    
    call pathogen#infect() 
    
    "For syntax checking (syntastic)
    let g:syntastic_auto_loc_list=1
    let g:syntastic_disabled_filetypes=['html']
    let g:syntastic_enable_signs=1
    "set statusline=%{SyntasticStatuslineFlag()}
    set statusline=%<\ %n:%f\ %m%r%y%{SyntasticStatuslineFlag()}%=line:\ %l\ of\ %L\ (%p%%),\ col:\ %c%V\ \ \ \ \ Modified:\ %{Time()}
    
    function! Time()
      return strftime("%c", getftime(bufname("%")))
    endfunction
    
    "For jsbeautify
    map <F9> :call g:Jsbeautify()<CR> 
    
    "Check PHP Syntax
    :autocmd FileType php noremap <C-L> :!php -l %<CR>
    
    "Beautify PHP Syntax In 4 steps
    "1) reduce all multiple blank lines to a single blank line
    "2) change all blank lines to something unique like 'if(true)echo('it puts the lotion on the skin');'
    "3) apply beautifier 
    "4) change unique quote back to new line
    func! ParsePHP()
        :exe 'g/^\_$\n\_^$/d'
        :%s/^[\ \t]*\n/$x = 'It puts the lotion on the skin';\r/ge
        :exe '%!php_beautifier --filters "ArrayNested() IndentStyles(style=k&r)"'
        :%s/$x = 'It puts the lotion on the skin';//ge
    endfunc
    
    map <F8> :call ParsePHP()<CR>
    

    最佳答案

    从帮助文件中:

    let g:showmarks_enable=0
    

    默认标记可能是您上次更改的行之类的内容。
    :h `[
    

    但是它们看起来像数字标记,您可能只是在上一次编辑期间设置了它们?我猜如果您键入:delmarks 0 1 2 3 4 5 6 7等,它们将会消失。

    编辑:这也在帮助文件中,它可能解释了4秒钟后的打开:
    ShowMarks is activated by the |CursorHold| |autocommand| which is triggered
    every |updatetime| milliseconds.  This is set to 4000(4 seconds) by default.
    If this is too slow, setting it to a lower value will make it more responsive.
    

    关于vim - Show Marks插件在大约4秒钟后导致 'pop in'出现标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8720313/

    相关文章:

    vim - 在 Vim 中映射 <C-left> 和 <S-left>

    linux - 让 vi 以插入开始,然后向下移动光标

    git - Vim、LaTeX、自动换行和版本控制

    lua - 测试 NeoVim 是否用 lua 中的文件打开

    vim - 如何在 Vim 中粘贴binit?

    vim - 如何在 Vim 中将拆分窗口转换为选项卡,反之亦然

    c - 在 Vim 中重构 C/C++(例如像 Eclipse 中的方法提取)

    vim - 如何绑定(bind)键映射以将选定的文本保存到 vim 中的文件?

    c - YouCompleteMe(YCM) 不建议任何格式 (C11)

    vim - Pathogen 不加载插件