From 94e429f914be777770cf8094d728008a5efcf6ff Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Mon, 22 Aug 2016 21:41:57 +0100 Subject: added all core files --- core/vim.html | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 core/vim.html (limited to 'core/vim.html') diff --git a/core/vim.html b/core/vim.html new file mode 100644 index 0000000..f09bbb8 --- /dev/null +++ b/core/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 SysDoc Manual. + Copyright (C) 2016 + Silvino Silva. + See the file Gnu Free Documentation License + for copying conditions.

+ + + -- cgit 1.4.1-2-gfad0