Vim中let g: let b: let l: 等的区别

vim 下 :help internal-variables

buffer-variable b: Local to the current buffer. 
window-variable w: Local to the current window. 
tabpage-variable t: Local to the current tab page. 
global-variable g: Global. 
local-variable l: Local to a function. 
script-variable s: Local to a |:source|’ed Vim script. 
function-argument a: Function argument (only inside a function). 
vim-variable v: Global, predefined by Vim.
 

vim中let与set如何区分,一直挺困惑,上网搜索了一翻,把结果记录于此。

set设置的是选项, let设置的是变量。具体请看网友回答

:set is for setting options, :let for assigning a value to a variable. 
It happens that the value for an option is linked to the name of the option prepended by a & (the &option-name construct then behaves very similar to “ordinary” variables). So, the following are equivalent: 
:set tw=40 
:let &tw=40 
But, for example, assigning 50 to the global variable foo (:let g:foo=50) cannot be achieved with a :set command (because g:foo is a variable and not an option). 
Some options are boolean like. When setting these, no value is needed (as in :set noic and the opposite :set ic).

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值