Difference between pages "Genkernel Quick Start Tutorial/pt-br" and "Package:Vim/Cheatsheet"

From Funtoo
< Genkernel Quick Start Tutorial(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
== Conceitos ==
* The description given in the "description" column is rather short, often it is best to try it your self and see what it actually does.
* Even if not specified in the "command" column, most commands fired in normal mode accept a "<num> prefix" (Eg. `5w` is equivalent to `wwwww`).
* Most commands will work in visual mode as well as in normal mode.


TBC
== Deplacements ==


== Recompilando os códigos fonte do kernel Gentoo a partir do SystemRescue CD chroot ==


Um segundo caso que muitos usuários de Funtoo users encararão é recompilar seu próprio kernel quando instalar um um Funtoo novinho a partir de um stage 3 archive (o cenário mais comum é inicializar a maquina com o SystemRescue CD).
{{TableStart|striped=true}}
<tr>
  <th>command</th>
  <th>meaning</th>
  <th>description</th>
</tr>
<tr>
  <td>w</td>
  <td>word</td>
  <td>move to next word</td>
</tr>
<tr>
  <td>W</td>
  <td>Word</td>
  <td>move to the next word (broad sens)</td>
</tr>
<tr>
  <td>b</td>
  <td>begin</td>
  <td>move to the previous word beginning</td>
</tr>
<tr>
  <td>B</td>
  <td>Begin</td>
  <td>move to the previous word beginning (broad sense)</td>
</tr>
<tr>
  <td>e</td>
  <td>end</td>
  <td>move to the next word end</td>
</tr>
<tr>
  <td>E</td>
  <td>End</td>
  <td>move to the next word end (broad sense)</td>
</tr>
<tr>
  <td><nowiki>{</nowiki></td>
  <td></td>
  <td>move to the previous blank line</td>
</tr>
<tr>
  <td><nowiki>}</nowiki></td>
  <td></td>
  <td>move to the next blank line</td>
</tr>
<tr>
  <td>f<char></td>
  <td>fetch</td>
  <td>move to the next occurrence of the character <char></td>
</tr>
<tr>
  <td>F<char></td>
  <td>Fetch</td>
  <td>move to the previous occurrence of the character <char></td>
</tr>
<tr>
  <td>$</td>
  <td></td>
  <td>move to the end of the line</td>
</tr>
<tr>
  <td>^</td>
  <td></td>
  <td>move to the first non-whitespace character of the line</td>
</tr>
<tr>
  <td>zz</td>
  <td></td>
  <td>center the viewport on the currently</td>
</tr>
<tr>
  <td><num>gg</td>
  <td>goto</td>
  <td>move to line number <num> (default is 1 if <num> is omitted)</td>
</tr>
<tr>
  <td>G</td>
  <td></td>
  <td>move to the last line</td>
</tr>
<tr>
  <td>C-o</td>
  <td></td>
  <td>Go to the previous cursor position</td>
</tr>
{{TableEnd}}


{{Fancynote| Se quiser utilizar o System rescue CD sources fornecido pelo Funtoo {{Package|sys-kernel/sysrescue-std-sources}}, a filosofia permanece exatamente a mesma.}}
== Switch to insert mode ==


== Primeiro passo, emergir os pacotes necessários ==
{{TableStart|striped=true}}
<tr>
  <th>command</th>
  <th>meaning</th>
  <th>description</th>
</tr>
<tr>
  <td>i</td>
  <td>insert</td>
  <td>insert before the cursor</td>
</tr>
<tr>
  <td>I</td>
  <td>Insert</td>
  <td>insert at the beginning of the line (= <code>^i</code>)</td>
</tr>
<tr>
  <td>a</td>
  <td>append</td>
  <td>insert after the cursor/td>
</tr>
<tr>
  <td>A</td>
  <td>Append</td>
  <td>insert at the end of the line (= <code>$a</code>)</td>
</tr>
<tr>
  <td>o</td>
  <td></td>
  <td>insert on a new blank line after the current line</td>
</tr>
<tr>
  <td>O</td>
  <td></td>
  <td>insert on a new blank line before the current line</td>
</tr>
<tr>
  <td>s</td>
  <td>substitute</td>
  <td>remove the current character and instert instead (= <code>xi</code>)</td>
</tr>
<tr>
  <td>S</td>
  <td>Substitute</td>
  <td>remove the current line and insert instead (= <code>ddi</code></td>
</tr>
<tr>
  <td>R</td>
  <td>Replace</td>
  <td>insert and override on the fly</td>
</tr>
{{TableEnd}}


O primeiro passo é emergir:
== Actions ==


# Os fontes do kernel do Gentoo: {{Package|sys-kernel/gentoo-sources}}
{{TableStart|striped=true}}
# Genkernel em si: {{Package|sys-kernel/genkernel}}
<tr>
 
  <th>command</th>
Isso é conseguido ao executar o seguinte:
  <th>meaning</th>
<console>
  <th>description</th>
###i## emerge sys-kernel/gentoo-sources sys-kernel/genkernel
</tr>
</console>
<tr>
 
  <td><num>dd</td>
Uma vez que ps fontes do kernel do Gentoo são implantados, Você deve encontrar um diretório nomeado '''linux-''version''-gentoo''' (ex. linux-2.6.39-gentoo) sob ''<code>/usr/src</code>''. Atualize o link simbólico ''<code>linux</code>'' para apontar para esse diretório:
  <td>delete</td>
<console>
  <td>delete <num> lines</td>
###i## cd /usr/src
</tr>
###i## rm linux
<tr>
###i## ln -s linux-2.6.39-gentoo linux
  <td><num>yy</td>
</console>
  <td>yank</td>
 
  <td>copy <num> lines to vim's default buffer</td>
== Segundo passo: Obter e alterar um arquivo de configuração ==
</tr>
 
<tr>
Como iniciar sua configuração de kernel? Simplesmente ao utilizar o mesmo template de configuração com que o kernel o System Rescue CD tinha sido construído! Antes de executar sua instancia do chroot em seu Funtoo, você fez algo como:
  <td>x</td>
 
  <td></td>
<console>
  <td>remove the character under the cursor</td>
###i## mount -o bind /proc /mnt/gentoo/proc
</tr>
</console>
<tr>
Ou:
  <td><num>p</td>
<console>
  <td>paste</td>
###i## mount -t proc none /mnt/gentoo/proc
  <td>paste <num> times vim's default buffer after the cursor</td>
</console>
</tr>
 
<tr>
Em seu ambiente chroot (ou a partir de um terminal virtual do System Rescue CD) se você ver o que o ''<code>/proc</code>'' contem você notará  um arquivo com nome ''<code>config.gz</code>'':
  <td><num>P</td>
 
  <td>Paste</td>
<console>
  <td>paste <num> times vim's default buffer before the cursor</td>
###i## ls /proc
</tr>
 
<tr>
...
  <td><code>~</code> (tilde)</td>
dr-xr-xr-x  7 root      root                    0 May 23 03:13 952
  <td></td>
dr-xr-xr-x  7 root      root                    0 May 23 03:13 953
  <td>swap case under the cursor</td>
dr-xr-xr-x  7 root      root                    0 May 23 18:42 9834
</tr>
...
<tr>
-r--r--r--  1 root      root                16024 May 23 22:27 config.gz
  <td>.</td>
-r--r--r--  1 root      root                    0 May 23 22:27 consoles
  <td></td>
-r--r--r--  1 root      root                    0 May 23 22:27 cpuinfo
  <td>repeat previous action (kind of "live macro", try it yourself and see)</td>
...
</tr>
</console>
<tr>
 
  <td>/<pattern><CR></td>
''<code>config.gz</code>'' contem a configuração do kernel em execução (do System Rescue CD), somente copie o conteúdo descompactado (unziped) para dentro do diretório do Gentoo sources:
  <td></td>
<console>
  <td>search next occurrence of <pattern></td>
###i## cd /usr/src/linux
</tr>
###i## zcat /proc/config.gz > .config
<tr>
</console>
  <td>?<pattern><CR></td>
 
  <td></td>
Depois, execute ''<code>make oldconfig</code>'' para definir todos as opções recentemente adicionadas:
  <td>search previous occurrence of <pattern></td>
<console>
</tr>
###i## make oldconfig
<tr>
</console>
  <td>*</td>
 
  <td></td>
Depois, configure a configuração do kernel do jeito que preferir (edição manualmente do arquivo .config, make nconfig, make menuconfig....) se você desejar. Você não está preparado ainda! Um passo final é necessário: '''Você ''deve'' tanto  definir CONFIG_INITRAMFS_SOURCE a um valor em branco (CONFIG_INITRAMFS_SOURCE="") como excluir  a confirmação no arquivo .config '''. Esquecendo de fazer isso fará o Genkernel abortar o processo de compilação com uma mensagem como:
  <td>look for the next occurrence of the word under the cursor</td>
<console>
</tr>
/usr/src/linux-2.6.39-gentoo/scripts/gen_initramfs_list.sh: Cannot open '/var/tmp/genkernel/initramfs-2.6.32.14-std155-i386.cpio.gz'
<tr>
make[1]: *** [usr/initramfs_data.cpio.lzma] Error 1
  <td>n</td>
</console>
  <td></td>
 
  <td>forward search last searched pattern</td>
== Terceiro passo: Construindo e instalando o kernel ==
</tr>
 
<tr>
Isso é simplesmente obtido pelo:
  <td>N</td>
<console>
  <td></td>
###i## genkernel --no-mrproper all
  <td>backward search last searched pattern</td>
</console>
</tr>
 
{{TableEnd}}
O mesmo menciona escrito no [[Genkernel_Quick_Start_Tutorial#Third_step:_Building_and_installing_the_kernel|parágrafo terceiro ]] do primeiro caso de uso ainda são válidos aqui.
 
[[Category:Kernel]]

Latest revision as of 21:22, April 7, 2015

  • The description given in the "description" column is rather short, often it is best to try it your self and see what it actually does.
  • Even if not specified in the "command" column, most commands fired in normal mode accept a "<num> prefix" (Eg. `5w` is equivalent to `wwwww`).
  • Most commands will work in visual mode as well as in normal mode.

Deplacements

command meaning description
w word move to next word
W Word move to the next word (broad sens)
b begin move to the previous word beginning
B Begin move to the previous word beginning (broad sense)
e end move to the next word end
E End move to the next word end (broad sense)
{ move to the previous blank line
} move to the next blank line
f<char> fetch move to the next occurrence of the character <char>
F<char> Fetch move to the previous occurrence of the character <char>
$ move to the end of the line
^ move to the first non-whitespace character of the line
zz center the viewport on the currently
<num>gg goto move to line number <num> (default is 1 if <num> is omitted)
G move to the last line
C-o Go to the previous cursor position

Switch to insert mode

command meaning description
i insert insert before the cursor
I Insert insert at the beginning of the line (= ^i)
a append insert after the cursor/td>
A Append insert at the end of the line (= $a)
o insert on a new blank line after the current line
O insert on a new blank line before the current line
s substitute remove the current character and instert instead (= xi)
S Substitute remove the current line and insert instead (= ddi
R Replace insert and override on the fly

Actions

command meaning description
<num>dd delete delete <num> lines
<num>yy yank copy <num> lines to vim's default buffer
x remove the character under the cursor
<num>p paste paste <num> times vim's default buffer after the cursor
<num>P Paste paste <num> times vim's default buffer before the cursor
~ (tilde) swap case under the cursor
. repeat previous action (kind of "live macro", try it yourself and see)
/<pattern><CR> search next occurrence of <pattern>
?<pattern><CR> search previous occurrence of <pattern>
* look for the next occurrence of the word under the cursor
n forward search last searched pattern
N backward search last searched pattern