Code Monkey home page Code Monkey logo

vim's Introduction

Belajar Vi dan Vim

Vi merupakan teks editor default, yang ada pada setiap sistem operasi berbasis UNIX. Sedangkan Vim merupakan teks editor tiruan Vi, namun telah ditingkatkan sehingga memiliki lebih banyak fitur daripada Vi.

Membuat dan Masuk ke dalam File

vi <nama_file>
vim <nama_file>
  • contoh
vi index.html
vim index.html

Menyimpan Kegiatan (Melakukan Save)

:w!

Keluar Vi/Vim Tanpa Menyimpan Kegiatan

:q!

Keluar Vi/Vim Dengan Menyimpan Kegiatan

:wq!

Memindahkan Kursor

  • Memindahkan Kursor ke bawah
tekan j
  • Memindahkan Kursor ke atas
tekan k
  • Memindahkan Kursor ke kanan
tekan l
  • Memindahkan Kursor ke atas
tekan h
  • Memindahkan Kursor ke colom paling atas/pertama
tekan gg
  • Memindahkan Kursor ke colom paling bawah/terakhir
tekan G (Huruf Kapital)
  • Memindahkan Kursor ke baris paling kiri
tekan 0 (nol)
  • Memindahkan Kursor ke baris paling kanan
tekan $ (Dollar)

Insert Text

  • Insert text ke kiri
tekan i
  • Insert text ke kanan
tekan a
  • Insert text ke kolom selanjutnya
tekan o
  • Insert text ke kolom sebelumnya
tekan O (Huruf Kapital)

Delete Text

  • Delete text satu baris
tekan dd
  • Delete text, satu kata ke kanan
tekan dw
  • Delete text, satu kata ke kiri
tekan db
  • Delete text, semua baris
tekan dG

Copy Text

  • Copy text satu baris
tekan yy

Cut Text

  • Cut text satu baris
tekan dd
  • Cut text, satu kata ke kanan
tekan dw
  • Cut text, satu kata ke kiri
tekan db
  • Cut text, semua baris
tekan dG

Paste Text

  • Paste text kebawah kolom
tekan p
  • Paste text keatas kolom
tekan P (Huruf Kapital)

Find Text

tekan /

contoh pencarian

tekan /html

setelah itu tekan n (kecil) untuk mencari kalimat atau text ke bawah. lalu tekan N (besar) untuk mencari kalimat atau text ke atas.

Replace Text

  • Mengganti seluruh text

:%s/text_yang_diubah/text_baru/g
  • contoh
:%s/html/css/g
  • Mengganti text dengan mengecek dan bertanya text yang mau diubah

:%s/text_yang_diubah/text_baru/gc
  • contoh
:%s/html/css/gc

Catatan

Set Number

Set number digunakan untuk menampilkan angka pada setiap baris di code editor Vi dan Vim

:set number

Syntax On

Syntax on digunakan untuk menghighlight code pada Vi dan Vim.

:syntax on

vim's People

Contributors

galanghanaf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.