{"id":13898419,"url":"https://github.com/kurkale6ka/vim","last_synced_at":"2025-07-17T15:33:41.833Z","repository":{"id":65067272,"uuid":"2522747","full_name":"kurkale6ka/vim","owner":"kurkale6ka","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-14T14:43:24.000Z","size":15379,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-10T02:32:01.407Z","etag":null,"topics":["vim","vim-tips"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kurkale6ka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-05T22:39:46.000Z","updated_at":"2022-12-30T15:55:33.000Z","dependencies_parsed_at":"2023-02-01T04:00:30.309Z","dependency_job_id":null,"html_url":"https://github.com/kurkale6ka/vim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkale6ka%2Fvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkale6ka%2Fvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkale6ka%2Fvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkale6ka%2Fvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurkale6ka","download_url":"https://codeload.github.com/kurkale6ka/vim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":214236339,"owners_count":15703474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vim","vim-tips"],"created_at":"2024-08-06T18:04:17.116Z","updated_at":"2024-08-06T18:09:53.338Z","avatar_url":"https://github.com/kurkale6ka.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"Vim tips\n========\n\n***Notes:***\n* `[]` will be used to represent the position of the cursor\n* `^a` means `Ctrl+a`\n* `:h topic` can be used to access Vim's help section on `topic`\n* `:h` on its own - help main page\n* `^\u003cLeftMouse\u003e` - jump to tag (link) under cursor, `^\u003cRightMouse\u003e` - jump back\n* It is **IMPORTANT** to run Vim in nocompatible mode (`:h'cp`)\n* `:ve` will list all enabled (+) features\n* **vimtutor** on the command line will teach you some basics\n\n```\n I - insert at the beginning of line (:h I)\n A - append at the end of line\n D - delete to the end of line\n2D - delete to the end of line + next line\n C - change to the end of line\n```\n***Note:*** compare with their lowercase counterparts (eg: `:h i`)\n\n```\no - open line below (:h o)\nO - open line above\n```\n\n```\nModify 2 lines: d\u003cup\u003e   (delete)\n                y\u003cDown\u003e (copy)\n```\n\n```\n          xs - change 2 characters (:h s)\n          4s - change 4 characters (mnemo: substitute)\n          cc - change current line\n          de - delete to the end of word\n         2cE - change to the end of second WORD for current position (:h WORD)\n      d/word - delete to next occurence of word\nd\u003cLeftMouse\u003e - delete to where you click with your mouse\n   :g/word/d - delete all lines containing word (:g/word shows them, :h:g)\n           R - enter replace mode (:h R)\n```\n\n```\n vB - select back to the beginning of WORD (:h v)\n5yy - copy (yank) 5 lines\n  P - paste above current line (:h P, :h]p, :h[p)\n```\n\n```\n u - undo\n^r - redo\n U - undo all changes in current line\n```\n\n```\n* - search for word under cursor (mnemo: * often stands for all, :h*)\n. - repeat previous action (:h.)\n```\n\n`:e ^d` - select a file to edit (mnemo: \u003cstrong\u003ed\u003c/strong\u003eisplay)\n\nWindow Splitting\n----------------\n1. `:h^ws` - \u003cstrong\u003ew\u003c/strong\u003eindow \u003cstrong\u003es\u003c/strong\u003eplit\n2. `:h^wv` - \u003cstrong\u003ew\u003c/strong\u003eindow \u003cstrong\u003ev\u003c/strong\u003eertical\n3. `:h^wc` - \u003cstrong\u003ew\u003c/strong\u003eindow \u003cstrong\u003ec\u003c/strong\u003elose\n\nJump to previous position\n-------------------------\n```\nexample: while on line 23, use gg to go to the start of the file,\n         `` will then bring you back, (:h``, :h jump-motions)\n```\n\nComplete word in insert mode\n----------------------------\n```\noriginal: Lorem ipsum dolor sit amet, consectetur l^p\nmodified: Lorem ipsum dolor sit amet, consectetur lorem\n          (:h i^p, :h i^n (i is for insert, compare with :h^p), :h'spell)\n```\n\nCopy from above in insert mode (`:h i^y`, `:h i^e`)\n---------------------------------------------------\n```\nexample: Lorem ipsum dolor sit amet, consectetur\n         [] (cursor on next line, under L)\n action: ^y^y^y^y^y^y^y\n result: Lorem i\n```\n\nJoin lines\n----------\n```\noriginal: Lorem ipsum dolor sit amet, c[o]nsectetur adipisicing elit, sed do\n          eiusmod tempor incididunt ut labore et dolore magna aliqua.\n  action: J\nmodified: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n```\n\nMacros\n------\n1. `qa` - start recording in register `a` (`qq` would record in register `q`, `:h q`)\n2. `q`  - stop recording\n3. `@a` - execute actions recorded in register `a`\n\n***Example:***\n```\n     original: [L]orem ipsum dolor sit amet, consectetur\n        macro: qqe2hveUWq (q(record)q...q(stop))\n  explanation: e2hveUW means: go to the end of word\n                              return 2 characters back\n                              select visually to the end of word\n                              make uppercase\n                              go to next WORD (:h WORD)\nexecute macro: 5@q (repeat 5 times)\n     modified: LoREM ipSUM doLOR SIT aMET, consecteTUR\n```\n\nText objects (`:h text-objects`, needs the `+textobjects` feature)\n------------------------------------------------------------------\n```\noriginal: [L]orem ipsum 'dolor sit amet', consectetur\n  action: ci' (change inside quotes)\nmodified: [L]orem ipsum '', consectetur\n```\n\n```\noriginal: Lore[m] ipsum dolor sit amet, consectetur\n  action: daw (delete a word)\nmodified: ipsum dolor sit amet, consectetur\n```\n\n```\noriginal: Lorem ipsum dolor sit a[m]et, consectetur\n  action: daW (delete a WORD)\nmodified: Lorem ipsum dolor sit consectetur\n```\n\nTo specified character (`:h t`, `:h f`)\n---------------------------------------\n```\noriginal: Lorem [i]psum dolor sit amet, consectetur\n  action: tl ((go) to l)\n  result: Lorem ipsum d[o]lor sit amet, consectetur\n```\n\n```\noriginal: Lorem [i]psum dolor sit amet, consectetur\n  action: cto (change to o)\n  result: Lorem olor sit amet, consectetur\n```\n\n```\noriginal: Lorem [i]psum dolor sit amet, consectetur\n  action: dfc (delete to (forward) c (included))\n  result: Lorem onsectetur\n```\n\nVisual block insert (`:h v_b_I`)\n--------------------------------\n```\noriginal: [L]orem ipsum dolor sit amet, consectetur\n          incididunt ut labore et dolore magna\n actions: ^v\u003cDown\u003eI--\u003cesc\u003e\nmodified: --Lorem ipsum dolor sit amet, consectetur\n          --incididunt ut labore et dolore magna\n```\n\nVisual block delete (`:h v_b_D`)\n--------------------------------\n```\noriginal: Lorem ipsum dolor sit ame[t], consectetur\n          incididunt ut labore et dolore magna\n actions: ^v\u003cDown\u003eD\nmodified: Lorem ipsum dolor sit ame\n          incididunt ut labore et d\n```\n\nVisual paste (`:h v_p`)\n-----------------------\n```\noriginal: Lorem ipsum [d]olor sit amet, consectetur\n  action: yt,3Wviwp (copy to , then go 3 WORDs forward, select and paste)\nmodified: Lorem ipsum dolor sit amet, dolor sit amet\n```\n\n`gv` - reselect previously selected visual area (mnemo: \u003cstrong\u003eg\u003c/strong\u003eo \u003cstrong\u003ev\u003c/strong\u003eisual, `:h gv`, `:h v_o`)\n\nSearch and replace\n------------------\n```\noriginal: Lorem,ipsum,[d]olor,sit,amet,consectetur\n  action: :s/,\\zs/\\r/g (:h:s, :h/\\zs (z start), :h/\\r (\u003ccr\u003e))\nmodified: Lorem,\n          ipsum,\n          dolor,\n          sit,\n          amet,\n          consectetur\n```\n***Note:*** `%s/old/new/gc` will replace all occurrences of old in the file and ask\n                    you to confirm (`:h:%`, `:h:s_flags`)\n\nOpen a file from within an edited file (`:h gf`)\n------------------------------------------------\n```\nexample: Lorem ipsum /et[c]/fstab, consectetur\n action: gf (goto file)\n result: you are now editing /etc/fstab\n         (your other file is still opened in another buffer, go back with :e# or\n         :bp (buffer previous) or ^6 or ^^, :h e#, :h:bp, :h^^)\n```\n\nChange to upper case (`:h v_U`, `:h v_u`, `:h~`)\n------------------------------------------------\n```\noriginal: L[o]rem ipsum dolor sit amet, consectetur\n  action: viwU\nmodified: LOREM ipsum dolor sit amet, consectetur\n```\n\nAdd, substract (`:h^a`, `:h^x`)\n-------------------------------\n```\noriginal: L[o]rem ipsum dolor sit amet, 9\n  action: 2^a\nmodified: Lorem ipsum dolor sit amet, 11\n```\n\nUseful help links:\n------------------\n* `:h tips`\n* `:h usr_28` (folding)\n* `:h usr_40` (mappings)\n* `:h index`\n* `:h'tags`\n* `:h:fin`\n* `:h'pa`\n* `:h:helpg`\n\nPlugins:\n--------\n* https://github.com/junegunn/vim-plug (used for easier install of other plugins)\n* https://github.com/godlygeek/csapprox (gvim colorschemes for terminal)\n* https://github.com/junegunn/vim-easy-align (align stuff vertically)\n* https://github.com/tpope/vim-surround (easier surrounding of text)\n* https://github.com/tpope/vim-commentary (easier commenting of code)\n* https://github.com/SirVer/ultisnips (predefined snippets (skeletons) of text)\n* https://github.com/neomake/neomake (linting)\n\nLinks:\n------\n* http://www.vim.org/\n* http://en.wikipedia.org/wiki/Vim_%28text_editor%29\n* http://en.wikipedia.org/wiki/Vi\n* https://github.com/godlygeek/vim-files/blob/master/.vimrc\n* http://vim.wikia.com/wiki/Vim_on_Freenode\n\nQuit and save: `ZZ`  \nQuit without saving: `ZQ`\n\nMy Vim tips on wikia:\n---------------------\n\n* [A better gm command](http://vim.wikia.com/wiki/A_better_gm_command)\n* [Execute an ex command in a Scratch buffer](http://vim.wikia.com/wiki/List_loaded_scripts)\n* [Easy underlining of lines](http://vim.wikia.com/wiki/Underline_text)\n* [Enhanced Ctrl+A, Ctrl+X](http://vim.wikia.com/wiki/Enhanced_Ctrl-A)\n\nAuthor:\n-------\n\nDimitar Dimitrov: kurkale6ka\n\nmitkofr@yahoo.fr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurkale6ka%2Fvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurkale6ka%2Fvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurkale6ka%2Fvim/lists"}