From fb66fa2cb673643f906909bb1b3f0efc2f1ec0cc Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Sun, 18 Oct 2020 15:03:31 +0530 Subject: [PATCH 01/15] Create Separate General Section --- .../General => General/Information}/_index.md | 3 +- .../Information}/_index.ru.md | 2 +- .../Information}/_index.zh.md | 0 content/docs/General/Vim Commands/_index.md | 155 ++++++++++++++++++ .../docs/General/Vim Commands/_index.ru.md | 4 + .../docs/General/Vim Commands/_index.zh.md | 5 + content/docs/General/_index.md | 7 + content/docs/General/_index.ru.md | 6 + content/docs/General/_index.zh.md | 6 + .../{Code Edit => Code Editing}/_index.md | 19 ++- .../{Code Edit => Code Editing}/_index.ru.md | 0 .../{Code Edit => Code Editing}/_index.zh.md | 0 content/docs/Preferences/File Path/_index.md | 4 +- .../docs/Preferences/File Path/_index.ru.md | 4 +- .../docs/Preferences/File Path/_index.zh.md | 4 +- content/docs/Preferences/Language/_index.md | 6 +- .../docs/Preferences/Language/_index.ru.md | 6 +- .../docs/Preferences/Language/_index.zh.md | 6 +- .../docs/Preferences/{_index => }/_index.md | 0 .../Preferences/{_index => }/_index.ru.md | 0 .../Preferences/{_index => }/_index.zh.md | 0 content/docs/Tips/_index.md | 4 + 22 files changed, 223 insertions(+), 18 deletions(-) rename content/docs/{Preferences/General => General/Information}/_index.md (88%) rename content/docs/{Preferences/General => General/Information}/_index.ru.md (97%) rename content/docs/{Preferences/General => General/Information}/_index.zh.md (100%) create mode 100644 content/docs/General/Vim Commands/_index.md create mode 100644 content/docs/General/Vim Commands/_index.ru.md create mode 100644 content/docs/General/Vim Commands/_index.zh.md create mode 100644 content/docs/General/_index.md create mode 100644 content/docs/General/_index.ru.md create mode 100644 content/docs/General/_index.zh.md rename content/docs/Preferences/{Code Edit => Code Editing}/_index.md (64%) rename content/docs/Preferences/{Code Edit => Code Editing}/_index.ru.md (100%) rename content/docs/Preferences/{Code Edit => Code Editing}/_index.zh.md (100%) rename content/docs/Preferences/{_index => }/_index.md (100%) rename content/docs/Preferences/{_index => }/_index.ru.md (100%) rename content/docs/Preferences/{_index => }/_index.zh.md (100%) diff --git a/content/docs/Preferences/General/_index.md b/content/docs/General/Information/_index.md similarity index 88% rename from content/docs/Preferences/General/_index.md rename to content/docs/General/Information/_index.md index 31f3bf379..cbb13680a 100644 --- a/content/docs/Preferences/General/_index.md +++ b/content/docs/General/Information/_index.md @@ -1,6 +1,7 @@ --- -title: "General" +title: "Information" weight: 1000 +description: Information regarding terminologies or methodologies used in Documentations --- ### Temporary Directory diff --git a/content/docs/Preferences/General/_index.ru.md b/content/docs/General/Information/_index.ru.md similarity index 97% rename from content/docs/Preferences/General/_index.ru.md rename to content/docs/General/Information/_index.ru.md index 31f3bf379..0754deac9 100644 --- a/content/docs/Preferences/General/_index.ru.md +++ b/content/docs/General/Information/_index.ru.md @@ -1,5 +1,5 @@ --- -title: "General" +title: "Information" weight: 1000 --- diff --git a/content/docs/Preferences/General/_index.zh.md b/content/docs/General/Information/_index.zh.md similarity index 100% rename from content/docs/Preferences/General/_index.zh.md rename to content/docs/General/Information/_index.zh.md diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md new file mode 100644 index 000000000..195b71012 --- /dev/null +++ b/content/docs/General/Vim Commands/_index.md @@ -0,0 +1,155 @@ +--- +title: "Vim Commands" +weight: 1000 +description: List of supported vim commands in Vim Emulation +--- + +### Vim Commands + +#### Supported Features +------------------ + +Most of supported commands can be followed by motion command or executed in visual mode, work with registers or can be prefixed with number of repetitions. + +Here is list of emulated commands with description where it can diverge from Vim in functionality. + +#### Modes + +* normal +* insert and replace +* visual +* command line (`:`) + +#### Normal and Visual Modes + +* basic movement -- `h`/`j`/`k`/`l`, ``, ``, ``, ``, `gg`, `G`, `0`, `^`, `$` etc. +* word movement -- `w`, `e`, `b` etc. +* "inner/a" movement -- `ciw`, `3daw`, `ya{` etc. +* `f`, `t` movement +* `[`, `]` movement +* `{`, `}` -- paragraph movement +* delete/change/yank/paste with register +* undo/redo +* ``, `` -- increase or decrease number in decimal/octal/hexadecimal format (e.g. `128` on or before "0x0ff" changes it to "0x17f") +* `.` -- repeat last change +* `/search`, `?search`, `*`, `#`, `n`, `N` -- most of regular expression syntax used in Vim except `\<` and `\>` just is the same as `\b` in QRegExp +* `@`, `q` (macro recording, execution) -- special keys are saved as `` +* marks +* `gv` -- last visual selection; can differ if text is edited around it +* indentation -- `=`, `<<`, `>>` etc. with movement, count and in visual mode +* "to upper/lower" -- `~`, `gU`, `gu` etc. +* `i`, `a`, `o`, `I`, `A`, `O` -- enter insert mode +* scroll window -- `zt`, `zb`, `zz` etc. +* wrap line movement -- `gj`, `gk`, `g0`, `g^`, `g$` + +#### Command Line Mode + +* `:map`, `:unmap`, `:inoremap` etc. +* `:source` -- very basic line-by-line sourcing of vimrc files +* `:substitute` -- substitute expression in range +* `:'<,'>!cmd` -- filter through an external command (e.g. sort lines in file with `:%!sort`) +* `:.!cmd` -- insert standard output of an external command +* `:read` +* `:yank`, `:delete`, `:change` +* `:move`, `:join` +* `:20` -- go to address +* `:history` +* `:registers`, `:display` +* `:nohlsearch` +* `:undo`, `:redo` +* `:normal` +* `:<`, `:>` + +#### Insert Mode + +* `` -- execute single command and return to insert mode +* `` -- insert raw character +* `` -- toggle replace mode + +#### Options (:set ...) + +* `autoindent` +* `clipboard` +* `backspace` +* `expandtab` +* `hlsearch` +* `ignorecase` +* `incsearch` +* `indent` +* `iskeyword` +* `scrolloff` +* `shiftwidth` +* `showcmd` +* `smartcase` +* `smartindent` +* `smarttab` +* `startofline` +* `tabstop` +* `tildeop` +* `wrapscan` + +#### Example Vimrc +------------- +``` + " highlight matched + set hlsearch + " case insensitive search + set ignorecase + set smartcase + " search while typing + set incsearch + " wrap-around when searching + set wrapscan + " show pressed keys in lower right corner + set showcmd + " tab -> spaces + set expandtab + set tabstop=4 + set shiftwidth=4 + " keep a 5 line buffer for the cursor from top/bottom of window + set scrolloff=5 + " X11 clipboard + set clipboard=unnamed + " use ~ with movement + set tildeop + + " mappings + nnoremap ; : + inoremap jj + + " clear highlighted search term on space + noremap :nohls + + " reselect visual block after indent + vnoremap < >gv + + " MOVE LINE/BLOCK + nnoremap :m+== + nnoremap :m-2== + inoremap :m+==gi + inoremap :m-2==gi + vnoremap :m'>+gv=gv + vnoremap :m-2gv=gv +``` + +### Custom vim commands + +In this section we present a list of all custom vim commands that are supported to perform different operation in CP Editor. + +| Command | Shorthand | Description | Usage | +| :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | +| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | +| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | +| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | +| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | +| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | +| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | +| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | +| `format` | `fmt` | Format Code, It is same as clicking "Format Code" in menu | `format` or `fmt` | +| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | +| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | +| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | +| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` | +| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | +| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | diff --git a/content/docs/General/Vim Commands/_index.ru.md b/content/docs/General/Vim Commands/_index.ru.md new file mode 100644 index 000000000..1b7313743 --- /dev/null +++ b/content/docs/General/Vim Commands/_index.ru.md @@ -0,0 +1,4 @@ +--- +title: "Vim Commands" +weight: 1000 +--- diff --git a/content/docs/General/Vim Commands/_index.zh.md b/content/docs/General/Vim Commands/_index.zh.md new file mode 100644 index 000000000..989f1678e --- /dev/null +++ b/content/docs/General/Vim Commands/_index.zh.md @@ -0,0 +1,5 @@ +--- +title: "Vim Commands" +weight: 1000 +--- + diff --git a/content/docs/General/_index.md b/content/docs/General/_index.md new file mode 100644 index 000000000..9dee8bf84 --- /dev/null +++ b/content/docs/General/_index.md @@ -0,0 +1,7 @@ +--- +title: "General" +linkTitle: "General" +weight: 60 +description: General Information regarding Setup and documentation +--- + diff --git a/content/docs/General/_index.ru.md b/content/docs/General/_index.ru.md new file mode 100644 index 000000000..f97810676 --- /dev/null +++ b/content/docs/General/_index.ru.md @@ -0,0 +1,6 @@ +--- +title: "General" +linkTitle: "General" +weight: 60 +description: General Information regarding Setup and documentation +--- diff --git a/content/docs/General/_index.zh.md b/content/docs/General/_index.zh.md new file mode 100644 index 000000000..f97810676 --- /dev/null +++ b/content/docs/General/_index.zh.md @@ -0,0 +1,6 @@ +--- +title: "General" +linkTitle: "General" +weight: 60 +description: General Information regarding Setup and documentation +--- diff --git a/content/docs/Preferences/Code Edit/_index.md b/content/docs/Preferences/Code Editing/_index.md similarity index 64% rename from content/docs/Preferences/Code Edit/_index.md rename to content/docs/Preferences/Code Editing/_index.md index 5a00079e3..b2cceed6b 100644 --- a/content/docs/Preferences/Code Edit/_index.md +++ b/content/docs/Preferences/Code Editing/_index.md @@ -1,5 +1,5 @@ --- -title: "Code Edit" +title: "Code Editing" weight: 10 --- @@ -41,3 +41,20 @@ You can choose the parentheses to jump out by Tab in the [Parentheses](../langua When you insert an indent, insert spaces instead of a tab character. The number of spaces is equal to the [Tab Width](#tab-width). Note that this won't replace the existing tab characters. In [Auto Indent](#auto-indent), the tab characters in the old line will remain in the new line (however, the new indent inserted after `{` will be spaces). + +### Default cursor overwrites + +There are two modes in text editing, Insert and Replace mode. Insert mode is common and most widely used, this is CP Editor and other editor’s default mode. In Replace mode, the cursor replaces the next character with the pressed character. If this option is enabled the cursor for newly opened tab will be in Replace mode. It can be toggled for individual tabs by pressig INS or Insert on your keyboard. + + +### Highlight Current Line + +If enabled the current line number is highlighted from the rest of the lines. In Vim mode, current line is never highlighted. + +### Enable Vim emulation + +If enabled code editor uses vim emulation. In Vim emulation, Control Key such as Ctrl+N will not be intercepted by CP Editor but by Code Editor. We provide some custom commands that can perform most of these tasks. You can check a list of all supported custom commands and its usage [here](../../general/vim-commands/#custom-vim-commands) + +### Vim Configuration + +The configuration to use in vim mode. The list of all supported vim commands are listed [here](../../general/vim-commands/#vim-commands) diff --git a/content/docs/Preferences/Code Edit/_index.ru.md b/content/docs/Preferences/Code Editing/_index.ru.md similarity index 100% rename from content/docs/Preferences/Code Edit/_index.ru.md rename to content/docs/Preferences/Code Editing/_index.ru.md diff --git a/content/docs/Preferences/Code Edit/_index.zh.md b/content/docs/Preferences/Code Editing/_index.zh.md similarity index 100% rename from content/docs/Preferences/Code Edit/_index.zh.md rename to content/docs/Preferences/Code Editing/_index.zh.md diff --git a/content/docs/Preferences/File Path/_index.md b/content/docs/Preferences/File Path/_index.md index 97464d0cc..98c20e57e 100644 --- a/content/docs/Preferences/File Path/_index.md +++ b/content/docs/Preferences/File Path/_index.md @@ -29,7 +29,7 @@ If the path is `testcases/${basename}-${1-index}.in`, the input of this test cas The rules used to match test cases when loading pairs of test cases. -Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. +Each rule is a pair of [regular expression patterns](../../general/information#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. For example, you can use `(.+)\.in` and `\1.out` to match `test-1.in` and `test-1.out`, or use `(.+)\.in\.(\d+)` and `\1.ans.\2` to match `test.in.3` and `test.ans.3`. @@ -41,7 +41,7 @@ When loading pairs of test cases, each rule which matches an input file will be The default path when choosing where to save an untitled tab with problem URL. -Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. +Each rule is a pair of [regular expression patterns](../../general/information#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. When saving a file with problem URL, if the problem URL matches at least one regex in the rules, the default save path will be the replacement of the first matching regex. diff --git a/content/docs/Preferences/File Path/_index.ru.md b/content/docs/Preferences/File Path/_index.ru.md index 97464d0cc..98c20e57e 100644 --- a/content/docs/Preferences/File Path/_index.ru.md +++ b/content/docs/Preferences/File Path/_index.ru.md @@ -29,7 +29,7 @@ If the path is `testcases/${basename}-${1-index}.in`, the input of this test cas The rules used to match test cases when loading pairs of test cases. -Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. +Each rule is a pair of [regular expression patterns](../../general/information#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. For example, you can use `(.+)\.in` and `\1.out` to match `test-1.in` and `test-1.out`, or use `(.+)\.in\.(\d+)` and `\1.ans.\2` to match `test.in.3` and `test.ans.3`. @@ -41,7 +41,7 @@ When loading pairs of test cases, each rule which matches an input file will be The default path when choosing where to save an untitled tab with problem URL. -Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. +Each rule is a pair of [regular expression patterns](../../general/information#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. When saving a file with problem URL, if the problem URL matches at least one regex in the rules, the default save path will be the replacement of the first matching regex. diff --git a/content/docs/Preferences/File Path/_index.zh.md b/content/docs/Preferences/File Path/_index.zh.md index 97464d0cc..98c20e57e 100644 --- a/content/docs/Preferences/File Path/_index.zh.md +++ b/content/docs/Preferences/File Path/_index.zh.md @@ -29,7 +29,7 @@ If the path is `testcases/${basename}-${1-index}.in`, the input of this test cas The rules used to match test cases when loading pairs of test cases. -Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. +Each rule is a pair of [regular expression patterns](../../general/information#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. For example, you can use `(.+)\.in` and `\1.out` to match `test-1.in` and `test-1.out`, or use `(.+)\.in\.(\d+)` and `\1.ans.\2` to match `test.in.3` and `test.ans.3`. @@ -41,7 +41,7 @@ When loading pairs of test cases, each rule which matches an input file will be The default path when choosing where to save an untitled tab with problem URL. -Each rule is a pair of [regular expression patterns](../general#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. +Each rule is a pair of [regular expression patterns](../../general/information#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. When saving a file with problem URL, if the problem URL matches at least one regex in the rules, the default save path will be the replacement of the first matching regex. diff --git a/content/docs/Preferences/Language/_index.md b/content/docs/Preferences/Language/_index.md index b2f099066..e6dcf6c03 100644 --- a/content/docs/Preferences/Language/_index.md +++ b/content/docs/Preferences/Language/_index.md @@ -25,13 +25,13 @@ For compilation flags, please refer to the manual of the compiler. For example, The path of the executable file, i.e. the argument of the `-o` option of the compiler. -If this path is a relative path, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../general#temporary-directory)). +If this path is a relative path, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../../general/information#temporary-directory)). You can use some place holders for this setting: - `${filename}`: The complete name of the source file. If it's an untitled tab (i.e. an unsaved file), the complete file name is `sol.cpp`. - `${basename}`: `${filename}` without the suffix (i.e. without `.cpp`, etc.). -- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../general#temporary-directory). +- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../../general/information#temporary-directory). For example, you can use `${tmpdir}/${basename}` if you don't want to keep the executable files, or `executables/${basename}` if you want to keep all executable files in the `executables` directory in the parent directory of the source file. @@ -103,7 +103,7 @@ The initial position of the text cursor when opening the template. It contains three parts: -1. [Regex](../general#regular-expression) +1. [Regex](../../general/information#regular-expression) 2. Offset type: start or end. 3. Offset characters: a number, could be negative. diff --git a/content/docs/Preferences/Language/_index.ru.md b/content/docs/Preferences/Language/_index.ru.md index b2f099066..e6dcf6c03 100644 --- a/content/docs/Preferences/Language/_index.ru.md +++ b/content/docs/Preferences/Language/_index.ru.md @@ -25,13 +25,13 @@ For compilation flags, please refer to the manual of the compiler. For example, The path of the executable file, i.e. the argument of the `-o` option of the compiler. -If this path is a relative path, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../general#temporary-directory)). +If this path is a relative path, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../../general/information#temporary-directory)). You can use some place holders for this setting: - `${filename}`: The complete name of the source file. If it's an untitled tab (i.e. an unsaved file), the complete file name is `sol.cpp`. - `${basename}`: `${filename}` without the suffix (i.e. without `.cpp`, etc.). -- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../general#temporary-directory). +- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../../general/information#temporary-directory). For example, you can use `${tmpdir}/${basename}` if you don't want to keep the executable files, or `executables/${basename}` if you want to keep all executable files in the `executables` directory in the parent directory of the source file. @@ -103,7 +103,7 @@ The initial position of the text cursor when opening the template. It contains three parts: -1. [Regex](../general#regular-expression) +1. [Regex](../../general/information#regular-expression) 2. Offset type: start or end. 3. Offset characters: a number, could be negative. diff --git a/content/docs/Preferences/Language/_index.zh.md b/content/docs/Preferences/Language/_index.zh.md index b2f099066..e6dcf6c03 100644 --- a/content/docs/Preferences/Language/_index.zh.md +++ b/content/docs/Preferences/Language/_index.zh.md @@ -25,13 +25,13 @@ For compilation flags, please refer to the manual of the compiler. For example, The path of the executable file, i.e. the argument of the `-o` option of the compiler. -If this path is a relative path, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../general#temporary-directory)). +If this path is a relative path, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../../general/information#temporary-directory)). You can use some place holders for this setting: - `${filename}`: The complete name of the source file. If it's an untitled tab (i.e. an unsaved file), the complete file name is `sol.cpp`. - `${basename}`: `${filename}` without the suffix (i.e. without `.cpp`, etc.). -- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../general#temporary-directory). +- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../../general/information#temporary-directory). For example, you can use `${tmpdir}/${basename}` if you don't want to keep the executable files, or `executables/${basename}` if you want to keep all executable files in the `executables` directory in the parent directory of the source file. @@ -103,7 +103,7 @@ The initial position of the text cursor when opening the template. It contains three parts: -1. [Regex](../general#regular-expression) +1. [Regex](../../general/information#regular-expression) 2. Offset type: start or end. 3. Offset characters: a number, could be negative. diff --git a/content/docs/Preferences/_index/_index.md b/content/docs/Preferences/_index.md similarity index 100% rename from content/docs/Preferences/_index/_index.md rename to content/docs/Preferences/_index.md diff --git a/content/docs/Preferences/_index/_index.ru.md b/content/docs/Preferences/_index.ru.md similarity index 100% rename from content/docs/Preferences/_index/_index.ru.md rename to content/docs/Preferences/_index.ru.md diff --git a/content/docs/Preferences/_index/_index.zh.md b/content/docs/Preferences/_index.zh.md similarity index 100% rename from content/docs/Preferences/_index/_index.zh.md rename to content/docs/Preferences/_index.zh.md diff --git a/content/docs/Tips/_index.md b/content/docs/Tips/_index.md index 1836c9ae6..b11aeea09 100644 --- a/content/docs/Tips/_index.md +++ b/content/docs/Tips/_index.md @@ -14,6 +14,10 @@ You can use Ctlr+Tab and Ctlr+Shift+Tab to go through the Besides the shortcuts in the menu, you can use the [Read-only Key Bindings](https://doc.qt.io/qt-5/qtextedit.html#read-only-key-bindings) and the [Editing Key Bindings](https://doc.qt.io/qt-5/qtextedit.html#editing-key-bindings). There are also some hidden shortcuts: Tab (when there's a selection) and Shift+Tab for indent and unindent, Ctrl+Enter and Ctrl+Shift+Enter for inserting line after and before, Shift+Delete for deleting the current line. +## Vim Emulation + +You can enable vim emulation in code editor. [Most basic vim commands](../general/vim-commands#vim-commands) and some [custom commands](../general/vim-commands#custom-vim-vommands) of CP Editor are supported. Many code editor settings like Tab width, Indentation, Current line highlighting are disabled when using vim mode but you can set them in [Vim configuration](../preferences/code-editing/#vim-configuration). + ## Drag and Drop You can drag files and drop them into the main editor or the input/expected part of test cases. From fc20a1e55733e4d855bc8945c26841aa04e3351a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 18 Oct 2020 15:06:01 +0530 Subject: [PATCH 02/15] style: Format Markdown files (#90) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- content/docs/General/Vim Commands/_index.md | 209 +++++++++--------- .../docs/General/Vim Commands/_index.zh.md | 1 - content/docs/General/_index.md | 1 - .../docs/Preferences/Code Editing/_index.md | 1 - 4 files changed, 105 insertions(+), 107 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index 195b71012..ab87776c6 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -7,7 +7,8 @@ description: List of supported vim commands in Vim Emulation ### Vim Commands #### Supported Features ------------------- + +* * * Most of supported commands can be followed by motion command or executed in visual mode, work with registers or can be prefixed with number of repetitions. @@ -15,123 +16,123 @@ Here is list of emulated commands with description where it can diverge from Vim #### Modes -* normal -* insert and replace -* visual -* command line (`:`) +- normal +- insert and replace +- visual +- command line (`:`) #### Normal and Visual Modes -* basic movement -- `h`/`j`/`k`/`l`, ``, ``, ``, ``, `gg`, `G`, `0`, `^`, `$` etc. -* word movement -- `w`, `e`, `b` etc. -* "inner/a" movement -- `ciw`, `3daw`, `ya{` etc. -* `f`, `t` movement -* `[`, `]` movement -* `{`, `}` -- paragraph movement -* delete/change/yank/paste with register -* undo/redo -* ``, `` -- increase or decrease number in decimal/octal/hexadecimal format (e.g. `128` on or before "0x0ff" changes it to "0x17f") -* `.` -- repeat last change -* `/search`, `?search`, `*`, `#`, `n`, `N` -- most of regular expression syntax used in Vim except `\<` and `\>` just is the same as `\b` in QRegExp -* `@`, `q` (macro recording, execution) -- special keys are saved as `` -* marks -* `gv` -- last visual selection; can differ if text is edited around it -* indentation -- `=`, `<<`, `>>` etc. with movement, count and in visual mode -* "to upper/lower" -- `~`, `gU`, `gu` etc. -* `i`, `a`, `o`, `I`, `A`, `O` -- enter insert mode -* scroll window -- `zt`, `zb`, `zz` etc. -* wrap line movement -- `gj`, `gk`, `g0`, `g^`, `g$` +- basic movement -- `h`/`j`/`k`/`l`, ``, ``, ``, ``, `gg`, `G`, `0`, `^`, `$` etc. +- word movement -- `w`, `e`, `b` etc. +- "inner/a" movement -- `ciw`, `3daw`, `ya{` etc. +- `f`, `t` movement +- `[`, `]` movement +- `{`, `}` -- paragraph movement +- delete/change/yank/paste with register +- undo/redo +- ``, `` -- increase or decrease number in decimal/octal/hexadecimal format (e.g. `128` on or before "0x0ff" changes it to "0x17f") +- `.` -- repeat last change +- `/search`, `?search`, `*`, `#`, `n`, `N` -- most of regular expression syntax used in Vim except `\<` and `\>` just is the same as `\b` in QRegExp +- `@`, `q` (macro recording, execution) -- special keys are saved as `` +- marks +- `gv` -- last visual selection; can differ if text is edited around it +- indentation -- `=`, `<<`, `>>` etc. with movement, count and in visual mode +- "to upper/lower" -- `~`, `gU`, `gu` etc. +- `i`, `a`, `o`, `I`, `A`, `O` -- enter insert mode +- scroll window -- `zt`, `zb`, `zz` etc. +- wrap line movement -- `gj`, `gk`, `g0`, `g^`, `g$` #### Command Line Mode -* `:map`, `:unmap`, `:inoremap` etc. -* `:source` -- very basic line-by-line sourcing of vimrc files -* `:substitute` -- substitute expression in range -* `:'<,'>!cmd` -- filter through an external command (e.g. sort lines in file with `:%!sort`) -* `:.!cmd` -- insert standard output of an external command -* `:read` -* `:yank`, `:delete`, `:change` -* `:move`, `:join` -* `:20` -- go to address -* `:history` -* `:registers`, `:display` -* `:nohlsearch` -* `:undo`, `:redo` -* `:normal` -* `:<`, `:>` +- `:map`, `:unmap`, `:inoremap` etc. +- `:source` -- very basic line-by-line sourcing of vimrc files +- `:substitute` -- substitute expression in range +- `:'<,'>!cmd` -- filter through an external command (e.g. sort lines in file with `:%!sort`) +- `:.!cmd` -- insert standard output of an external command +- `:read` +- `:yank`, `:delete`, `:change` +- `:move`, `:join` +- `:20` -- go to address +- `:history` +- `:registers`, `:display` +- `:nohlsearch` +- `:undo`, `:redo` +- `:normal` +- `:<`, `:>` #### Insert Mode -* `` -- execute single command and return to insert mode -* `` -- insert raw character -* `` -- toggle replace mode +- `` -- execute single command and return to insert mode +- `` -- insert raw character +- `` -- toggle replace mode #### Options (:set ...) -* `autoindent` -* `clipboard` -* `backspace` -* `expandtab` -* `hlsearch` -* `ignorecase` -* `incsearch` -* `indent` -* `iskeyword` -* `scrolloff` -* `shiftwidth` -* `showcmd` -* `smartcase` -* `smartindent` -* `smarttab` -* `startofline` -* `tabstop` -* `tildeop` -* `wrapscan` +- `autoindent` +- `clipboard` +- `backspace` +- `expandtab` +- `hlsearch` +- `ignorecase` +- `incsearch` +- `indent` +- `iskeyword` +- `scrolloff` +- `shiftwidth` +- `showcmd` +- `smartcase` +- `smartindent` +- `smarttab` +- `startofline` +- `tabstop` +- `tildeop` +- `wrapscan` #### Example Vimrc -------------- -``` - " highlight matched - set hlsearch - " case insensitive search - set ignorecase - set smartcase - " search while typing - set incsearch - " wrap-around when searching - set wrapscan - " show pressed keys in lower right corner - set showcmd - " tab -> spaces - set expandtab - set tabstop=4 - set shiftwidth=4 - " keep a 5 line buffer for the cursor from top/bottom of window - set scrolloff=5 - " X11 clipboard - set clipboard=unnamed - " use ~ with movement - set tildeop - - " mappings - nnoremap ; : - inoremap jj - - " clear highlighted search term on space - noremap :nohls - - " reselect visual block after indent - vnoremap < >gv - - " MOVE LINE/BLOCK - nnoremap :m+== - nnoremap :m-2== - inoremap :m+==gi - inoremap :m-2==gi - vnoremap :m'>+gv=gv - vnoremap :m-2gv=gv -``` + +* * * + + " highlight matched + set hlsearch + " case insensitive search + set ignorecase + set smartcase + " search while typing + set incsearch + " wrap-around when searching + set wrapscan + " show pressed keys in lower right corner + set showcmd + " tab -> spaces + set expandtab + set tabstop=4 + set shiftwidth=4 + " keep a 5 line buffer for the cursor from top/bottom of window + set scrolloff=5 + " X11 clipboard + set clipboard=unnamed + " use ~ with movement + set tildeop + + " mappings + nnoremap ; : + inoremap jj + + " clear highlighted search term on space + noremap :nohls + + " reselect visual block after indent + vnoremap < >gv + + " MOVE LINE/BLOCK + nnoremap :m+== + nnoremap :m-2== + inoremap :m+==gi + inoremap :m-2==gi + vnoremap :m'>+gv=gv + vnoremap :m-2gv=gv ### Custom vim commands diff --git a/content/docs/General/Vim Commands/_index.zh.md b/content/docs/General/Vim Commands/_index.zh.md index 989f1678e..1b7313743 100644 --- a/content/docs/General/Vim Commands/_index.zh.md +++ b/content/docs/General/Vim Commands/_index.zh.md @@ -2,4 +2,3 @@ title: "Vim Commands" weight: 1000 --- - diff --git a/content/docs/General/_index.md b/content/docs/General/_index.md index 9dee8bf84..f97810676 100644 --- a/content/docs/General/_index.md +++ b/content/docs/General/_index.md @@ -4,4 +4,3 @@ linkTitle: "General" weight: 60 description: General Information regarding Setup and documentation --- - diff --git a/content/docs/Preferences/Code Editing/_index.md b/content/docs/Preferences/Code Editing/_index.md index b2cceed6b..812b6d30d 100644 --- a/content/docs/Preferences/Code Editing/_index.md +++ b/content/docs/Preferences/Code Editing/_index.md @@ -46,7 +46,6 @@ Note that this won't replace the existing tab characters. In [Auto Indent](#auto There are two modes in text editing, Insert and Replace mode. Insert mode is common and most widely used, this is CP Editor and other editor’s default mode. In Replace mode, the cursor replaces the next character with the pressed character. If this option is enabled the cursor for newly opened tab will be in Replace mode. It can be toggled for individual tabs by pressig INS or Insert on your keyboard. - ### Highlight Current Line If enabled the current line number is highlighted from the rest of the lines. In Vim mode, current line is never highlighted. From 3c08cc0daa659586fb1152af1123f99e96380ab7 Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Sun, 18 Oct 2020 15:10:25 +0530 Subject: [PATCH 03/15] Fix broken link --- content/docs/Tips/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/Tips/_index.md b/content/docs/Tips/_index.md index b11aeea09..6ad6999ae 100644 --- a/content/docs/Tips/_index.md +++ b/content/docs/Tips/_index.md @@ -16,7 +16,7 @@ Besides the shortcuts in the menu, you can use the [Read-only Key Bindings](http ## Vim Emulation -You can enable vim emulation in code editor. [Most basic vim commands](../general/vim-commands#vim-commands) and some [custom commands](../general/vim-commands#custom-vim-vommands) of CP Editor are supported. Many code editor settings like Tab width, Indentation, Current line highlighting are disabled when using vim mode but you can set them in [Vim configuration](../preferences/code-editing/#vim-configuration). +You can enable vim emulation in code editor. [Most basic vim commands](../general/vim-commands#vim-commands) and some [custom commands](../general/vim-commands#custom-vim-commands) of CP Editor are supported. Many code editor settings like Tab width, Indentation, Current line highlighting are disabled when using vim mode but you can set them in [Vim configuration](../preferences/code-editing/#vim-configuration). ## Drag and Drop From d9d22226cc60f04dd2cda550f83601e0e4991008 Mon Sep 17 00:00:00 2001 From: Yufan You Date: Sat, 24 Oct 2020 14:34:51 +0800 Subject: [PATCH 04/15] style(vim-commands): format Markdown --- content/docs/General/Vim Commands/_index.md | 114 ++++++++++---------- 1 file changed, 56 insertions(+), 58 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index ab87776c6..2ff500e1f 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -8,8 +8,6 @@ description: List of supported vim commands in Vim Emulation #### Supported Features -* * * - Most of supported commands can be followed by motion command or executed in visual mode, work with registers or can be prefixed with number of repetitions. Here is list of emulated commands with description where it can diverge from Vim in functionality. @@ -91,66 +89,66 @@ Here is list of emulated commands with description where it can diverge from Vim #### Example Vimrc -* * * - - " highlight matched - set hlsearch - " case insensitive search - set ignorecase - set smartcase - " search while typing - set incsearch - " wrap-around when searching - set wrapscan - " show pressed keys in lower right corner - set showcmd - " tab -> spaces - set expandtab - set tabstop=4 - set shiftwidth=4 - " keep a 5 line buffer for the cursor from top/bottom of window - set scrolloff=5 - " X11 clipboard - set clipboard=unnamed - " use ~ with movement - set tildeop - - " mappings - nnoremap ; : - inoremap jj - - " clear highlighted search term on space - noremap :nohls - - " reselect visual block after indent - vnoremap < >gv - - " MOVE LINE/BLOCK - nnoremap :m+== - nnoremap :m-2== - inoremap :m+==gi - inoremap :m-2==gi - vnoremap :m'>+gv=gv - vnoremap :m-2gv=gv +```vimrc +" highlight matched +set hlsearch +" case insensitive search +set ignorecase +set smartcase +" search while typing +set incsearch +" wrap-around when searching +set wrapscan +" show pressed keys in lower right corner +set showcmd +" tab -> spaces +set expandtab +set tabstop=4 +set shiftwidth=4 +" keep a 5 line buffer for the cursor from top/bottom of window +set scrolloff=5 +" X11 clipboard +set clipboard=unnamed +" use ~ with movement +set tildeop + +" mappings +nnoremap ; : +inoremap jj + +" clear highlighted search term on space +noremap :nohls + +" reselect visual block after indent +vnoremap < >gv + +" MOVE LINE/BLOCK +nnoremap :m+== +nnoremap :m-2== +inoremap :m+==gi +inoremap :m-2==gi +vnoremap :m'>+gv=gv +vnoremap :m-2gv=gv +``` ### Custom vim commands In this section we present a list of all custom vim commands that are supported to perform different operation in CP Editor. -| Command | Shorthand | Description | Usage | +| Command | Shorthand | Description | Usage | | :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | -| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | -| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | -| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | -| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | -| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | -| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | -| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | +| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | +| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | +| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | +| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | +| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | +| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | +| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | | `format` | `fmt` | Format Code, It is same as clicking "Format Code" in menu | `format` or `fmt` | -| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | -| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | -| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | -| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` | -| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | -| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | +| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | +| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | +| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | +| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` | +| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | +| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | From b26c6aa52bebda83e2a5d97b5411fd390fef0276 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 24 Oct 2020 14:37:04 +0800 Subject: [PATCH 05/15] style: Format Markdown files (#94) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- content/docs/General/Vim Commands/_index.md | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index 2ff500e1f..972773d74 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -136,19 +136,19 @@ vnoremap :m-2gv=gv In this section we present a list of all custom vim commands that are supported to perform different operation in CP Editor. -| Command | Shorthand | Description | Usage | +| Command | Shorthand | Description | Usage | | :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | -| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | -| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | -| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | -| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | -| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | -| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | -| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | +| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | +| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | +| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | +| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | +| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | +| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | +| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | | `format` | `fmt` | Format Code, It is same as clicking "Format Code" in menu | `format` or `fmt` | -| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | -| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | -| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | -| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` | -| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | -| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | +| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | +| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | +| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | +| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` | +| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | +| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | From b628482a4396a75c572913766c0a5a7647a7f230 Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Tue, 3 Nov 2020 22:29:03 +0530 Subject: [PATCH 06/15] update docs for next & previous tab changes --- content/docs/General/Vim Commands/_index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index 972773d74..68d6c236b 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -139,6 +139,8 @@ In this section we present a list of all custom vim commands that are supported | Command | Shorthand | Description | Usage | | :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | | `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | +| `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | +| `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | | `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | | `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | | `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | From 8b053816d0ae8c04474d795ae9cabc7e5158b852 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2020 22:31:28 +0530 Subject: [PATCH 07/15] style: Format Markdown files (#103) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- content/docs/General/Vim Commands/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index 68d6c236b..3bfab3988 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -139,8 +139,8 @@ In this section we present a list of all custom vim commands that are supported | Command | Shorthand | Description | Usage | | :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | | `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | -| `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | -| `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | +| `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | +| `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | | `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | | `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | | `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | From 9866eab1979f85a64ca4359c87d5efaacd92375e Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Tue, 3 Nov 2020 22:43:34 +0530 Subject: [PATCH 08/15] fix broken links --- content/docs/Preferences/Language/_index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/Preferences/Language/_index.md b/content/docs/Preferences/Language/_index.md index 5526d0843..76a117e57 100644 --- a/content/docs/Preferences/Language/_index.md +++ b/content/docs/Preferences/Language/_index.md @@ -142,16 +142,16 @@ When choosing a snippet, you can enter the first few characters of the snippet n You can set the parentheses settings for each language and each parenthesis. -Each setting has three states: enable, disable and default. If it's default, it uses the settings in the [Code Edit](../code-edit) page. Otherwise, it overwrites the settings in the [Code Edit](../code-edit) page. +Each setting has three states: enable, disable and default. If it's default, it uses the settings in the [Code Editing](../code-editing) page. Otherwise, it overwrites the settings in the [Code Editing](../code-editing) page. ### Auto Complete -See [Code Edit/Auto Complete Parentheses](../code-edit#auto-complete-parentheses). +See [Code Editing/Auto Complete Parentheses](../code-editing#auto-complete-parentheses). ### Auto Remove -See [Code Edit/Auto Remove Parentheses](../code-edit#auto-remove-parentheses). +See [Code Editing/Auto Remove Parentheses](../code-editing#auto-remove-parentheses). ### Tab Jump Out -See [Code Edit/Jump out of a parenthesis by pressing Tab](../code-edit#jump-out-of-a-parenthesis-by-pressing-tab). +See [Code Editing/Jump out of a parenthesis by pressing Tab](../code-editing#jump-out-of-a-parenthesis-by-pressing-tab). From d2b2101deaa82347a8825ad79d964b7c179e79b6 Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Tue, 3 Nov 2020 22:47:30 +0530 Subject: [PATCH 09/15] fix broken links on translations --- content/docs/Preferences/Language/_index.ru.md | 8 ++++---- content/docs/Preferences/Language/_index.zh.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/content/docs/Preferences/Language/_index.ru.md b/content/docs/Preferences/Language/_index.ru.md index e6dcf6c03..df8b54b11 100644 --- a/content/docs/Preferences/Language/_index.ru.md +++ b/content/docs/Preferences/Language/_index.ru.md @@ -142,16 +142,16 @@ When choosing a snippet, you can enter the first few characters of the snippet n You can set the parentheses settings for each language and each parenthesis. -Each setting has three states: enable, disable and default. If it's default, it uses the settings in the [Code Edit](../code-edit) page. Otherwise, it overwrites the settings in the [Code Edit](../code-edit) page. +Each setting has three states: enable, disable and default. If it's default, it uses the settings in the [Code Editing](../code-editing) page. Otherwise, it overwrites the settings in the [Code Editing](../code-editing) page. ### Auto Complete -See [Code Edit/Auto Complete Parentheses](../code-edit#auto-complete-parentheses). +See [Code Editing/Auto Complete Parentheses](../code-editing#auto-complete-parentheses). ### Auto Remove -See [Code Edit/Auto Remove Parentheses](../code-edit#auto-remove-parentheses). +See [Code Editing/Auto Remove Parentheses](../code-editing#auto-remove-parentheses). ### Tab Jump Out -See [Code Edit/Jump out of a parenthesis by pressing Tab](../code-edit#jump-out-of-a-parenthesis-by-pressing-tab). +See [Code Editing/Jump out of a parenthesis by pressing Tab](../code-editing#jump-out-of-a-parenthesis-by-pressing-tab). diff --git a/content/docs/Preferences/Language/_index.zh.md b/content/docs/Preferences/Language/_index.zh.md index bbb8cbbc5..15a50c001 100644 --- a/content/docs/Preferences/Language/_index.zh.md +++ b/content/docs/Preferences/Language/_index.zh.md @@ -142,7 +142,7 @@ int main() 你可以为各编程语言设置相应的括号补全选项。 -每个设置有三种状态:开启,关闭或默认。如果处于默认状态,将应用 [代码编辑](../code-edit) 中的设置,否则将会使用这里的设置。 +每个设置有三种状态:开启,关闭或默认。如果处于默认状态,将应用 [代码编辑](../code-editing) 中的设置,否则将会使用这里的设置。 ### 自动补全 @@ -150,8 +150,8 @@ int main() ### 自动删除 -详见 [代码编辑/自动删除括号](../code-edit#自动删除括号)。 +详见 [代码编辑/自动删除括号](../code-editing#自动删除括号)。 ### 按 Tab 键跳出 -详见 [代码编辑/在按下 Tab 键时跳出括号](../code-edit#在按下-tab-键时跳出括号)。 +详见 [代码编辑/在按下 Tab 键时跳出括号](../code-editing#在按下-tab-键时跳出括号)。 From 2d1deb772a0f9ad53c40d4dbc7130e240feb8bc7 Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Tue, 3 Nov 2020 22:57:49 +0530 Subject: [PATCH 10/15] try to fix zh links --- content/docs/Preferences/Language/_index.zh.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/Preferences/Language/_index.zh.md b/content/docs/Preferences/Language/_index.zh.md index 15a50c001..99ac66f17 100644 --- a/content/docs/Preferences/Language/_index.zh.md +++ b/content/docs/Preferences/Language/_index.zh.md @@ -25,7 +25,7 @@ weight: 20 设置可执行文件的路径,即编译命令中 `-o` 选项后的参数。 -如果使用了相对路径,则可执行文件的位置将和源代码位置有关(如果当前标签是未命名标签,则可执行文件位置将和 [临时文件夹](../general#临时文件夹) 的位置有关)。 +如果使用了相对路径,则可执行文件的位置将和源代码位置有关(如果当前标签是未命名标签,则可执行文件位置将和 [临时文件夹](../general/information#临时文件夹) 的位置有关)。 该设置中,你可以使用如下参数: @@ -103,7 +103,7 @@ weight: 20 该设置包含三部分。 -1. [正则表达式](../general#正则表达式) +1. [正则表达式](../general/information#正则表达式) 2. 偏移类型:开头或末尾。 3. 偏移量:一个数字,可以为负值。 @@ -146,7 +146,7 @@ int main() ### 自动补全 -详见 [代码编辑/自动补全括号](../code-edit#自动补全括号)。 +详见 [代码编辑/自动补全括号](../code-editing#自动补全括号)。 ### 自动删除 From d05bf1fba801afed9a8cdd688a20a1957383e1bd Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Thu, 5 Nov 2020 14:40:07 +0530 Subject: [PATCH 11/15] update docs for chlang --- content/docs/General/Vim Commands/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index 3bfab3988..c94f2903b 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -141,7 +141,7 @@ In this section we present a list of all custom vim commands that are supported | `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | | `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | | `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | -| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. The opened tab will use the language as per file extension. | `open /absolute/path/of/file.cpp` or `opn ~/cf/a.cpp` | +| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. Without arguments it is same as open in Action menu. | `open` or `opn ~/cf/a.cpp` | | `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | | `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | | `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | @@ -151,6 +151,6 @@ In this section we present a list of all custom vim commands that are supported | `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | | `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | | `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | -| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` | +| `chlang` | `chl` | Language, It can be used to change the language of a tab. | `chlang cpp` or `chl java` | | `clear` | `clr` | Clear Message logger text | `clear` or `clr` | | `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | From 3ec782befd5ed5997c50d29b2149d0a432e02913 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2020 15:02:04 +0530 Subject: [PATCH 12/15] style: Format Markdown files (#104) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- content/docs/General/Vim Commands/_index.md | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index c94f2903b..9eee57da3 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -136,21 +136,21 @@ vnoremap :m-2gv=gv In this section we present a list of all custom vim commands that are supported to perform different operation in CP Editor. -| Command | Shorthand | Description | Usage | -| :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | -| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | -| `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | -| `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | -| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. Without arguments it is same as open in Action menu. | `open` or `opn ~/cf/a.cpp` | -| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | -| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | -| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | -| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | -| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | -| `format` | `fmt` | Format Code, It is same as clicking "Format Code" in menu | `format` or `fmt` | -| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | -| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | -| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | -| `chlang` | `chl` | Language, It can be used to change the language of a tab. | `chlang cpp` or `chl java` | -| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | -| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | +| Command | Shorthand | Description | Usage | +| :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------: | +| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | +| `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | +| `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | +| `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. Without arguments it is same as open in Action menu. | `open` or `opn ~/cf/a.cpp` | +| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | +| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | +| `run` | `run` | Run, if no argument is provided all testcases are ran, otherwise nth testcase is ran. Counting includes hidden testcases. | `run` or `run 2` | +| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` | +| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` | +| `format` | `fmt` | Format Code, It is same as clicking "Format Code" in menu | `format` or `fmt` | +| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` | +| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` | +| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` | +| `chlang` | `chl` | Language, It can be used to change the language of a tab. | `chlang cpp` or `chl java` | +| `clear` | `clr` | Clear Message logger text | `clear` or `clr` | +| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` | From a31f8f9a9c76ab20ac863b86ade1d39b0dd6d8bc Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Thu, 5 Nov 2020 16:54:16 +0530 Subject: [PATCH 13/15] fix chinese urls --- content/docs/Preferences/Language/_index.zh.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/Preferences/Language/_index.zh.md b/content/docs/Preferences/Language/_index.zh.md index 99ac66f17..ed4a1f0aa 100644 --- a/content/docs/Preferences/Language/_index.zh.md +++ b/content/docs/Preferences/Language/_index.zh.md @@ -25,13 +25,13 @@ weight: 20 设置可执行文件的路径,即编译命令中 `-o` 选项后的参数。 -如果使用了相对路径,则可执行文件的位置将和源代码位置有关(如果当前标签是未命名标签,则可执行文件位置将和 [临时文件夹](../general/information#临时文件夹) 的位置有关)。 +如果使用了相对路径,则可执行文件的位置将和源代码位置有关(如果当前标签是未命名标签,则可执行文件位置将和 [临时文件夹](../../general/information/#临时文件夹) 的位置有关)。 该设置中,你可以使用如下参数: - `${filename}`:源代码的完整文件名。如果当前标签是未命名标签,则完整文件名是 `sol.cpp`。 - `${basename}`:将 `${filename}` 去掉扩展名(`.cpp` 等)后的文件名。 -- `${tmpdir}` 或 `${tempdir}`:[临时文件夹](../general#临时文件夹) 的路径。 +- `${tmpdir}` 或 `${tempdir}`:[临时文件夹](../../general/information/#临时文件夹) 的路径。 例如,使用 `${tmpdir}/${basename}` 将会把可执行文件存储在临时文件夹下。如果你不想要存储可执行文件的话,可以这样设定路径。而 `executables/${basename}` 将会把可执行文件存储在源代码所在目录的下的 `executables` 文件夹。 @@ -103,7 +103,7 @@ weight: 20 该设置包含三部分。 -1. [正则表达式](../general/information#正则表达式) +1. [正则表达式](../../general/information#正则表达式) 2. 偏移类型:开头或末尾。 3. 偏移量:一个数字,可以为负值。 From 7298217ae8a896fc78d5d76c12f2b3579edc0a6b Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Mon, 9 Nov 2020 15:51:21 +0530 Subject: [PATCH 14/15] Remove custom command docs for next and previous --- content/docs/General/Vim Commands/_index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/docs/General/Vim Commands/_index.md b/content/docs/General/Vim Commands/_index.md index 9eee57da3..0662ebb89 100644 --- a/content/docs/General/Vim Commands/_index.md +++ b/content/docs/General/Vim Commands/_index.md @@ -139,8 +139,6 @@ In this section we present a list of all custom vim commands that are supported | Command | Shorthand | Description | Usage | | :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------: | | `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` | -| `next` | `nxt` | Switch to next tab in the editor. Returns to first tab if there is no next tab. | `next` or `nxt` | -| `previous` | `prv` | Switch to last tab in the editor. Returns to last tab if there is no previous tab. | `previous` or `prv` | | `open` | `opn` | Opens a new file, Only C++/Java/Python files will be opened. Without arguments it is same as open in Action menu. | `open` or `opn ~/cf/a.cpp` | | `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` | | `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` | From ef98e601848b15d15cb74fba2d6b80479555a0e0 Mon Sep 17 00:00:00 2001 From: Ashar Khan Date: Mon, 9 Nov 2020 15:59:57 +0530 Subject: [PATCH 15/15] Add tabn and tabp for tips --- content/docs/Tips/_index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/docs/Tips/_index.md b/content/docs/Tips/_index.md index 6ad6999ae..78732d8a0 100644 --- a/content/docs/Tips/_index.md +++ b/content/docs/Tips/_index.md @@ -16,7 +16,9 @@ Besides the shortcuts in the menu, you can use the [Read-only Key Bindings](http ## Vim Emulation -You can enable vim emulation in code editor. [Most basic vim commands](../general/vim-commands#vim-commands) and some [custom commands](../general/vim-commands#custom-vim-commands) of CP Editor are supported. Many code editor settings like Tab width, Indentation, Current line highlighting are disabled when using vim mode but you can set them in [Vim configuration](../preferences/code-editing/#vim-configuration). +You can enable vim emulation in code editor. [Most basic vim commands](../general/vim-commands#vim-commands) and some [custom commands](../general/vim-commands#custom-vim-commands) of CP Editor are supported. Many code editor settings like Tab width, Indentation, Current line highlighting are disabled when using vim mode but you can set them in [Vim configuration](../preferences/code-editing/#vim-configuration). + +You can switch to next or previous tab using `tabn` and `tabp` respectively. ## Drag and Drop