Skip to content

Commit fb66fa2

Browse files
committed
Create Separate General Section
1 parent 8a41ef1 commit fb66fa2

File tree

22 files changed

+223
-18
lines changed

22 files changed

+223
-18
lines changed

content/docs/Preferences/General/_index.md renamed to content/docs/General/Information/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
title: "General"
2+
title: "Information"
33
weight: 1000
4+
description: Information regarding terminologies or methodologies used in Documentations
45
---
56

67
### Temporary Directory

content/docs/Preferences/General/_index.ru.md renamed to content/docs/General/Information/_index.ru.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "General"
2+
title: "Information"
33
weight: 1000
44
---
55

File renamed without changes.
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
---
2+
title: "Vim Commands"
3+
weight: 1000
4+
description: List of supported vim commands in Vim Emulation
5+
---
6+
7+
### Vim Commands
8+
9+
#### Supported Features
10+
------------------
11+
12+
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.
13+
14+
Here is list of emulated commands with description where it can diverge from Vim in functionality.
15+
16+
#### Modes
17+
18+
* normal
19+
* insert and replace
20+
* visual
21+
* command line (`:`)
22+
23+
#### Normal and Visual Modes
24+
25+
* basic movement -- `h`/`j`/`k`/`l`, `<C-U>`, `<C-D>`, `<C-F>`, `<C-B>`, `gg`, `G`, `0`, `^`, `$` etc.
26+
* word movement -- `w`, `e`, `b` etc.
27+
* "inner/a" movement -- `ciw`, `3daw`, `ya{` etc.
28+
* `f`, `t` movement
29+
* `[`, `]` movement
30+
* `{`, `}` -- paragraph movement
31+
* delete/change/yank/paste with register
32+
* undo/redo
33+
* `<C-A>`, `<C-X>` -- increase or decrease number in decimal/octal/hexadecimal format (e.g. `128<C-A>` on or before "0x0ff" changes it to "0x17f")
34+
* `.` -- repeat last change
35+
* `/search`, `?search`, `*`, `#`, `n`, `N` -- most of regular expression syntax used in Vim except `\<` and `\>` just is the same as `\b` in QRegExp
36+
* `@`, `q` (macro recording, execution) -- special keys are saved as `<S-Left>`
37+
* marks
38+
* `gv` -- last visual selection; can differ if text is edited around it
39+
* indentation -- `=`, `<<`, `>>` etc. with movement, count and in visual mode
40+
* "to upper/lower" -- `~`, `gU`, `gu` etc.
41+
* `i`, `a`, `o`, `I`, `A`, `O` -- enter insert mode
42+
* scroll window -- `zt`, `zb`, `zz` etc.
43+
* wrap line movement -- `gj`, `gk`, `g0`, `g^`, `g$`
44+
45+
#### Command Line Mode
46+
47+
* `:map`, `:unmap`, `:inoremap` etc.
48+
* `:source` -- very basic line-by-line sourcing of vimrc files
49+
* `:substitute` -- substitute expression in range
50+
* `:'<,'>!cmd` -- filter through an external command (e.g. sort lines in file with `:%!sort`)
51+
* `:.!cmd` -- insert standard output of an external command
52+
* `:read`
53+
* `:yank`, `:delete`, `:change`
54+
* `:move`, `:join`
55+
* `:20` -- go to address
56+
* `:history`
57+
* `:registers`, `:display`
58+
* `:nohlsearch`
59+
* `:undo`, `:redo`
60+
* `:normal`
61+
* `:<`, `:>`
62+
63+
#### Insert Mode
64+
65+
* `<C-O>` -- execute single command and return to insert mode
66+
* `<C-V>` -- insert raw character
67+
* `<insert>` -- toggle replace mode
68+
69+
#### Options (:set ...)
70+
71+
* `autoindent`
72+
* `clipboard`
73+
* `backspace`
74+
* `expandtab`
75+
* `hlsearch`
76+
* `ignorecase`
77+
* `incsearch`
78+
* `indent`
79+
* `iskeyword`
80+
* `scrolloff`
81+
* `shiftwidth`
82+
* `showcmd`
83+
* `smartcase`
84+
* `smartindent`
85+
* `smarttab`
86+
* `startofline`
87+
* `tabstop`
88+
* `tildeop`
89+
* `wrapscan`
90+
91+
#### Example Vimrc
92+
-------------
93+
```
94+
" highlight matched
95+
set hlsearch
96+
" case insensitive search
97+
set ignorecase
98+
set smartcase
99+
" search while typing
100+
set incsearch
101+
" wrap-around when searching
102+
set wrapscan
103+
" show pressed keys in lower right corner
104+
set showcmd
105+
" tab -> spaces
106+
set expandtab
107+
set tabstop=4
108+
set shiftwidth=4
109+
" keep a 5 line buffer for the cursor from top/bottom of window
110+
set scrolloff=5
111+
" X11 clipboard
112+
set clipboard=unnamed
113+
" use ~ with movement
114+
set tildeop
115+
116+
" mappings
117+
nnoremap ; :
118+
inoremap jj <Esc>
119+
120+
" clear highlighted search term on space
121+
noremap <silent> <Space> :nohls<CR>
122+
123+
" reselect visual block after indent
124+
vnoremap < <gv
125+
vnoremap > >gv
126+
127+
" MOVE LINE/BLOCK
128+
nnoremap <C-S-J> :m+<CR>==
129+
nnoremap <C-S-K> :m-2<CR>==
130+
inoremap <C-S-J> <Esc>:m+<CR>==gi
131+
inoremap <C-S-K> <Esc>:m-2<CR>==gi
132+
vnoremap <C-S-J> :m'>+<CR>gv=gv
133+
vnoremap <C-S-K> :m-2<CR>gv=gv
134+
```
135+
136+
### Custom vim commands
137+
138+
In this section we present a list of all custom vim commands that are supported to perform different operation in CP Editor.
139+
140+
| Command | Shorthand | Description | Usage |
141+
| :----------: | :-------: | :-----------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: |
142+
| `new` | `new` | Opens a new tab, if no langauge is specified, a tab in default editor langauge will open | `new cpp` or `new` |
143+
| `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` |
144+
| `compile` | `cmp` | Compiles the code, It is like clicking "Compile" button in a tab. | `compile` or `cmp` |
145+
| `crun` | `crn` | Compiles and run, It is like clicking "Compile and Run" button in a tab. | `crun` or `crn` |
146+
| `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` |
147+
| `drun` | `drn` | Detached run, It is same as clicking "Detached Run" in menu. | `drun` or `drn` |
148+
| `killall` | `kap` | Kill all process, It is same as clicking "Kill Process" in menu | `killall` or `kap` |
149+
| `format` | `fmt` | Format Code, It is same as clicking "Format Code" in menu | `format` or `fmt` |
150+
| `snippet` | `snp` | Open snippet dialog, It is same as clicking "Use Snippets" in menu | `snippet` or `snp` |
151+
| `vmode` | `vmd` | View mode, Changes the view mode. It can only toggle to "edit" and "split" mode | `vmode edit` or `vmd split` |
152+
| `preference` | `prf` | Preferences, It is same as clicking "Preference" in menu | `preference` or `prf` |
153+
| `lang` | `lng` | Language, It can be used to change the language of a tab. | `lang cpp` or `lng java` |
154+
| `clear` | `clr` | Clear Message logger text | `clear` or `clr` |
155+
| `exit` | `ext` | Exit, It is same as pressing "Quit" in menu. | `exit` or `ext` |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Vim Commands"
3+
weight: 1000
4+
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Vim Commands"
3+
weight: 1000
4+
---
5+

content/docs/General/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "General"
3+
linkTitle: "General"
4+
weight: 60
5+
description: General Information regarding Setup and documentation
6+
---
7+

content/docs/General/_index.ru.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "General"
3+
linkTitle: "General"
4+
weight: 60
5+
description: General Information regarding Setup and documentation
6+
---

content/docs/General/_index.zh.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "General"
3+
linkTitle: "General"
4+
weight: 60
5+
description: General Information regarding Setup and documentation
6+
---

content/docs/Preferences/Code Edit/_index.md renamed to content/docs/Preferences/Code Editing/_index.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Code Edit"
2+
title: "Code Editing"
33
weight: 10
44
---
55

@@ -41,3 +41,20 @@ You can choose the parentheses to jump out by Tab in the [Parentheses](../langua
4141
When you insert an indent, insert spaces instead of a tab character. The number of spaces is equal to the [Tab Width](#tab-width).
4242

4343
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).
44+
45+
### Default cursor overwrites
46+
47+
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 <kbd>INS</kbd> or <kbd>Insert</kbd> on your keyboard.
48+
49+
50+
### Highlight Current Line
51+
52+
If enabled the current line number is highlighted from the rest of the lines. In Vim mode, current line is never highlighted.
53+
54+
### Enable Vim emulation
55+
56+
If enabled code editor uses vim emulation. In Vim emulation, Control Key such as <kbd>Ctrl+N</kbd> 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)
57+
58+
### Vim Configuration
59+
60+
The configuration to use in vim mode. The list of all supported vim commands are listed [here](../../general/vim-commands/#vim-commands)

0 commit comments

Comments
 (0)