cont trad cap 26
This commit is contained in:
parent
80b2c4756a
commit
09773b418f
1 changed files with 15 additions and 15 deletions
|
@ -104,36 +104,36 @@ a: Variable de parámetro de función formal
|
|||
v: Variable propia de Vim
|
||||
```
|
||||
|
||||
### Global variable
|
||||
### Variable global
|
||||
|
||||
When you are declaring a "regular" variable:
|
||||
Cuando estás declarando una variable "normal":
|
||||
|
||||
```
|
||||
let pancake = "pancake"
|
||||
let tortita = "tortita"
|
||||
```
|
||||
|
||||
`pancake` is actually a global variable. When you define a global variable, you can call them from anywhere.
|
||||
`tortita` es de hecho una variable global. Cuando defines una variable global, puedes llamarla desde cualquier lugar.
|
||||
|
||||
Prepending `g:` to a variable also creates a global variable.
|
||||
Al anteponer `g:` a la declaración de una variable, también estás creando una variable global:
|
||||
|
||||
```
|
||||
let g:waffle = "waffle"
|
||||
let g:gofre = "gofre"
|
||||
```
|
||||
|
||||
In this case both `pancake` and `g:waffle` have the same scope. You can call each of them with or without `g:`.
|
||||
En este caso tanto `pancake` como `g:waffle` tienen el mismo ámbito de trabajo, son globales. Puedes llamar a cada una de ellas con o sin `g:`.
|
||||
|
||||
```
|
||||
echo pancake
|
||||
" devuelve "pancake"
|
||||
echo tortita
|
||||
" devuelve "tortita"
|
||||
|
||||
echo g:pancake
|
||||
"returns "pancake"
|
||||
echo g:tortita
|
||||
" devuelve "tortita"
|
||||
|
||||
echo waffle
|
||||
" devuelve "waffle"
|
||||
echo gofre
|
||||
" devuelve "gofre"
|
||||
|
||||
echo g:waffle
|
||||
" devuelve "waffle"
|
||||
echo g:gofre
|
||||
" devuelve "gofre"
|
||||
```
|
||||
|
||||
### Buffer Variable
|
||||
|
|
Loading…
Reference in a new issue