Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Friday, October 10, 2014

Vim Commands Cheatsheet

Some great Vim commands are listed at Best of Vim Tips.

Moving the Cursor
  • h Move cursor left
  • l Move cursor right
  • k Move cursor up
  • j Move cursor down
  • nG Move cursor to line n
  • $ Move cursor to end of current line
  • 0 Move cursor to beginning of current line
  • w Move cursor forward one word
  • b Move cursor backward one ward
  • fc Move forward to c
  • Fc Move back to c
  • H Move to top of screen
  • M Move to middle of screen
  • L Move to bottom of screen
  • % Move to associated ( ), { }, [ ]
  • ( Move a sentence back
  • ) Move a sentence forward
  • { Move a paragraph back
  • } Move a paragraph forward
Save & Exit
  • :q Quit Vim (fails when changes have been made)
  • :q! Quit without saving
  • :cq Quit always, without saving
  • :w Save current file
  • :w [filename] Save current file as [filename]
  • :wq Save current file and exit
  • :wq! Save current file and exit always
  • :wq [filename] Save to [filename], exit if not editing the last
  • :wq! [filename] Save to [filename] and exit always
  • :[range] wqSave only lines in [range] and exit
  • ZZ Save current file, if modified, and exit
  • ZQ Quit current file and exit
Editing a File
  • :e Edit the current file
  • :e! Edit the current file always, discard any changes to current buffer
  • :e [filename] Edit [filename]
  • :e! [filename] Edit [filename] always, discard any changes to current buffer
  • gf Edit the file whose name is under or after the cursor
Working with multiple files
  • :e [filename] edit a file in a new buffer
  • :bnext or :bn go to the next buffer
  • :bprev or :bp go to the previous buffer
  • :bd delete a buffer (close a file)
  • :sp [filename] open a file in a new buffer and split window
  • :vsp [filename] open a file in a new buffer and vertically split window
  • Ctrl + ws split window
  • Ctrl + ww switch windows
  • Ctrl + wq quit a window
  • Ctrl + wv split window vertically
  • Ctrl + wh move cursor to next buffer (right)
  • Ctrl + wl move cursor to previous buffer (left)
Tabs
  • :tabnew [filename] or :tabn [filename] open a file in a new tab
  • Ctrl + wt move the current split window into its own tab
  • gt or :tabnext or :tabn move to the next tab
  • gT or :tabprev or :tabp move to the previous tab
  • #gt move to tab number #
  • :tabmove # move current tab to the #th position (indexed from 0)
  • :tabclose or :tabc close the current tab and all its windows
  • :tabonly or :tabo close all tabs except for the current one
Inserting Text
  • a Append text after the cursor
  • A Append text at the end of the line
  • i Insert text before the cursor
  • I Insert text before the first non-blank in the line
  • o Begin a new line below the cursor and insert text
  • O Begin a new line above the cursor and insert text
Inserting a File
  • :r [name] Insert the file [name] below the cursor
  • :r ![cmd] Execute [cmd] and insert its standard output below the cursor
Deleting Text
  • x Delete characters under and after the cursor
  • X Delete characters before the cursor
  • d Delete text that [motion] moves over
  • dw Delete word from cursor on
  • db Delete word backward
  • d$ Delete to end of line
  • dd Delete lines
  • D Delete the characters under the cursor until the end of the line
Yank (to copy)
  • yy Yank current line
  • y$ Yank to end of line from cursor
  • yw Yank from cursor to end of current word
  • nyy Yank n lines
Put (or paste)
  • p Paste below cursor
  • P Paste above cursor
  • u Undo last change
  • U Restore line
  • J Join next line down to current line
Substitute (Replace)
  • :s/pattern/string/flags Replace pattern with string according to flags in current line only.
  • :%s/pattern/string/flags Replace pattern with string according to flags in all lines.
  • g Flag - Replace all occurrences of pattern
  • :%s/\<pattern\>/string/g Change only whole words exactly matching 'pattern' to 'string'
  • c Flag - Confirm replaces. 
  • :%s/pattern/string/gc Change each pattern to string, but ask for confirmation first.
  • & Repeat last :s command
Visual commands
  • > shift text right
  • < shift text left
  • y yank (copy) marked text
  • d delete marked text
  • ~ switch case
Other Useful Commands
  • . Repeat last command
  • cw Change current word to new word
  • r Replace one character at the cursor position
  • R Begin overstrike or replace mode
  • :/ [pattern] Search forward for [pattern]
  • :? [pattern] Search backward for [pattern]
Regular Expressions
  • . Any single character except newline
  • * zero or more occurances of any character
  • [...] Any single character specified in the set
  • [^...] Any single character not specified in the set
  • ^ Anchor - beginning of the line
  • $ Anchor - end of line
  • \< Anchor - begining of word
  • \> Anchor - end of word
  • \(...\) Grouping - usually used to group conditions

Sunday, February 03, 2013

Windows Run Commands


To access the "Run" command:

  • Press Windows Key + R on the keyboard.
    or
  • Click "Start" button and then locate the "Run" textfield.

Run Commands:

  1. Accessibility Controls - access.cpl
  2. Accessibility Wizard - accwiz
  3. Add Hardware Wizard - hdwwiz.cpl
  4. Add/Remove Programs - appwiz.cpl
  5. Administrative Tools - control admintools
  6. Automatic Updates - wuaucpl.cpl
  7. Bluetooth Transfer Wizard - fsquirt
  8. Calculator - calc
  9. Certificate Manager - certmgr.msc
  10. Character Map - charmap
  11. Check Disk Utility - chkdsk
  12. Chrome - chrome
  13. Clipboard Viewer - clipbrd
  14. Command Prompt - cmd
  15. Component Services - dcomcnfg
  16. Computer Management - compmgmt.msc
  17. Control Panel - control
  18. Date and Time Properties - timedate.cpl
  19. DDE Shares - ddeshare
  20. Device Manager - devmgmt.msc
  21. Direct X Troubleshooter - dxdiag
  22. Disk Cleanup Utility - cleanmgr
  23. Disk Defragment - dfrg.msc
  24. Disk Management - diskmgmt.msc
  25. Disk Partition Manager - diskpart
  26. Display Properties - control desktop
  27. Display Properties - desk.cpl
  28. Dr. Watson System Troubleshooting­ Utility - drwtsn32
  29. Driver Verifier Utility - verifier
  30. Excel - excel
  31. Event Viewer - eventvwr.msc
  32. File Signature Verification Tool - sigverif
  33. Files and Settings Transfer Tool - migwiz
  34. Findfast - findfast.cpl
  35. Firefox - firefox
  36. Folders Properties - control folders
  37. Fonts - control fonts
  38. Fonts Folder - fonts
  39. Free Cell Card Game - freecell
  40. Game Controllers - joy.cpl
  41. Group Policy Editor (for xp professional) - gpedit.msc
  42. Hearts Card Game - mshearts
  43. Help and Support - helpctr
  44. HyperTerminal - hypertrm
  45. Iexpress Wizard - iexpress
  46. Indexing Service - ciadv.msc
  47. Internet Connection Wizard - icwconn1
  48. Internet Explorer - iexplore
  49. Internet Properties - inetcpl.cpl
  50. Keyboard Properties - control keyboard
  51. Local Security Settings - secpol.msc
  52. Local Users and Groups - lusrmgr.msc
  53. Logs You Out Of Windows - logoff
  54. Malicious Software Removal Tool - mrt
  55. Microsoft Chat - winchat
  56. Microsoft Movie Maker - moviemk
  57. Microsoft Paint - mspaint
  58. Microsoft Syncronization Tool - mobsync
  59. Minesweeper Game - winmine
  60. Mouse Properties - control mouse
  61. Mouse Properties - main.cpl
  62. Netmeeting - conf
  63. Network Connections - control netconnections
  64. Network Connections - ncpa.cpl
  65. Network Setup Wizard - netsetup.cpl
  66. Notepad - notepad
  67. Object Packager - packager
  68. ODBC Data Source Administrator - odbccp32.cpl
  69. On Screen Keyboard - osk
  70. Outlook Express - msimn
  71. Paint - pbrush
  72. Password Properties - password.cpl
  73. Performance Monitor - perfmon
  74. Performance Monitor - perfmon.msc
  75. Phone and Modem Options - telephon.cpl
  76. Phone Dialer - dialer
  77. Pinball Game - pinball
  78. Power Configuration - powercfg.cpl
  79. Printers and Faxes - control printers
  80. Printers Folder - printers
  81. Regional Settings - intl.cpl
  82. Registry Editor - regedit
  83. Registry Editor - regedit32
  84. Remote Access Phonebook - rasphone
  85. Remote Desktop - mstsc
  86. Removable Storage - ntmsmgr.msc
  87. Removable Storage Operator Requests - ntmsoprq.msc
  88. Resultant Set of Policy (for xp professional) - rsop.msc
  89. Scanners and Cameras - sticpl.cpl
  90. Scheduled Tasks - control schedtasks
  91. Security Center - wscui.cpl
  92. Services - services.msc
  93. Shared Folders - fsmgmt.msc
  94. Shuts Down Windows - shutdown
  95. Sounds and Audio - mmsys.cpl
  96. Spider Solitare Card Game - spider
  97. SQL Client Configuration - cliconfg
  98. System Configuration Editor - sysedit
  99. System Configuration Utility - msconfig
  100. System Information - msinfo32
  101. System Properties - sysdm.cpl
  102. Task Manager - taskmgr
  103. TCP Tester - tcptest
  104. Telnet Client - telnet
  105. User Account Management - nusrmgr.cpl
  106. Utility Manager - utilman
  107. Windows Address Book - wab
  108. Windows Address Book Import Utility - wabmig
  109. Windows Explorer - explorer
  110. Windows Firewall - firewall.cpl
  111. Windows Magnifier - magnify
  112. Windows Management Infrastructure - wmimgmt.msc
  113. Windows Media Player - wmplayer
  114. Windows Messenger - msmsgs
  115. Windows System Security Tool - syskey
  116. Windows Update Launches - wupdmgr
  117. Windows Version - winver
  118. Word - winword
  119. Wordpad - write