Плагин Show Marks вызывает появление меток примерно через 4 секунды - PullRequest
6 голосов
/ 04 января 2012

Я использую плагин Show Marks в vim для отображения, где находятся метки. Отображаемые метки можно включать / выключать командой \mt. Когда я впервые открываю документ, пометки снимаются примерно так:

Marks Off

Затем, примерно через 4 секунды, с абсолютно бездействием с моей стороны , поле левой метки появляется так:

Marks On

У меня три вопроса:

  1. Что это за метки по умолчанию?
  2. Почему для отображения отображается несколько секунд?
  3. Как заставить маркер активировать / деактивировать при запуске?

Вот файл .vimrc (я знаю, что он грязный, но по словам полковника Уолтера Э. Курца: «У вас есть право убить меня ... но вы не имеете права судить меня».)

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>

Ответы [ 3 ]

8 голосов
/ 03 июля 2012

Эти отметки являются специальными отметками, о которых упоминал Иоахим.

Чтобы показать только отметки, которые вы установили самостоятельно, то есть «обычные отметки», добавьте их в файл .vimrc:

let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"   
3 голосов
/ 16 марта 2012

Я также искал эти отметки, которые я не ставил. Эта ссылка

http://vim.wikia.com/wiki/Using_marks

объясняет внизу страницы встроенные метки. Ищите «Особые отметки».

3 голосов
/ 04 января 2012

Из файлов справки:

let g:showmarks_enable=0

Значениями по умолчанию могут быть такие вещи, как ваша последняя измененная строка.

:h `[

Но они выглядят как числовые метки, возможно, вы только что установили их во время предыдущего редактирования?Я предполагаю, что они исчезнут, если вы наберете :delmarks 0 1 2 3 4 5 6 7 etc

Редактировать: Это также в файлах справки, которые, вероятно, объясняют открытие через 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.
...