From 43daea26ca460eb877ae858ad7bbd165974a9c93 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Sun, 18 Sep 2016 21:41:41 +0100 Subject: core added exim, tar and vim moved to tools --- tools/vim.html | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 tools/vim.html (limited to 'tools/vim.html') diff --git a/tools/vim.html b/tools/vim.html new file mode 100644 index 0000000..e633670 --- /dev/null +++ b/tools/vim.html @@ -0,0 +1,159 @@ + + + + + 5. Vim + + + + Systools Index +

5. Vim

+ +

<leader> with default configuration is key \, so when + you see <leader>-W means pressing \W

+ +

5.1. Vim RC

+ +

Read + "A good vimrc" + for more information.

+ +
+
/usr/share/vim/vimrc
+
System wide Vim initializations.
+
~/.vimrc
+
Your personal Vim initializations.
+
+ +

Copy vimrc skeleton example, so that each user have a base to start + personalizing it;

+ +
+        $ sudo cp ~/sysdoc/conf/etc/skel/.vimrc /etc/skel/
+        $ sudo mkdir /etc/skel/.vim
+        $ sudo mkdir /etc/skel/.vim/swap
+        $ sudo mkdir /etc/skel/.vim/views
+        $ sudo mkdir /etc/skel/.vim/undodir
+        $ sudo mkdir /etc/skel/.vim/backup
+        $ wget -O wombat256mod.vim  http://www.vim.org/scripts/download_script.php?src_id=4055
+        $ mv wombat256mod.vim /usr/share/vim/colors/
+        
+ +

5.2. Color schemes

+ +

Default vimrc skeleton is configured to use wombat256mod, + which is installed by adduser skeleton.

+ +

5.3. Split and tab

+ +

:sp

+ +

5.4. Editing files

+ +

Modes

+ +

To enter visual block mode press ctrl-v. To insert block + first select area then press I, insert text normally, when + you pres ESC the text will be inserted on previously selected + area.

+ +

Come from background;

+ +
+        $ fg
+        
+ +

Moving in vim

+ +

Moving page up and page down;

+ +
+
[Control][b]
+
Move back one full screen
+
[Control][f]
+
Move forward one full screen
+
[Control][d]
+
Move forward 1/2 screen
+
[Control][u]
+
Move back (up) 1/2 screen
+
+ +

How to use vim

+ +

In vim you can apply predefined number of times to a operator, + selection or object. For example to delete the next + two words press: d + 2 + w. List of important operators objects, + selections;

+
+
+        
+        operator + count + object
+        
+ +

Operator;

+ +
+
d
+
Delete
+
c
+
Change (d + i)
+
y
+
Copy
+
v
+
Visual Select
+
+ +

Objects;

+
+
w
+
Word
+
s
+
Sentences
+
p
+
Paragraphs
+
t
+
Tags
+
+ +

Selections are like objects, for example d + i + w + will delete "inner" word, c + a + w do the same plus + the space;

+ +
+
a
+
All
+
i
+
in
+
t
+
Until
+
f
+
Find forward
+
F
+
Find backward
+
+ +

Selection of useful combinations;

+
+
vat
+
Select whole tag block. +
cit
+
Change inside tag. +
yat
+
Copy whole tag.
+
+ +

5.5. Spell check

+ +

Press z= over the bad written word and select desired one.

+ +

5.6. Plugins

+ + Systools Index +

This is part of the c9-doc Manual. + Copyright (C) 2016 + Silvino Silva. + See the file Gnu Free Documentation License + for copying conditions.

+ + + -- cgit 1.4.1-2-gfad0