Question: Okay there are a few ways to print your variables.

For instance:

```
> x<-27
> x

```

Or you can do

```
> (x<-27)

```

But is there a way to do this after youve hit enter?

For example

```
> reallyreallylongvariablenamehere<-52
> #now I have to type out the reallylongvariablename all over
> reallyreallylongvariablenamehere

```

Is there a shortcut like the () trick that you can use after the fact? 

something like:

```
> reallylongvariablenamehere<-52
> function_to_print_varisble_on_above_line_without_typing_it_out()

```

I often realize that I want to print the last line too late, andf I code in the terminal, so then I have to hit Left arrow a million times to go insert the ( and ), or I have to type out the variable name all over. And that's if it's simple code. othen times it's a long assignment. Is there any shortcut that will let you print the last variable assigned oter than the tricks i mentioned

Answer: 
You can use `.Last.value`.

```
x <- 27
.Last.value
# [1] 27

```
The `.Last.value` option suggested by *@RichScriven* is perfect. But you can do something that is more elegant, like using the `.` (or any other character) to show the value of the lastly assigned value. 

Just execute the following to make the `.` capture the work of `.Last.value` :

```
makeActiveBinding(".", function() .Last.value, env = globalenv())

```

You can just hit `.` to show the output:

```
x <- 27
.
# [1] 27

```

Hope it helps.