sau đây là mảnh kịch bản vim từ một plugin vim:cách hiểu tập lệnh vim này?
tôi nên nói cú pháp của vim đó là một chút lạ:
!exists("*s:SetVals")
, tại sao họ là một Starmark trướcs:
?- chức năng !, tại sao có một! tính cách?
- & từ khóa, đây có phải là biến, nếu có, nơi biến được xác định?
s:
vàg:
, sự khác biệt giữa chúng là gì?- tại sao nên sử dụng? chẳng hạn như
let &dictionary = g:pydiction_location
, tôi có thể đổi thành&dictionary = g:pydiction_location
không?
nếu tồn tại! ("* S: SetVals")
function! s:SetVals() " Save and change any config values we need. " Temporarily change isk to treat periods and opening " parenthesis as part of a keyword -- so we can complete " python modules and functions: let s:pydiction_save_isk = &iskeyword setlocal iskeyword +=.,( " Save any current dictionaries the user has set: let s:pydiction_save_dictions = &dictionary " Temporarily use only pydiction's dictionary: let &dictionary = g:pydiction_location " Save the ins-completion options the user has set: let s:pydiction_save_cot = &completeopt " Have the completion menu show up for one or more matches: let &completeopt = "menu,menuone" " Set the popup menu height: let s:pydiction_save_pumheight = &pumheight if !exists('g:pydiction_menu_height') let g:pydiction_menu_height = 15 endif let &pumheight = g:pydiction_menu_height return '' endfunction
endif
tại sao thẻ 'python'? –
@AshwiniChaudhary vì python được gọi bởi tập lệnh này :) – hugemeow
Nó có thể là Ruby hoặc Perl hoặc Lua và nó không liên quan gì đến câu hỏi của bạn. – romainl