Tire de todo el archivo
A menudo escribo algo en gVim, luego necesito copiarlo y pegarlo en otra aplicación.
¿Hay una manera fácil de tirar todo el archivo? Normalmente hago algo como esto
ggVG"+y
(Ir a la parte superior, modo de línea visual, ir a la parte inferior, yanqui)
Pero, ¿hay una manera mejor que me estoy perdiendo?
13 answers
Utilizo la siguiente instrucción: :%y+
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-07-08 11:49:58
ggyG
(ir a la primera línea, tirar a la última línea)
Editar: Ah, portapapeles del sistema. No es exactamente rodar los dedos, pero: gg"+yG
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-03 19:12:41
Una solución de trabajo en vi antiguo es :r filename
en el nuevo archivo.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-05-06 15:08:15
Otro método es este:
ggyG
Ir a la parte superior, y tirar de la parte inferior.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-05-06 14:41:41
ggyG
(Ir arriba, tirar hacia abajo)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-05-06 14:44:19
Utilizo la siguiente instrucción: :%y
.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-11-25 06:24:38
:0,$ y
No sé qué camino es más fácil.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-03 19:13:15
O simplemente en su .vimrc
:
nmap <silent> <F5> ggVG"+y
Así que solo puedes usar una tecla:)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-03 19:13:27
En OSX:
ggVG
!tee >(pbcopy)
Que encuentro más agradable que:
ggVG
:w !pbcopy
Ya que no muestra un mensaje: "Press ENTER or type command to continue
"
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-03 19:13:53
:%y
sin +
funciona en todo el sistema si está utilizando neo-vim (nvim).
Esto nos permite evitar estirar los dedos hacia +
- haciendo que este atajo sea mejor que ggyG
.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-06 07:23:22
Verificando la predicción en el comentario de Luc Hermitte: :%y+
y :%y*
ambos tiran todo el archivo al portapapeles del sistema bajo Win7 y Vim 7.3.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-05 16:39:26
Está sucio, pero no tiene que usar la tecla mayús en absoluto y solo 3 teclas diferentes que pueden ser más rápidas:
gg1111yy
(Suponiendo que el archivo es más corto que 1111 líneas)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-27 15:27:07
En Windows a menudo solo hago CTRL-A, CTRL-C para copiar todo en el portapapeles de Windows... No puede ser más fácil que eso!
Estoy usando un estándar gvim 7.1 del sitio web...
(POR cierto: también funciona en mi mac con MacVim y ese divertido mac-key + A, mac-key + C)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-05-07 06:38:15