vim 显示标记插件导致标记在大约4秒后“弹出”

pobjuy32  于 2022-11-11  发布在  其他
关注(0)|答案(4)|浏览(194)

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

然后大约4秒后,我的**部分完全没有动作,左手标记边缘像这样弹出:

我有三个问题:
1.这些默认标记是什么?
1.为什么要花几秒钟才能显示出来?
1.如何在启动时强制启用/禁用标记边距?
下面是.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>
tkclm6bt

tkclm6bt1#

那些标记是特殊的标记,约阿希姆提到过。
要仅显示您自己设置的标记,即“正常标记”,请将以下内容添加到.vimrc文件中:

let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
jum4pzuy

jum4pzuy2#

从 帮助 文件 :

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.

格式

qgzx9mmu

qgzx9mmu3#

我也在寻找这些我没有设置的标记。这个链接
http://vim.wikia.com/wiki/Using_marks
在页面底部解释了内置标记。查找“特殊标记”。

nkoocmlb

nkoocmlb4#

尝试了许多插件,这一个对我来说工作得很好,它是唯一一个即时更新标记:https://github.com/yaocccc/vim-showmarks

相关问题