{"id":17872,"date":"2022-07-28T15:39:42","date_gmt":"2022-07-28T13:39:42","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=17872"},"modified":"2022-08-05T08:31:59","modified_gmt":"2022-08-05T06:31:59","slug":"vim-tips-tricks-for-the-kubernetes-cka-exam","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/","title":{"rendered":"Vim Tips &amp; Tricks for the Kubernetes CKA exam"},"content":{"rendered":"\n<p>After being a regular reader of this blog for months, I&#8217;m thrilled to publish my first post!<\/p>\n\n\n\n<p>Vim is a very powerful editing tool to know in Linux and sometimes the only text editor available when connected to a machine using command line interface.<br>Regarding the CKA exam, it is the text editor selected to be used and so knowing a few tricks can save you precious time for completing the various tasks requested.<br>This post assume you already have a basic knowledge of Vi\/Vim and don\u2019t have a panic attack because you don\u2019t know how to exit Vim ;-). For beginners, the Vim package comes with a tutorial where you can learn the basics, just enter the command <strong>vimtutor<\/strong> in your terminal and follow the instructions.<br>Let\u2019s start with some easy tips first before pushing it a bit harder.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Move to a pattern and modify text between double quotes<\/h2>\n\n\n\n<p>In the pod yaml file below we would like to change the mountPath value to \/var\/www\/html<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [17]; title: ; notranslate\" title=\"\">\napiVersion: v1\nkind: Pod\nmetadata:\n  name: task-pv-pod\nspec:\n  volumes:\n    - name: task-pv-storage\n      persistentVolumeClaim:\n        claimName: task-pv-claim\n  containers:\n    - name: task-pv-container\n      image: nginx\n      ports:\n        - containerPort: 80\n          name: &quot;http-server&quot;\n      volumeMounts:\n        - mountPath: &quot;\/usr\/share\/nginx\/html&quot;\n          name: task-pv-storage\n<\/pre><\/div>\n\n\n<p>Let\u2019s for example go straight to the mountPath key by typing <strong>\/mountPath <\/strong>then press <strong>W<\/strong> (capital w) to reach the opening &#8220;<\/p>\n\n\n\n<p>Now to delete everything between the &#8220;&#8221; and enter in insert mode type <strong>ci&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [17]; title: ; notranslate\" title=\"\">\napiVersion: v1\nkind: Pod\nmetadata:\n  name: task-pv-pod\nspec:\n  volumes:\n    - name: task-pv-storage\n      persistentVolumeClaim:\n        claimName: task-pv-claim\n  containers:\n    - name: task-pv-container\n      image: nginx\n      ports:\n        - containerPort: 80\n          name: &quot;http-server&quot;\n      volumeMounts:\n        - mountPath: &quot;&quot;\n          name: task-pv-storage\n<\/pre><\/div>\n\n\n<p>All the content between the &#8220;&#8221; have been deleted and you can now just enter the new desired path here <strong>\/var\/www\/html<\/strong> and save the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Split the screen<\/h2>\n\n\n\n<p>It is sometimes convenient to stay in Vim and do other system operations at the same time without exiting Vim. Here are some examples and ideas for doing so.<\/p>\n\n\n\n<p>When editing a file with Vim you can split the screen vertically or horizontally with <strong>:vsp <\/strong>or <strong>:sp<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\napiVersion: v1                          |apiVersion: v1\nkind: Pod                               |kind: Pod\nmetadata:                               |metadata:\n  name: task-pv-pod                     |  name: task-pv-pod\nspec:                                   |spec:\n  volumes:                              |  volumes:\n    - name: task-pv-storage             |    - name: task-pv-storage\n      persistentVolumeClaim:            |      persistentVolumeClaim:\n        claimName: task-pv-claim        |        claimName: task-pv-claim\n  containers:                           |  containers:\n    - name: task-pv-container           |    - name: task-pv-container\n      image: nginx                      |      image: nginx\n      ports:                            |      ports:\n        - containerPort: 80             |        - containerPort: 80\n          name: &quot;http-server&quot;           |          name: &quot;http-server&quot;\n      volumeMounts:                     |      volumeMounts:\n        - mountPath: &quot;\/usr\/share\/nginx\/h|        - mountPath: &quot;\/usr\/share\/nginx\/\ntml&quot;                                    |html&quot;\n          name: task-pv-storage         |          name: task-pv-storage\n~                                       |~\n~                                       |~\n~                                       |~\n~                                       |~\npod1.yaml                                pod1.yaml\n<\/pre><\/div>\n\n\n<p>By default the second area on the right (vertical split is used in this example) shows the same file as the first one. Each areas can be split further vertically or horizontally if required. Use <strong>CTRL+ww<\/strong> to switch between the areas and <strong>:q<\/strong> in an area to close it.<\/p>\n\n\n\n<p>Now we can check a local file to open by switching to the shell (without exiting Vim) with <strong>:sh<\/strong> (note that this action will be in full screen and is not contained in a particular area). Here you can launch any system command as well as <strong>kubectl<\/strong> commands which is very handy for getting quickly an information. Here look for example for a file to edit, copy its name and exit from the shell with <strong>exit<\/strong><\/p>\n\n\n\n<p>Open now that new file in the second area with <strong>:e &lt;file_name&gt;<\/strong>. In my example I\u2019ve opened pod2.yaml which has the same content as pod1.yaml for now but will be modified to evolve to a version 2 of that file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [24]; title: ; notranslate\" title=\"\">\napiVersion: v1                          |apiVersion: v1\nkind: Pod                               |kind: Pod\nmetadata:                               |metadata:\n  name: task-pv-pod                     |  name: task-pv-pod\nspec:                                   |spec:\n  volumes:                              |  volumes:\n    - name: task-pv-storage             |    - name: task-pv-storage\n      persistentVolumeClaim:            |      persistentVolumeClaim:\n        claimName: task-pv-claim        |        claimName: task-pv-claim\n  containers:                           |  containers:\n    - name: task-pv-container           |    - name: task-pv-container\n      image: nginx                      |      image: nginx\n      ports:                            |      ports:\n        - containerPort: 80             |        - containerPort: 80\n          name: &quot;http-server&quot;           |          name: &quot;http-server&quot;\n      volumeMounts:                     |      volumeMounts:\n        - mountPath: &quot;\/usr\/share\/nginx\/h|        - mountPath: &quot;\/var\/www\/html&quot;\ntml&quot;                                    |          name: task-pv-storage\n          name: task-pv-storage         |~\n~                                       |~\n~                                       |~\n~                                       |~\n~                                       |~\npod1.yaml                                pod2.yaml\n<\/pre><\/div>\n\n\n<p>You can now compare those files, copy\/paste some text from one area to the other,\u2026<\/p>\n\n\n\n<p>To copy\/paste you can trivially use the mouse or <strong>CTRL+C<\/strong>\/<strong>CTRL+V<\/strong> between the areas but for the Vim purists you can use <strong>\u201c+y<\/strong> and <strong>\u201c+p<\/strong> to copy and paste to and from the system clipboard register. From my experience it doesn\u2019t work well in all systems (especially in remote access) so I let you experiment with it.<\/p>\n\n\n\n<p>Finally if you want to replace the name nginx by web in the second area, just use the search and replace command in that area only with <strong>:%s\/nginx\/web\/gc<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [12]; title: ; notranslate\" title=\"\">\napiVersion: v1                          |apiVersion: v1\nkind: Pod                               |kind: Pod\nmetadata:                               |metadata:\n  name: task-pv-pod                     |  name: task-pv-pod\nspec:                                   |spec:\n  volumes:                              |  volumes:\n    - name: task-pv-storage             |    - name: task-pv-storage\n      persistentVolumeClaim:            |      persistentVolumeClaim:\n        claimName: task-pv-claim        |        claimName: task-pv-claim\n  containers:                           |  containers:\n    - name: task-pv-container           |    - name: task-pv-container\n      image: nginx                      |      image: web\n      ports:                            |      ports:\n        - containerPort: 80             |        - containerPort: 80\n          name: &quot;http-server&quot;           |          name: &quot;http-server&quot;\n      volumeMounts:                     |      volumeMounts:\n        - mountPath: &quot;\/usr\/share\/nginx\/h|        - mountPath: &quot;\/var\/www\/html&quot;\ntml&quot;                                    |          name: task-pv-storage\n          name: task-pv-storage         |~\n~                                       |~\n~                                       |~\n~                                       |~\n~                                       |~\npod1.yaml                                pod2.yaml &#x5B;+]\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Copy and insert a block and the use of the registers<\/h2>\n\n\n\n<p>Kubernetes manifest files are based on Yaml formatting and it is often useful to be able to copy a block as a container and copy it in order to create a second one.<\/p>\n\n\n\n<p>There are several ways for doing this, let\u2019s explore the most straightforward in my opinion:<\/p>\n\n\n\n<p>First display the line numbers in vim with <strong>:set nu<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: task-pv-pod\n  5 spec:\n  6   volumes:\n  7     - name: task-pv-storage\n  8       persistentVolumeClaim:\n  9         claimName: task-pv-claim\n 10   containers:\n 11     - name: task-pv-container\n 12       image: nginx\n 13       ports:\n 14         - containerPort: 80\n 15           name: &quot;http-server&quot;\n 16       volumeMounts:\n 17         - mountPath: &quot;\/usr\/share\/nginx\/html&quot;\n 18           name: task-pv-storage\n<\/pre><\/div>\n\n\n<p>If we want to copy the container from line 11 to line 15 included then type <strong>:11,15y<\/strong> (y stand for yank which means copy in Vim terminology, note also that using <strong>d<\/strong> instead of <strong>y<\/strong> would just have deleted that block)<\/p>\n\n\n\n<p>Then go to line 15 (as you want to insert that copied block just after that line) with <strong>15gg<\/strong> and paste the copied block with <strong>p<\/strong> (p stand for paste)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [16,17,18,19,20]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: task-pv-pod\n  5 spec:\n  6   volumes:\n  7     - name: task-pv-storage\n  8       persistentVolumeClaim:\n  9         claimName: task-pv-claim\n 10   containers:\n 11     - name: task-pv-container\n 12       image: nginx\n 13       ports:\n 14         - containerPort: 80\n 15           name: &quot;http-server&quot;\n 16     - name: task-pv-container\n 17       image: nginx\n 18       ports:\n 19         - containerPort: 80\n 20           name: &quot;http-server&quot;\n 21       volumeMounts:\n 22         - mountPath: &quot;\/usr\/share\/nginx\/html&quot;\n 23           name: task-pv-storage\n<\/pre><\/div>\n\n\n<p>The second container is now properly inserted and can be modified further to match the requirements for it.<\/p>\n\n\n\n<p>Note that when you yank or delete something (a character, a word, a line,\u2026) in Vim it is stored in an unnamed register that is replaced after each yank or delete operation. Vim also offers 26 additional registers for users that corresponds to each 26 letters of the alphabet. It is then possible to copy something into different registers and paste the one desired by calling its register letter.<\/p>\n\n\n\n<p>Let\u2019s see an example of this where I want to copy the line with the name of the container in the register a and the line with the image of the container in the register b.<\/p>\n\n\n\n<p>To do so type<\/p>\n\n\n\n<p><strong>11gg<\/strong> then <strong>\u201cayy<\/strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; This will copy line 11 into the register a<\/p>\n\n\n\n<p><strong>12gg<\/strong> then <strong>\u201cbyy<\/strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; This will copy line 12 into the register b<\/p>\n\n\n\n<p>Then go to line 20 with <strong>20gg<\/strong> as you will paste your copied lines after it and type:<\/p>\n\n\n\n<p><strong>\u201cap\u201dbp<\/strong> in order to paste the content of register a then register b with the result shown below:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [21,22]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: task-pv-pod\n  5 spec:\n  6   volumes:\n  7     - name: task-pv-storage\n  8       persistentVolumeClaim:\n  9         claimName: task-pv-claim\n 10   containers:\n 11     - name: task-pv-container\n 12       image: nginx\n 13       ports:\n 14         - containerPort: 80\n 15           name: &quot;http-server&quot;\n 16     - name: task-pv-container\n 17       image: nginx\n 18       ports:\n 19         - containerPort: 80\n 20           name: &quot;http-server&quot;\n 21     - name: task-pv-container\n 22       image: nginx\n 23       volumeMounts:\n 24         - mountPath: &quot;\/usr\/share\/nginx\/html&quot;\n<\/pre><\/div>\n\n\n<p>That will create a third container in this pod to work with.<\/p>\n\n\n\n<p>Note that both lines could have been copied at once as shown previously but that example was for education purpose only.<\/p>\n\n\n\n<p>Note also that if you use just <strong>p<\/strong> you still have in the unnamed register the block you\u2019ve copied at the beginning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Use Visual Block to shift blocks at once<\/h2>\n\n\n\n<p>Now let\u2019s push it a bit further and use Visual Block to shift blocks to the left or to the right. Yaml format is strict on the indentation of the elements and often it is required to move a block further to the right or to the left to match those Yaml requirements. When there are several lines to move we could do much better than using <strong>x<\/strong> to delete a character or <strong>i<\/strong> and <strong>space<\/strong> to insert one so let\u2019s see how by using a common scenario: You\u2019ve copied some lines from the Kubernetes documentation and paste them into your yaml file, however the pasting didn\u2019t keep all the formatting very well as shown below:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [8,9,10,11,12,13,14,15,16,17]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: cpu-demo\n  5   namespace: cpu-example\n  6 spec:\n  7   containers:\n  8      - name: cpu-demo-ctr\n  9        image: vish\/stress\n 10        resources:\n 11          limits:\n 12            cpu: &quot;1&quot;\n 13          requests:\n 14            cpu: &quot;0.5&quot;\n 15        args:\n 16        - -cpus\n 17        - &quot;2&quot;\n<\/pre><\/div>\n\n\n<p>I\u2019ve copied the container elements from line 8 to 17 and we can see that it is not properly aligned: The \u2013 before name at line 8 should be exactly below the c of containers above. However all that block itself is properly indented so we just need to shift all that block 3 characters to the left. To do so we go to line 8 with <strong>8gg<\/strong> then type <strong>0<\/strong> to go at the beginning of the line and enter Visual Block with <strong>CTRL+v<\/strong> then use <strong>j<\/strong> (or <strong>down arrow key<\/strong>) to go down the last line then stroke <strong>l<\/strong> (or the <strong>right arrow key<\/strong>) 3 times.<\/p>\n\n\n\n<p>Then press d to delete that whole block and see it now properly positioned:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [8,9,10,11,12,13,14,15,16,17]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: cpu-demo\n  5   namespace: cpu-example\n  6 spec:\n  7   containers:\n  8   - name: cpu-demo-ctr\n  9     image: vish\/stress\n 10     resources:\n 11       limits:\n 12         cpu: &quot;1&quot;\n 13       requests:\n 14         cpu: &quot;0.5&quot;\n 15     args:\n 16     - -cpus\n 17     - &quot;2&quot;\n<\/pre><\/div>\n\n\n<p>Now let\u2019s have a look at the opposite scenario where the block needs to be pushed to the right:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [8,9,10,11,12,13,14,15,16,17]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: cpu-demo\n  5   namespace: cpu-example\n  6 spec:\n  7   containers:\n  8  - name: cpu-demo-ctr\n  9    image: vish\/stress\n 10    resources:\n 11      limits:\n 12        cpu: &quot;1&quot;\n 13      requests:\n 14        cpu: &quot;0.5&quot;\n 15    args:\n 16    - -cpus\n 17    - &quot;2&quot;\n<\/pre><\/div>\n\n\n<p>We can see now that the same container block needs to be pushed with one space character to the right in order to match the Yaml requirements.<\/p>\n\n\n\n<p>Go to the beginning of line 8 as shown previously and enter Visual Block mode again with <strong>CTRL+v<\/strong> then use <strong>j<\/strong> (or <strong>down arrow key<\/strong>) to go down the last line (to select the block you want to work with) then type <strong>SHIFT+i<\/strong> then <strong>SPACE<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [8]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: cpu-demo\n  5   namespace: cpu-example\n  6 spec:\n  7   containers:\n  8   - name: cpu-demo-ctr\n  9    image: vish\/stress\n 10    resources:\n 11      limits:\n 12        cpu: &quot;1&quot;\n 13      requests:\n 14        cpu: &quot;0.5&quot;\n 15    args:\n 16    - -cpus\n 17    - &quot;2&quot;\n<\/pre><\/div>\n\n\n<p>Line 8 is now properly positioned so type <strong>ESC<\/strong> twice and it\u2019s almost magical but all the lines of the defined block will also move by one space to the right automatically:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; highlight: [8,9,10,11,12,13,14,15,16,17]; title: ; notranslate\" title=\"\">\n  1 apiVersion: v1\n  2 kind: Pod\n  3 metadata:\n  4   name: cpu-demo\n  5   namespace: cpu-example\n  6 spec:\n  7   containers:\n  8   - name: cpu-demo-ctr\n  9     image: vish\/stress\n 10     resources:\n 11       limits:\n 12         cpu: &quot;1&quot;\n 13       requests:\n 14         cpu: &quot;0.5&quot;\n 15     args:\n 16     - -cpus\n 17     - &quot;2&quot;\n<\/pre><\/div>\n\n\n<p>The whole block is now properly aligned!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Last but not least<\/h2>\n\n\n\n<p>If the editing goes wrong at some point, don\u2019t panic and press <strong>ESC<\/strong> then <strong>u<\/strong> in order to undo the last operation and continue to press <strong>u<\/strong> in order to further undo. If you went too far in the undo then press <strong>CTRL<\/strong>+<strong>r<\/strong> in order to replay that last action and you can also go further in the replay by repeating that sequence.<\/p>\n\n\n\n<p>Of course those Tips &amp; Tricks are not limited to Kubernetes and CKA and can be used in any text editing context.<\/p>\n\n\n\n<p>There are obviously much more as Vim possibilities look limitless but I hope you\u2019ve learned something that can help you being more efficient with text editing by using Vim. This can be a game changer when passing the CKA exam, I&#8217;ve successfully passed it a few days ago and applying those Tips &amp; Tricks allowed me to be quick and have time in the end to review my work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After being a regular reader of this blog for months, I&#8217;m thrilled to publish my first post! Vim is a very powerful editing tool to know in Linux and sometimes the only text editor available when connected to a machine using command line interface.Regarding the CKA exam, it is the text editor selected to be [&hellip;]<\/p>\n","protected":false},"author":109,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1320,1522],"tags":[2633,2634,2607,2608,2629],"type_dbi":[],"class_list":["post-17872","post","type-post","status-publish","format-standard","hentry","category-devops","category-kubernetes","tag-cka","tag-kubernetes-2","tag-vi","tag-vim","tag-yaml"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Vim Tips &amp; Tricks for the Kubernetes CKA exam - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vim Tips &amp; Tricks for the Kubernetes CKA exam\" \/>\n<meta property=\"og:description\" content=\"After being a regular reader of this blog for months, I&#8217;m thrilled to publish my first post! Vim is a very powerful editing tool to know in Linux and sometimes the only text editor available when connected to a machine using command line interface.Regarding the CKA exam, it is the text editor selected to be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-28T13:39:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-05T06:31:59+00:00\" \/>\n<meta name=\"author\" content=\"DevOps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DevOps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/\"},\"author\":{\"name\":\"DevOps\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/4cd1b5f8a3de93f05a16ab8d7d2b7735\"},\"headline\":\"Vim Tips &amp; Tricks for the Kubernetes CKA exam\",\"datePublished\":\"2022-07-28T13:39:42+00:00\",\"dateModified\":\"2022-08-05T06:31:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/\"},\"wordCount\":1510,\"commentCount\":0,\"keywords\":[\"CKA\",\"kubernetes\",\"vi\",\"vim\",\"yaml\"],\"articleSection\":[\"DevOps\",\"Kubernetes\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/\",\"name\":\"Vim Tips &amp; Tricks for the Kubernetes CKA exam - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2022-07-28T13:39:42+00:00\",\"dateModified\":\"2022-08-05T06:31:59+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/4cd1b5f8a3de93f05a16ab8d7d2b7735\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/vim-tips-tricks-for-the-kubernetes-cka-exam\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vim Tips &amp; Tricks for the Kubernetes CKA exam\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/4cd1b5f8a3de93f05a16ab8d7d2b7735\",\"name\":\"DevOps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"caption\":\"DevOps\"},\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/devops\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Vim Tips &amp; Tricks for the Kubernetes CKA exam - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/","og_locale":"en_US","og_type":"article","og_title":"Vim Tips &amp; Tricks for the Kubernetes CKA exam","og_description":"After being a regular reader of this blog for months, I&#8217;m thrilled to publish my first post! Vim is a very powerful editing tool to know in Linux and sometimes the only text editor available when connected to a machine using command line interface.Regarding the CKA exam, it is the text editor selected to be [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/","og_site_name":"dbi Blog","article_published_time":"2022-07-28T13:39:42+00:00","article_modified_time":"2022-08-05T06:31:59+00:00","author":"DevOps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DevOps","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/"},"author":{"name":"DevOps","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735"},"headline":"Vim Tips &amp; Tricks for the Kubernetes CKA exam","datePublished":"2022-07-28T13:39:42+00:00","dateModified":"2022-08-05T06:31:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/"},"wordCount":1510,"commentCount":0,"keywords":["CKA","kubernetes","vi","vim","yaml"],"articleSection":["DevOps","Kubernetes"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/","url":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/","name":"Vim Tips &amp; Tricks for the Kubernetes CKA exam - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2022-07-28T13:39:42+00:00","dateModified":"2022-08-05T06:31:59+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/vim-tips-tricks-for-the-kubernetes-cka-exam\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Vim Tips &amp; Tricks for the Kubernetes CKA exam"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735","name":"DevOps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","caption":"DevOps"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/devops\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=17872"}],"version-history":[{"count":69,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17872\/revisions"}],"predecessor-version":[{"id":18309,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17872\/revisions\/18309"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=17872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=17872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=17872"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=17872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}