RStdio 常用快捷键

来源:互联网 发布:excel 编程 示例 编辑:程序博客网 时间:2024/06/07 04:41

Rstdio常用快捷键总结

       在R语言里面输入了一个不完整的指令以后 左下方的console pane一直有加号+,不管输入什么都是加号,只用推出重新打开Rstudio才行,后来google了下按左上角的Esc键也可以回到命令提示符状态,顺便总结下一些常用快捷键。


 1、在编辑窗口,光标选中要执行的语句,敲快捷键(ctrl+enter)或者鼠标点击run按钮,就是执行当前行。
      光标随着移动到下一行;在console窗口,会输出执行行的语句,哪怕是注释#;

 2、当你觉得console窗口显示的信息很多,是不是有一种清空的冲动呢?
       按ctrl + L:console干干净净,而且光标也在console控制台窗口;


3、在编辑窗口和console窗口间光标切换

     按ctrl+1:切换到console窗口 ; 按ctrl+2:切换到编辑窗口;


4、tab键

     在console窗口 ,按tab键可以代码提示;


搜索引用快捷键,完整版:

控制台

功能Windows & LinuxMac移动鼠标到控制台Ctrl+2Ctrl+2控制台清屏Ctrl+LCommand+L移动鼠标至第一行HomeCommand+Left移动鼠标至最后一行EndCommand+Right历史记录翻滚Up/DownUp/Down弹出历史记录栏Ctrl+UpCommand+Up终止目前命令EscEsc改变工作路径Ctrl+Shift+KCtrl+Shift+K 

代码区

功能Windows & LinuxMac移动鼠标到文件搜索区Ctrl+.Ctrl+.移动鼠标至文件编辑区Ctrl+1Ctrl+1新文档(chrome除外)Ctrl+Shift+NCommand+Shift+N打开文档Ctrl+OCommand+O保存当前文档Ctrl+SCommand+S关闭当前文档(chrome除外)Ctrl+WCommand+W关闭当前文档(chrome)Ctrl+Shift+ZCommand+Shift+Z关闭所有文档Ctrl+Shift+WCommand+Shift+W预览HTMLCtrl+Shift+YCommand+Shift+Y转换为HTMLCtrl+Shift+HCommand+Shift+H编译PDF (TeX and Sweave)Ctrl+Shift+ICommand+Shift+I插入块Ctrl+Alt+ICommand+Option+I插入代码块Ctrl+Shift+RCommand+Shift+R运行当前行Ctrl+EnterCommand+Enter重新运行当前区Ctrl+Shift+PCommand+Shift+P运行当前文档Ctrl+Alt+RCommand+Option+R从开始运行至当前行Ctrl+Alt+BCommand+Option+B从当前行运行至结尾Ctrl+Alt+ECommand+Option+E运行当前函数定义Ctrl+Alt+FCommand+Option+F运行当前块Ctrl+Alt+CCommand+Option+C运行下一个块Ctrl+Alt+NCommand+Option+N执行一个文件Ctrl+Shift+OCommand+Shift+O执行当前文档Ctrl+Shift+SCommand+Shift+S执行当前文档并且显示Ctrl+Shift+EnterCommand+Shift+Enter折叠选项Alt+LCommand+Option+L打开选项Shift+Alt+LCommand+Shift+Option+L折叠所有Alt+0Command+Option+0打开所有Shift+Alt+0Command+Shift+Option+0前往行Shift+Alt+GCommand+Shift+Option+G跳至Shift+Alt+JCommand+Shift+Option+J换页Ctrl+Alt+DownCtrl+Option+Down前一页Win: Ctrl+Alt+Left, Linux: Ctrl+PageUpCtrl+Option+Left后一页Win: Ctrl+Alt+Right, Linux: Ctrl+PageDownCtrl+Option+Right第一页Ctrl+Shift+Alt+LeftCtrl+Shift+Option+Left最后一页Ctrl+Shift+Alt+RightCtrl+Shift+Option+Right往回导航Ctrl+F9Command+F9向前导航Ctrl+F10Command+F10行缩进Ctrl+ICommand+I从选择中抽取函数Ctrl+Shift+UCommand+Shift+U注释/取消注释当前行Ctrl+Shift+CCommand+Shift+C重新注释Ctrl+Shift+/Command+Shift+/Transpose Letters Ctrl+TMove Lines Up/DownAlt+Up/DownOption+Up/DownCopy Lines Up/DownCtrl+Alt+Up/DownCommand+Option+Up/DownJump to Matching Brace/ParenCtrl+PCtrl+PFind and ReplaceCtrl+FCommand+FFind NextWin: F3, Linux: Ctrl+GCommand+GFind PreviousWin: Shift+F3, Linux: Ctrl+Shift+GCommand+Shift+GReplace and FindCtrl+=Command+=Find in FilesCtrl+Shift+FCommand+Shift+FCheck spellingF7F7 

Editing (Console and Source)

DescriptionWindows & LinuxMacUndoCtrl+ZCommand+ZRedoCtrl+Shift+ZCommand+Shift+ZCutCtrl+XCommand+XCopyCtrl+CCommand+CPasteCtrl+VCommand+VSelect AllCtrl+ACommand+AJump to WordCtrl+Left/RightOption+Left/RightJump to Start/EndCtrl+Home/End or Ctrl+Up/DownCommand+Home/End or Command+Up/DownDelete LineCtrl+DCommand+DSelectShift+[Arrow]Shift+[Arrow]Select WordCtrl+Shift+Left/RightOption+Shift+Left/RightSelect to Line StartShift+HomeCommand+Shift+Left or Shift+HomeSelect to Line EndShift+EndCommand+Shift+Right or Shift+EndSelect Page Up/DownShift+PageUp/PageDownShift+PageUp/DownSelect to Start/EndCtrl+Shift+Home/End or Shift+Alt+Up/DownCommand+Shift+Up/DownDelete Word LeftCtrl+BackspaceOption+Backspace or Ctrl+Option+BackspaceDelete Word Right Option+DeleteDelete to Line End Ctrl+KDelete to Line Start Option+BackspaceIndentTab (at beginning of line)Tab (at beginning of line)OutdentShift+TabShift+TabYank line up to cursorCtrl+UCtrl+UYank line after cursorCtrl+KCtrl+KInsert currently yanked textCtrl+YCtrl+YInsert assignment operatorAlt+-Option+-Show help for function at cursorF1F1Show source code for function at cursorF2F2 

Completions (Console and Source)

DescriptionWindows & LinuxMacAttempt completionTab or Ctrl+SpaceTab or Command+SpaceNavigate candidatesUp/DownUp/DownAccept selected candidateEnter, Tab, or RightEnter, Tab, or RightDismiss completion popupEscEsc 

Views

DescriptionWindows & LinuxMacGoto File/FunctionCtrl+.Ctrl+.Move cursor to Source EditorCtrl+1Ctrl+1Move cursor to ConsoleCtrl+2Ctrl+2Move focus to HelpCtrl+3Ctrl+3Show HistoryCtrl+4Ctrl+4Show FilesCtrl+5Ctrl+5Show PlotsCtrl+6Ctrl+6Show PackagesCtrl+7Ctrl+7Show WorkspaceCtrl+8Ctrl+8Show Git/SVNCtrl+9Ctrl+9Show BuildCtrl+0Ctrl+0Sync Editor and PDF PreviewCtrl+F8Command+F8 

Build

DescriptionWindows & LinuxMacBuild and ReloadCtrl+Shift+BCommand+Shift+BLoad All (devtools)Ctrl+Shift+LCommand+Shift+LCheck PackageCtrl+Shift+ECommand+Shift+E 

Plots

DescriptionWindows & LinuxMacPrevious plotCtrl+Shift+PageUpCommand+Shift+PageUpNext plotCtrl+Shift+PageDownCommand+Shift+PageDownShow manipulatorCtrl+Shift+MCommand+Shift+M 

Git/SVN

DescriptionWindows & LinuxMacDiff active source documentCtrl+Shift+DCommand+Shift+DCommit changesCtrl+Shift+MCommand+Shift+MScroll diff viewCtrl+Up/DownCtrl+Up/DownStage/Unstage (Git)SpacebarSpacebarStage/Unstage and move next (Git)EnterEnter

1 0