software

vim shortcut

 

Operation Modes:

While working with vi editor you would come across following two modes:

  1. Command mode: This mode enables you to perform administrative tasks such as saving files, executing commands, moving the cursor, cutting (yanking) and pasting lines or words, and finding and replacing. In this mode, whatever you type is interpreted as a command.
  2. Insert mode: This mode enables you to insert text into the file. Everything that’s typed in this mode is interpreted as input and finally it is put in the file .

The vi always starts in command mode. To enter text, you must be in insert mode. To come in insert mode you simply type i. To get out of insert mode, press the Esc key, which will put you back into command mode.

Hint: If you are not sure which mode you are in, press the Esc key twice, and then you’ll be in command mode. You open a file using vi editor and start type some characters and then come in command mode to understand the difference.

Getting Out of vi:

The command to quit out of vi is :q. Once in command mode, type colon, and ‘q’, followed by return. If your file has been modified in any way, the editor will warn you of this, and not let you quit. To ignore this message, the command to quit out of vi without saving is :q!. This lets you exit vi without saving any of the changes.

The command to save the contents of the editor is :w. You can combine the above command with the quit command, or :wq and return.

The easiest way to save your changes and exit out of vi is the ZZ command. When you are in command mode, type ZZ and it will do the equivalent of :wq.

You can specify a different file name to save to by specifying the name after the :w. For example, if you wanted to save the file you were working as another filename called filename2, you would type :w filename2 and return. Try it once.

Moving within a File:

To move around within a file without affecting your text, you must be in command mode (press Esc twice). Here are some of the commands you can use to move around one character at a time:

Command Description
k Moves the cursor up one line.
j Moves the cursor down one line.
h Moves the cursor to the left one character position.
l Moves the cursor to the right one character position.

There are following two important points to be noted:

  • The vi is case-sensitive, so you need to pay special attention to capitalization when using commands.
  • Most commands in vi can be prefaced by the number of times you want the action to occur. For example, 2j moves cursor two lines down the cursor location.

There are many other ways to move within a file in vi. Remember that you must be in command mode (press Esc twice). Here are some more commands you can use to move around the file:

Command Description
0 or | Positions cursor at beginning of line.
$ Positions cursor at end of line.
w Positions cursor to the next word.
b Positions cursor to previous word.
( Positions cursor to beginning of current sentence.
) Positions cursor to beginning of next sentence.
E Move to the end of Blank delimited word
{ Move a paragraph back
} Move a paragraph forward
[[ Move a section back
]] Move a section forward
n| Moves to the column n in the current line
1G Move to the first line of the file
G Move to the last line of the file
nG Move to nth line of the file
:n Move to nth line of the file
fc Move forward to c
Fc Move back to c
H Move to top of screen
nH Moves to nth line from the top of the screen
M Move to middle of screen
L Move to botton of screen
nL Moves to nth line from the bottom of the screen
😡 Colon followed by a number would position the cursor on line number represented by x

Control Commands:

There are following useful command which you can use along with Control Key:

Command Description
CTRL+d Move forward 1/2 screen
CTRL+d Move forward 1/2 screen
CTRL+f Move forward one full screen
CTRL+u Move backward 1/2 screen
CTRL+b Move backward one full screen
CTRL+e Moves screen up one line
CTRL+y Moves screen down one line
CTRL+u Moves screen up 1/2 page
CTRL+d Moves screen down 1/2 page
CTRL+b Moves screen up one page
CTRL+f Moves screen down one page
CTRL+I Redraws screen

Editing Files:

To edit the file, you need to be in the insert mode. There are many ways to enter insert mode from the command mode:

Command Description
i Inserts text before current cursor location.
I Inserts text at beginning of current line.
a Inserts text after current cursor location.
A Inserts text at end of current line.
o Creates a new line for text entry below cursor location.
O Creates a new line for text entry above cursor location.

Deleting Characters:

Here is the list of important commands which can be used to delete characters and lines in an opened file:

Command Description
x Deletes the character under the cursor location.
X Deletes the character before the cursor location.
dw Deletes from the current cursor location to the next word.
d^ Deletes from current cursor position to the beginning of the line.
d$ Deletes from current cursor position to the end of the line.
D Deletes from the cursor position to the end of the current line.
dd Deletes the line the cursor is on.

As mentioned above, most commands in vi can be prefaced by the number of times you want the action to occur. For example, 2x deletes two character under the cursor location and 2dd deletes two lines the cursor is on.

I would highly recommend to exercise all the above commands properly before proceeding further.

Change Commands:

You also have the capability to change characters, words, or lines in vi without deleting them. Here are the relevant commands:

Command Description
cc Removes contents of the line, leaving you in insert mode.
cw Changes the word the cursor is on from the cursor to the lowercase w end of the word.
r Replaces the character under the cursor. vi returns to command mode after the replacement is entered.
R Overwrites multiple characters beginning with the character currently under the cursor. You must use Esc to stop the overwriting.
s Replaces the current character with the character you type. Afterward, you are left in insert mode.
S Deletes the line the cursor is on and replaces with new text. After the new text is entered, vi remains in insert mode.

Copy and Past Commands:

You can copy lines or words from one place and then you can past them at another place using following commands:

Command Description
yy Copies the current line.
yw Copies the current word from the character the lowercase w cursor is on until the end of the word.
p Puts the copied text after the cursor.
P Puts the yanked text before the cursor.

Advanced Commands:

There are some advanced commands that simplify day-to-day editing and allow for more efficient use of vi:

Command Description
J Join the current line with the next one. A count joins that many lines.
<< Shifts the current line to the left by one shift width.
>> Shifts the current line to the right by one shift width.
~ Switch the case of the character under the cursor.
^G Press CNTRL and G keys at the same time to show the current filename and the status.
U Restore the current line to the state it was in before the cursor entered the line.
u Undo the last change to the file. Typing ‘u’ again will re-do the change.
J Join the current line with the next one. A count joins that many lines.
:f Displays current position in the file in % and file name, total number of file.
:f filename Renames current file to filename.
:w filename Write to file filename.
:e filename Opens another file with filename.
:cd dirname Changes current working directory to dirname.
:e # Use to toggle between two opened files.
:n In case you open multiple files using vi, use :n to go to next file in the series.
:p In case you open multiple files using vi, use :p to go to previous file in the series.
:N In case you open multiple files using vi, use :N to go to previous file in the series.
:r file Reads file and inserts it after current line
:nr file Reads file and inserts it after line n.

Word and Character Searching:

The vi editor has two kinds of searches: string and character. For a string search, the / and ? commands are used. When you start these commands, the command just typed will be shown on the bottom line, where you type the particular string to look for.

These two commands differ only in the direction where the search takes place:

  • The / command searches forwards (downwards) in the file.
  • The ? command searches backwards (upwards) in the file.

The n and N commands repeat the previous search command in the same or opposite direction, respectively. Some characters have special meanings while using in search command and preceded by a backslash (\) to be included as part of the search expression.

Character Description
^ Search at the beginning of the line. (Use at the beginning of a search expression.)
. Matches a single character.
* Matches zero or more of the previous character.
$ End of the line (Use at the end of the search expression.)
[ Starts a set of matching, or non-matching expressions.
< Put in an expression escaped with the backslash to find the ending or beginning of a word.
> See the ‘<‘ character description above.

The character search searches within one line to find a character entered after the command. The f and F commands search for a character on the current line only. f searches forwards and F searches backwards and the cursor moves to the position of the found character.

The t and T commands search for a character on the current line only, but for t, the cursor moves to the position before the character, and T searches the line backwards to the position after the character.

Set Commands:

You can change the look and feel of your vi screen using the following :set commands. To use these commands you have to come in command mode then type :set followed by any of the following options:

Command Description
:set ic Ignores case when searching
:set ai Sets autoindent
:set noai To unset autoindent.
:set nu Displays lines with line numbers on the left side.
:set sw Sets the width of a software tabstop. For example you would set a shift width of 4 with this command: :set sw=4
:set ws If wrapscan is set, if the word is not found at the bottom of the file, it will try to search for it at the beginning.
:set wm If this option has a value greater than zero, the editor will automatically “word wrap”. For example, to set the wrap margin to two characters, you would type this: :set wm=2
:set ro Changes file type to “read only”
:set term Prints terminal type
:set bf Discards control characters from input

Running Commands:

The vi has the capability to run commands from within the editor. To run a command, you only need to go into command mode and type :! command.

For example, if you want to check whether a file exists before you try to save your file to that filename, you can type :! ls and you will see the output of ls on the screen.

When you press any key (or the command’s escape sequence), you are returned to your vi session.

Replacing Text:

The substitution command (:s/) enables you to quickly replace words or groups of words within your files. Here is the simple syntax:

:s/search/replace/g

The g stands for globally. The result of this command is that all occurrences on the cursor’s line are changed.

IMPORTANT:

Here are the key points to your success with vi:

  • You must be in command mode to use commands. (Press Esc twice at any time to ensure that you are in command mode.)
  • You must be careful to use the proper case (capitalization) for all commands.
  • You must be in insert mode to enter text.

NOTE:

ctrl+v 进入列编辑模式,向下或向上移动光标,把需要注释的行的开头标记起来,然后按大写的I(shift+i),再插入注释符,比如”//”,再按Esc,就会全部注释了

批量去掉注释

ctrl+v,进入列编辑模式,横向选中列的个数(如”//”注释符号,需要选中两列),然后按d, 就会删除注释符号

 

1、用vim打开一个文件,例如:a.cpp

2、在普通模式下,输入:”:sp”(不含引号)横向切分一个窗口,或者”:vsp”纵向切分一个窗口,敲入命令后,你将看到两个窗口打开的是同一个文件

3、在普通模式下,输入:”:e b.cpp”,在其中一个窗口里打开另一个文件

4、切换到含有源文件(a.cpp)的窗口,在普通模式下,把光标移到你需要复制内容的起始行,然后输入你想复制的行的数量(从光标所在行往下计算),在行数后面接着输入yy,这样就将内容复制到临时寄存器里 了(在 普通模式下ctrl+w,再按一下w,可以在两个窗口之间切换)

5、切换到目标文件( b.cpp )窗口,把光标移到你接收复制内容的起始行,按一下p,就完成复制了。

software

clion keymap

shortcut Description

Ctrl+Space

The CodeCompletion feature allows you to quickly complete different kinds of statements in the code.

For example, you can start typing a class member name and press Ctrl+Space to complete it. When multiple choices are available, they are shown in the lookup list.

 

Ctrl+Shift+I

 

Use Ctrl+Shift+I (View | Quick Definition), to quickly review definition or content of the symbol at the caret, without opening it in the editor

   
   
   
   
   
software

chrome and firefox shortcut

Below is google chrome shortcuts

Chrome shortcuts
Pause / resume script execution F8, Ctrl + \
Step over next function call F10, Ctrl + '
Step into next function call F11, Ctrl + ;
Step out of current function Shift + F11, Ctrl + Shift + ;
Select next call frame Ctrl + .
Select previous call frame Ctrl + ,
Toggle breakpoint condition Click on line number, Ctrl + B
Edit breakpoint condition Right-click on line number
Delete individual words Ctrl + Delete
Comment a line or selected text Ctrl + /
Save changes to local modifications Ctrl + S
Save all changes Ctrl + Alt + S
Go to line Ctrl + G
Search by filename Ctrl + O
Jump to line number Ctrl + P + :number
Jump to column Ctrl + O + :number + :number
Go to member Ctrl + Shift + O
Close active tab Alt + W
Run snippet Ctrl + Enter

 

Below is mozilla firefox shortcuts

Firefox shortcut
Ctrl+Shift+K Open Web Console
Shift+F4 Open Scratchpad
Ctrl+R Run script

 

software

win 10 shortcut

Press this key To do this

Ctrl+C (or Ctrl+Insert)

Copy the selected item

Ctrl+X

Cut the selected item

Ctrl+V (or Shift+Insert)

Paste the selected item

Ctrl+Z

Undo an action

Alt+Tab

Switch between open apps

Alt+F4

Close the active item, or exit the active app

Windows logo key Windows logo key+L

Lock your PC or switch accounts

Windows logo key Windows logo key+D

Display and hide the desktop

   

Press this key To do this
Windows logo key Windows logo key+A

Open Action center

Windows logo key‌ Windows logo key+S

Open search

Windows logo key‌ Windows logo key+C

Open Cortana in listening mode

Note

  • Cortana is only available in certain countries/regions, and some Cortana features might not be available everywhere. If Cortana isn’t available or is turned off, you can still use search.

Windows logo key‌ Windows logo key+Tab

Open Task view

Windows logo key Windows logo key+Ctrl+D

Add a virtual desktop

Windows logo key Windows logo key+Ctrl+Right arrow

Switch between virtual desktops you’ve created on the right

Windows logo key Windows logo key+Ctrl+Left arrow

Switch between virtual desktops you’ve created on the left

Windows logo key Windows logo key+Ctrl+F4

Close the virtual desktop you’re using

software

phpstorm keymap

shorcut   Description
Ctrl+Shift+N open a file with file name
Ctrl+B To navigate to the declaration of a class, method or variable used somewhere in the code, position the caret at the usage and press or You can also click the mouse on usages with the Ctrl key pressed to jump to declarations
Ctrl+F12 You can quickly navigate in the currently edited file with Ctrl+F12 (Navigate | File Structure). It shows the list of members of the current class. Select an element you want to navigate to and press the Enter key or the F4 key. To easily locate an item in the list, just start typing its name.
Shift+F6 You can easily rename your classes, methods and variables with automatic correction of all places where they are used.
just typing in the view tree The speed search is available in all the tree views: just start typing and you’ll quickly locate the necessary item.
Escape key the Escape key in any tool window moves the focus to the editor.
shift+esc Shift+Escape moves the focus to the editor and also hides the current (or last active) tool window.
F12 The F12 key moves the focus from the editor to the last focused tool window.
Ctrl+W Ctrl+W(extend selection) in the editor selects the word at the caret and then selects expanding areas of the source code. For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc. You can also select the word at the caret and the expanding areas of the source code by double-clicking the target areas in the editor.
Ctrl+Alt+V The Extract Variable refactoring helps you simplify complicated statements in your code. For example, in the code fragment below, you can select an expression in the code: and press Ctrl+Alt+V (Refactor | Extract Variable). This will result in the following:
Ctrl+P If the cursor is between the parentheses of a method call, pressing Ctrl+P brings up a list of valid parameters
Ctrl+F4 close current tab  
Ctrl+G  go to the line you put in(It’s very useful)
Ctrl+shift+alt+n  search any method and data
ctrl+alt+L reformat code
ctrl+b find the declaration of a varaible
alt+7 open file structure tool
ctrl++ expand selected code
ctrl+- collapse selected code
Alt+Shift+C

Use to this quickly review your recent changes to the project.

Alt+Shift+F10

 

By pressing Alt+Shift+F10 you can access the Run/Debug dropdown on the main toolbar, without the need to use your mouse.

ctrl+q

look the definition of the php functions

Ctrl+Shift+I

 

You can quickly view the image referenced at caret by using the Quick Definition (Ctrl+Shift+I). The underlying image will be opened in a popup instead of a separate editor tab.

Shift+F6

 

It is possible to rename CSS selectors directly from HTML. Position the caret at the selector to be renamed and press Shift+F6 (Refactor | Rename)

 

Alt+Home

 

Navigation bar is a quick alternative to the Project view.

Use Alt+Home keyboard shortcut to show the navigation bar, and arrow keys to locate the necessary files or folders.

ctrl+h show inheritance of the class
ctrl+shift+f4 close the show inheritance dialog

Ctrl+Alt+F7

You can bring forward the list of all usages of a class, method or variable across the whole project, and quickly jump to the selected usage. To do that, place the caret at the symbol’s name or at its usage in code and press Ctrl+Alt+F7 (Edit | Find | Show Usages in the main menu), scroll the list and click the desired usage.

ctrl + backspace

Use Basic Completion  within HTML, CSS and other files, for completing image file names.

Ctrl+Shift+Backspace

 

Ctrl+Shift+Backspace (Navigate | Last Edit Location) brings you back to the last place where you made changes in the code.

Pressing Ctrl+Shift+Backspace a few times moves you deeper into your changes history.

Shift+F6 (Refactor | Rename).

You can easily rename your classes, methods and variables with automatic correction of all places where they are used.

To try it, place the caret at the symbol you want to rename, and press Shift+F6 (Refactor | Rename). Type the new name in the popup window that appears, or select one of the suggested names, and press Enter.phpstorm_rename

double shift

Find any action, symbol, or setting in PhpStorm with Double Shift

Ctrl+Alt+Shift+T

 

If you place the caret at certain symbol and press Ctrl+Alt+Shift+T, you will see the list of refactorings applicable to the current context.

software

eclipse for php shortcut

working with eclipse without shortcut maybe can’t work effectively.So collect some often used shortcuts in here.Maybe can help you a little

shortcut description
ctrl + shif+r 打开资源窗口,可以快速打开一个文件,这个在工作中,是用的最多的快捷键之一
ctrl+tab 切换标签,这个和sublime是一样的
alt+shift+r 对文件重命名
ctrl+t 查看继承关系(对于面向对象非常的有用)
ctrl+shift+f 格式化当前代码
alt+shift+r 文件重命名
ctrl+shift+x 将所选字符全部变为大写形式
ctrl+shift+y 将所选字符全部变为小写形式
ctrl+d 删除所选行(默认删除当前行)
ctrl+o 获取当前的类的outline

 

版权声明:本文为博主原创文章,未经博主允许不得转载
邮箱joy@richardtumas.com

 

software

sublime shortcut key

you know I love sublime text very much,especially black background.
but if your don’t remember some shortcuts,you can’t work effectively.
So I search from the internet and some documents to get blow this shortcuts
Maybe can help you a little.

shortcut description
ctrl+tab 切换标签
Shift + Ctrl + P 调出 Package Control 命令面板
ctrl + shift+f 全局搜索
alt+shift +number 分屏显示
ctrl+number 切换分屏窗口
ctrl+f 查找
ctrl+h  替换
ctrl+g 转跳到第几行
ctrl+shift + [ 折叠代码
ctrl+ shift + ] 展开代码
Ctrl+KT 折叠属性
Ctrl+K0 展开所有

Editing

Keypress Command
Ctrl + X Cut line
Ctrl + enter Insert line after
Ctrl + ⇧ + enter Insert line before
Ctrl + ⇧ + ↑ Move line/selection up
Ctrl + ⇧ + ↓ Move line/selection down
Ctrl + L Select line – Repeat to select next lines
Ctrl + D Select word – Repeat select others occurrences
Ctrl + M Jump to closing parentheses Repeat to jump to opening parentheses
Ctrl + ⇧ + M Select all contents of the current parentheses
Ctrl + ⇧ + K Delete Line
Ctrl + KK Delete from cursor to end of line
Ctrl + K + del Delete from cursor to start of line
Ctrl + ] Indent current line(s)
Ctrl + [ Un-indent current line(s)
Ctrl + ⇧ + D Duplicate line(s)
Ctrl + J Join line below to the end of the current line
Ctrl + / Comment/un-comment current line
Ctrl + ⇧ + / Block comment current selection
Ctrl + Y Redo, or repeat last keyboard shortcut command
Ctrl + ⇧ + V Paste and indent correctly
Ctrl + Space Select next auto-complete suggestion
Ctrl + U soft undo; jumps to your last change before undoing change when repeated
Alt + ⇧ + W Wrap Selection in html tag
Alt + . Close current html tag

Windows

Ctrl + Alt + Up Column selection up
Ctrl + Alt + Down Column selection down

Linux

Alt + ⇧ + Up Column selection up
Alt + ⇧ + Down Column selection down

General

Keypress Command
Ctrl + ⇧ + P Command prompt
Ctrl + KB Toggle side bar
Ctrl + ⇧ + Alt + P Show scope in status bar

Find/Replace

Keypress Command
Ctrl + F Find
Ctrl + H Replace
Ctrl + ⇧ + F Find in files

Tabs

Keypress Command
Ctrl + ⇧ + t Open last closed tab
Ctrl + PgUp Cycle up through tabs
Ctrl + PgDn Cycle down through tabs
Ctrl + ⇆ Find in files
Ctrl + W Close current tab
Alt + [NUM] Switch to tab number [NUM] where [NUM] <= number of tabs

Split window

Keypress Command
Alt + ⇧ + 1 Revert view to single column
Alt + ⇧ + 2 Split view into two columns
Alt + ⇧ + 3 Split view into three columns
Alt + ⇧ + 4 Split view into four columns
Alt + ⇧ + 5 Set view to grid (4 groups)
Alt + ⇧ + 8 Split view into two rows
Ctrl + [NUM] Jump to group where num is 1-4
Ctrl + ⇧ + [NUM] Move file to specified group where num is 1-4

Bookmarks

Keypress Command
Ctrl + F2 Toggle bookmark
F2 Next bookmark
⇧ + F2 Previous bookmark
Ctrl + ⇧ + F2 Clear bookmarks

Text manipulation

Keypress Command
Ctrl + KU Transform to Uppercase
Ctrl + KL Transform to Lowercase