{"id":25566554,"url":"https://github.com/pdmlab/vim-cheatsheet","last_synced_at":"2026-01-28T15:07:31.765Z","repository":{"id":66175072,"uuid":"51457515","full_name":"PDMLab/vim-cheatsheet","owner":"PDMLab","description":"Yet another vim cheatsheet, created from personal use.","archived":false,"fork":false,"pushed_at":"2018-06-29T21:11:53.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T11:42:20.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PDMLab.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-10T17:23:31.000Z","updated_at":"2018-06-29T21:11:54.000Z","dependencies_parsed_at":"2023-02-20T23:15:59.633Z","dependency_job_id":null,"html_url":"https://github.com/PDMLab/vim-cheatsheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PDMLab/vim-cheatsheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fvim-cheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fvim-cheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fvim-cheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fvim-cheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PDMLab","download_url":"https://codeload.github.com/PDMLab/vim-cheatsheet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fvim-cheatsheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-02-20T22:33:06.712Z","updated_at":"2026-01-28T15:07:31.759Z","avatar_url":"https://github.com/PDMLab.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim cheat sheet for Ubuntu\n\n## General\n\nFirst, install ```vim-gtk``` to make sure copy / paste between vim and and system clipboard works:\n\n```\nsudo apt-get install vim-gtk\n```\n\n## Keyboard shortcuts\n\n### Files\n\n```:w \u003cfilename\u003e``` write file using a new name (save as)\n```:w``` save current file\n```:vnew``` create new file in vertically split window\n```:new``` create new file in horizontally split window\n```:tabedit \u003cfilename\u003e``` open \u003cfilename\u003e in new tab\n```:q``` close file / vim\n```:q!``` close file / vim and discard changes\n```:x``` close file / vim and save changes\n\n### Navigation\n```gg``` go to beginning of the file\n```G``` go to the end of the file\n```\u003cn\u003egt``` switch tabs by number (n = number of tab)\n```CTRL+w``` switch between splits\n```/\u003ctext\u003e``` find text\n```n``` after ```/``` find next search result\n```N``` after ```/``` find previous search result\n\n### Selecting, copy/paste, formatting etc.\n```V``` Visual Mode, now you can select parts of the file using arrow keys\n```ggVG``` select all\n```y``` copy selection to buffer\n```p``` paste buffer\n```dd``` delete current line\n```u``` undo\n```\"+p``` paste from system clipboard\n```\"+y``` copy to system clipboard\n```gg=G``` reformat file\n```V=``` reformat selection\n```=``` reindent current section\n\n## Modes\nVim has several modes.\n```Normal``` mode is active after you opened vim (or a file using vim).\nIn normal mode you can not edit text, but you can execute commands as shown below.\n\n```Insert``` mode allows you to edit text. You can activate insert mode by pressing ```i``` in normal mode.\nYou can exit insert mode by pressing ```ESC```\n\n```Visual``` mode allows you to select text.\nIt can be activated by hitting ```V```.\nYou can exit visual mode by pressing ```ESC```\n\n## Configuration in ~/.vim/.vimrc\n```set nocp``` enabling features which are not Vi compatible but really nice.\n```set number``` enable line numbers\n```syntax on``` enbale syntax highlighting\n```filetype plugin indent on``` language-dependent indenting\n```set backspace=indent,eol,start``` enable backspace key\n\n## Plugins\n\nPlugins are installed using Pathogen, a plugin system for vim.\nSo we have to install Pathogen first:\n\n```\nmkdir -p ~/.vim/autoload ~/.vim/bundle\ncurl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim\n```\n\nIn ```~/.vim/.vimrc``` add:\n\n```\nexecute pathogen#infect()\n```\n\n### FuzzyFinder\n\n[FuzzyFinder](http://www.vim.org/scripts/script.php?script_id=1984) is a File Explorer for vim.\n\n#### Installing FuzzyFinder\n\n```\ncd ~/.vim/bundle\ngit clone git@github.com:vim-scripts/L9.git\ngit clone git@github.com:vim-scripts/FuzzyFinder.git\n```\n\n#### Using FuzzyFinder\n\n```:FufFile``` opens file explorer of ```FuzzyFinder```i\n```CTRL+Enter``` opens a file in a new split\n```CTRL+L``` opens a file in a new tab\n\nAs a shortcut to open ```FuzzyFinder``` file explorer in current folder, add this to ```~/.vim/.vimrc```:\n\n```\nmap ,f :FufFile **/\u003cCR\u003e\n```\n\nFiles can now be browsed using ```,f```.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdmlab%2Fvim-cheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdmlab%2Fvim-cheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdmlab%2Fvim-cheatsheet/lists"}