From f87cd06b4072c23cfd3313227318ef5259003934 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Mon, 4 Mar 2019 16:44:37 +0000 Subject: vim documentation revision --- tools/vim.html | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 6 deletions(-) (limited to 'tools/vim.html') diff --git a/tools/vim.html b/tools/vim.html index 89ac0c0..dd1e8a6 100644 --- a/tools/vim.html +++ b/tools/vim.html @@ -2,12 +2,12 @@ - Vim + Vim Tools Index -

Vim

+

Vim

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

@@ -29,7 +29,7 @@ personalizing it;

-        $ sudo cp ~/sysdoc/conf/etc/skel/.vimrc /etc/skel/
+        $ sudo cp ~/doc/conf/etc/skel/.vimrc /etc/skel/
         $ sudo mkdir /etc/skel/.vim
         $ sudo mkdir /etc/skel/.vim/swap
         $ sudo mkdir /etc/skel/.vim/views
@@ -85,6 +85,19 @@
             
Open vertical split with file browser.
+

To find files, run vim at top level of project and then use find auto completion or *;

+ +
+        :find nameofdirectory + Tab
+        :find nameofdir* + Tab
+        
+ +

For file browsing there is also a option to use edit;

+ +
+        :edit nameofdirectory/
+        
+
         

5. Editing files

Come from background;

@@ -179,13 +192,64 @@ comma (,), press esc to confirm. -

6. Spellcheck

+

6. Tags

+ +

Tags, at top level of project;

+ +
+        $ ctags -R .
+        $ vim src/hello_world.c
+        
+ +

To follow a tag;

+ +
+        Ctrl-]
+        
+ +

To get back;

+ +
+        Ctrl-t
+        
+ +

Autocomplete, press to see all options;

+ +
+        Ctrl-n
+        
+ +

To move forward and backward in options;

+ +
+        Ctrl-n Ctrl-p
+        
+ +

Show auto completion with references to only this file;

+ +
+        Ctrl-x Ctrl-n
+        
+ +

Show auto completion with filenames, * Tab can be used;

+ +
+        Ctrl-x Ctrl-f
+        
+ +

Show auto completion with only tags;

+ +
+        Ctrl-x Ctrl-]
+        
+ +

7. Spellcheck

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

-

7. Plugins

+

8. Plugins

-

8. Vimdiff

+

9. Vimdiff

If two files are open in split type :diffthis in both windows to get vimdiff of the files. To close type :diffoff.

-- cgit 1.4.1-2-gfad0