Siv VIM: Qhov Kev Qhia Ua Yooj Yim.

Kuv yeej tsis xav tias kuv twb yuav hais qhov no, tab sis kuv zoo kawg li kuv nyiam tshaj tawm muaj rau lub davhlau ya nyob twg hauv GNU / Linux: VIM.

Kev xam phaj Wikipedia:

Vim (ntawm tus lus Askiv Kuv pom IMproved) yog qhov kev hloov kho dua ntawm cov ntawv nyeem editor vi, tam sim no nyob hauv txhua lub UNIX.

Nws sau, Bram Moolenaar, hais nyob thawj hauv hauv 1991, hnub tim uas nws tau hla ntau yam kev txhim kho. Lub ntsiab tseem ceeb ntawm Vim Thiab V yog tias lawv muaj cov qauv sib txawv uas tuaj yeem hloov ntawm kev ua qee yam kev ua haujlwm, uas sib txawv ntawm lawv los ntawm feem ntau cov editors, uas muaj tsuas yog ib hom uas cov xaj yog nkag nrog siv sib txuas tseem ceeb lossis graphical interfaces.

Kuv yog ib tug ntawm cov neeg xav hais tias qhov no yog kho kom zoo rau "octopuses" lossis cov neeg uas muaj ntau tshaj 10 tus ntiv tes, vim tias qhov tseeb yooj yim ntawm muaj ntau cov ntawv qhia luv luv ua rau kuv xav tias VIM nws yog "dab" ntawm console editors. Qhov tseeb yog tias txij li nag hmo kuv tau kawm siv nws (txawm tias muaj tej yam yooj yim me ntsis xwb) tab sis kuv tau txais nws siv, thiab qhov phem tshaj plaws (lossis zoo tshaj plaws) nws tias yog kuv nyiam nws heev.

Kuv ib txwm tau xis nyob ntawm kev ua haujlwm ntawm nano, tab sis nws yog qhov tseeb tias qhov hloov kho no dhau dhau. Thaum peb muaj qhov graphical ib puag ncig, tus cursor tuaj yeem siv los theej / sau, tab sis thaum peb nyob hauv TTY yam hloov. Qhov ntawd yog thawj qhov zoo uas kuv pom VIMCov. Lwm cov nta uas kuv nyiam yog:

  • Xaiv cov ntawv hauv kab ntawv.
  • Syntax kev tsom.
  • Tshaj tawm ntawm kev ua vajvoog, nkhaus thiab kev zaws (ua rau nws zoo tagnrho rau lub cajmeem).
  • Muaj zog heev, txawm tias cov ntaub ntawv peb hloov kho tsis cuam tshuam, nws cia peb kom rov qab nws tom qab.
  • Ntawm no koj tuaj yeem pom ntau ntxiv ...

Cov ntawv nyeem tsuas editor hauv console (ntawm cov kuv paub) uas "txoj hau kev" rau VIM es MCEdit, MC ntawv tshaj xo. Tab sis pom cov cim hauv nqe lus saum toj no. VIM txawm muaj tus sau GTK editor. Tab sis lub tswv yim ntawm cov ncej no tsis yog muag koj lossis txhawb lawv kom siv VIM, nws tsuas yog ib txoj kev qhia rau koj tias nws yooj yim siv dua qhov nws tshwm sim tiag tiag.

Qhia qhov yooj yim ntawm kev siv VIM

Kuv tau xav txog qhov tawm ntawm koj qee qhov ntawm keyboard shortcuts, tab sis kuv xav tias nws yuav tsim nyog ntau yog tias kuv pom koj li cas nws ua haujlwm los ntawm kev ua piv txwv. Thawj qhov peb yuav ua yog teeb tsa VIM Yog tias peb tseem tsis tau ua nws, lossis yog tias nws tsis tuaj lub neej ntawm hauv peb txoj kev faib khoom. Ib zaug ntsia, peb qhib lub davhlau ya nyob twg thiab muab tso rau:

$ vim prueba.txt

Peb yuav pom qee yam zoo li no:

Tam sim no peb nias tus yuam sij I lossis tus yuam sij Insert hloov ntawm kev hais kom ua hom hloov hom thiab pib ntaus ntawv. Peb sau txhua yam, yog tias ua tau, ntev dua ob kab. Kuv muab ua piv txwv muab:

Tam sim no, peb nias tus yuam sij ESC Txhawm rau tawm txoj kev hloov kho hom, peb tsiv mus rau qhov pib ntawm daim ntawv nrog cov keyboard naus thiab nias tus yuam sij V. Koj yuav pom tias hauv qab no hais tam sim no VISUALCov. Nrog rau tus nqes hauv qab peb kos tag nrho cov kab lus uas peb sau. Thaum peb tau xaiv txhua yam, peb nias tus yuam sij YCov. Thaum ua tiav no, koj yuav pom tias hauv qab no nws qhia tus naj npawb ntawm kab ntawv tau theej.

Tam sim no peb txav qis me ntsis thiab nias tus yuam sij PCov. Txhua lub sijhawm peb nias nws, tib cov ntawv yuav dhau los. Yog tias tsis hloov tus yuam sij Y peb nias tus yuam sij X, cov ntawv peb xaiv yuav raug txiav tawm. Peb tuaj yeem muab tshuaj txhuam nws dua nrog tus yuam sij P.

Tam sim no peb tab tom yuav khaws cov ntawv xeem. Peb nias ESC Yog tias peb tab tom hloov kho hom thiab peb sau :w, uas yog, ob lub ntsiab lus thiab a W. Qhov no ua dab tsi yog sau los yog txuag peb ua dab tsi. Yog tias peb sau tom qab :q peb yuav tawm ntawm lub editor. Yog tias peb xav tau dab tsi los cawm thiab kaw, peb sau 😡.

Tam sim no ib tug ua kom yuam kev kawg. Piv txwv tias lub davhlau ya nyob twg muaj kev sib tsoo thiab peb poob daim ntawv. Peb yuav tsum ua dab tsi yog rov sau dua:

$ vim prueba.txt

thiab peb yuav tau txais qee yam zoo li no:

Yog tias koj saib thaum kawg peb tau muaj cov kev xaiv. Hauv qhov no peb nias tus yuam sij R txhawm rau khaws cov ntaub ntawv dhau los, tom qab ntawd nws yuav hais kom peb nias ENTER Thiab voila, peb tuaj yeem txuas ntxiv qhov twg peb sab laug. Tam sim no, yog tias los ntawm lub caij nyoog peb ntaus tus yuam sij E (kho rau lawm) peb tseem tuaj yeem khaws cov ntawv los ntawm kev ntaus ntawv : rov qab, thiab peb yuav tau txais qee yam zoo li no:

Hauv qhov no kuv qhov kev xaiv yog sau tus naj npawb 1 thiab voila, peb kev ua haujlwm tau rov qab zoo dua.

Yog tias koj xav siv VIM yooj yim dua, tom qab ntawd koj tuaj yeem nruab GVIM, uas yog tib qho siv Gtk qiv rau kev siv Menus thiab lwm yam kev xaiv uas pab txhawb tus neeg ua haujlwm txoj haujlwm.

Muaj txawm tias txuas ntxiv rau Firefox hu Vimxej, uas tso cai rau peb tuav lub browser li yog VIM nws yuav 😀

Thiab no deb Yuav ua li cas, txhua cov lus qhia lossis xov xwm tau txais tos kom peb txhua tus tuaj yeem kawm paub ntau yam muaj txiaj ntsig zoo VIM.


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

21 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm. Yuav tsum tau teb cov cim nrog *

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   nano said

    Kuv yuav siv Gvim, txawm hais tias kuv tsis tau pom lub syntax highlighting thiab nws yuav zoo yog tias koj tso cov duab ntawm qee cov ntawv nyeem hauv HTML kom pom tias txhua yam ntawd zoo li cas. Kuv yuav tau mus ua haujlwm nrog Vim thiab tom qab ntawd kuv ua ib qho ntawm cov kev tsom xam tob zoo li kuv tau ua nrog Gedit ... muab rau kuv ib lub lis piam thiab kuv muaj nws.

    1.    Abel said

      Yog tias koj xav pom li cas syntax highlighting ua haujlwm ces kuv tso koj ob peb tus piv txwv.
      ompldr.org/vZTRlYg
      ompldr.org/vZDd3cw

      Thiab nyob rau hauv ib qhov txuas txuas hauv qab no ntau tus qauv dag kom nws pom tau ntau dua. xP

      Txais tos.

  2.   slayer said

    Vim tias qhov kev qhia nyeem yog qhov zoo heev, cia siab tias ib qho yuav ua tom qab, me ntsis ntau dua lossis qee qhov kev paub ntau ntxiv, uas tuaj yeem ua nrog cov cuab yeej no;),
    rau lub sijhawm nkag mus rau hauv lub ntiaj teb no ntawm vim tam sim no

  3.   ren434 said

    Nyob rau lub sijhawm kuv tau nyam nrog emacs, uas ntev dhau los kuv muaj ntau dua thiab ntau dua, ntawm qhov tod tes vim ua rau nws nyuaj rau kuv txav ntawm cov ntawv nyeem.

    PS: Zoo siab! Lawv yog thawj zaug hauv Kev Sib Koom Tes.

    1.    msx said

      +1

      Peb cov txiv neej siv Emacs, koj paub!
      Thaum kuv pib nyeem "Kuv yeej tsis xav tias kuv yuav hais txog qhov no, tab sis kuv zoo kawg li kuv nyiam cov neeg uas ua haujlwm zoo rau lub davhlau ya nyob twg ntawm GNU / Linux ..." Kuv xav: zoo, nws nrhiav tau Emacs!
      Hloov nws tus kheej tias tus yawg mus nrog queers 😛 yam uas pom ib qho ntawm cov!

      1.    elav <° Linux said

        Ohh macho. Kuv twv ces koj siv LFS, vim tias siv ib qho cuam tshuam nrog txhua yam chewed Kuv xav tias nws tseem yog txoj cai fagot?

        1.    peb 92 said

          Tus txiv neej emacs zoo li kuv yooj yim dua vim li tab sis rau cov xim tastes.

  4.   Dave said

    vimtutor yog qhov kev sib tham ua tau zoo heev, nws tsim los ua kom tiav rau hauv 25-30 feeb. pom zoo heev!
    apt-get install vimtutor
    vimtutor

    1.    nano said

      Tias paub tseeb ua haujlwm rau kuv, Kuv yuav tsum ua haujlwm ntawm qhov ntawd

    2.    elav <° Linux said

      Yog lawm, Vimtutor ua tau zoo kawg ...

  5.   wheezy said

    Ua si qhov kev ua si thiab qhov ntawd yog thaum koj yuav tsis nres siv vim thiab koj yuav kawm siv nws ruam ruam, tiag tiag, koj yuav xyaum ntau nrog qhov kev ua si no qhov yooj yim tshaj plaws txog vim xws li paub yuav txav mus nrawm heev.

    http://vim-adventures.com/

  6.   Maurice said

    Kuv tsis yog tus tsim tawm, yog li qhov kuv yuav tsum tau ua: hloov qee qhov .conf lossis muab kuv txhais tes tso rau hauv pkbuild qee lub sijhawm, nrog NANO nws txaus rau kuv thiab kuv muaj ntau yam. Ib zaug rau kev sim Kuv tau qhib cov ntaub ntawv hauv VIM thiab kuv tsis paub tias yuav ua li cas kom tawm ntawm qhov ntawd.

  7.   Abel said

    Zoo nkauj pib rau cov neeg uas pib nrog vim, txawm tias kuv xav tias nws yog dab tab sis zoo li txhua yam, nws tsuas yog qhov teeb meem ntawm tus cwj pwm. xP

    Kuv tawm hauv ntau qhov schemes rau cov neeg uas xav sim.
    http://code.google.com/p/vimcolorschemetest/

    Txais tos.

  8.   kom said

    @elav, Kuv tso koj vim kuvrcrc yog li koj tuaj yeem siv qee qhov ua haujlwm uas ua haujlwm rau koj 😉
    http://paste.desdelinux.net/4465

    1.    elav <° Linux said

      Ua Tsaug 😀

  9.   Annubis said

    Kuv tau txais saj rau cov editor zoo uas tshwm sim rau lub davhlau ya nyob twg hauv GNU / Linux

    Koj nyiam ua nplaim taws, huh? Qhov no tej zaum yog tus nplaim teeb ua qub tshaj plaws

    PS: VI Pob Zeb!

  10.   Ntxim ntxub said

    Kev qhia zoo! ua tsaug ntau 😀

  11.   tshuab said

    nthuav heev: 3

  12.   JSequeiros said

    Qee yam theem pib ib txwm ua tau zoo.

  13.   Rene, tuaj ntawm Mexico, tuaj yeem. said

    Nws yog qhov zoo kom paub me ntsis txog txhua yam, yog tias muaj ib hnub koj xav tau, Tus txiv neej ntse yuav nco ntsoov saib qhov kev fij ntawm lwm tus neeg.

  14.   Bill said

    Kev qhia zoo tab sis kuv tshiab rau qhov no thiab kuv tsis paub yuav ua li cas ntxiv brigthscript editor rau gvim https://github.com/chooh/brightscript.vim.git Thov koj pab kuv puas tau