Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Tab set to four spaces in Vim     - Linux system versions organize local root password cracking method (Linux)

- Install the open source database PostgreSQL 9.4 and phpMyAdmin on Ubuntu (Database)

- Samhain: Powerful intrusion detection system under Linux (Linux)

- KVM virtualization of nested virtualization (Linux)

- JavaScript: understanding regular expressions (Programming)

- Oracle () trunc function usage (Database)

- Linux installed Cisco Packet Tracer (Linux)

- Linux commands to access the cheat sheet (Linux)

- Echo Command Examples (Linux)

- Tmux Crash Course: Tips and adjustment (Linux)

- How to create a bootable USB disk to use MultiSystem on Ubuntu (Linux)

- Swift rewrite initialize method of navigation controller class (Programming)

- How to install CentOS CentOS web page (Server)

- Ubuntu users to install the system indicator SysPeek 0.3 (Linux)

- Nginx load balancing configuration (http proxy) (Server)

- Ten to improve the efficiency of the Linux bash tricks (Linux)

- An Analysis of the C Algorithm for Calculating the Number of Days Between Date (Programming)

- DVD production using CentOS installation source within the company Yum (Linux)

- Java JDK has been able to compile without warning (Programming)

- The specified user to execute commands under Linux (Linux)

 
         
  Tab set to four spaces in Vim
     
  Add Date : 2016-06-10      
         
         
         
  Indented with tabs or spaces tab, this is not a problem, just like Python with four spaces to indent, this is a matter of personal preference. In Vim can easily depending on the file type is set to use tabs or spaces tab, you can set the length, very flexible.

First look at how to set up and how to determine the width of the tab with the tab tabs or spaces to represent a indent:

set tabstop = 4
set softtabstop = 4
set shiftwidth = 4
set noexpandtab / expandtab
Explanation:

Tabstop which represents a tab displayed is the number of spaces in length, default 8.

softtabstop expressed in Edit mode when pressing the backspace key to return when the length of indentation is especially useful when using expandtab.

shiftwidth represent each level of indentation length, with the same general set softtabstop.

When set to expandtab, indented with spaces to represent, noexpandtab is represented by a tab indent.

According to the file type settings tab:

Sometimes you want to set a different tab performance for certain types of files, such as python with four spaces to represent an indentation in our javascript conventions are also using four spaces to indent, and prefer to use HTML and CSS tab tab to indent, you can make the following settings:

if it has ( "autocmd")
    autocmd FileType javascript setlocal ts = 4 sts = 4 sw = 4 expandtab
    autocmd FileType python setlocal ts = 4 sts = 4 sw = 4 expandtab
endif
So that when the file is open play .js .py, we will use four spaces to indent.

With a special notation tab tabs:

In Vim you can use special symbols to represent a tab tabs, tab so that tabs and spaces can easily distinguish the opinion

Added vimrc on it:

set list
set listchars = tab: ▸ \, eol: ¬
     
         
         
         
  More:      
 
- Performance Diagnosis of 60,000 milliseconds for Linux (Linux)
- iOS in Singleton (Programming)
- Python2.7.7 source code analysis (Programming)
- Convert MySQL date string to a NULL value exception handling (Database)
- MySQL stored procedures and triggers (Database)
- About Auto Layout and frame (Programming)
- Find details block device with Linux blkid command (Linux)
- How to deploy Python Web application: Heroku deployment process complete records (Server)
- Cross server / client backup command: rsync use (Server)
- Nginx load balancing configuration (http proxy) (Server)
- Python MySQL database connection (Database)
- HBase vs Oracle (Database)
- To setup a ftp server under Linux (Server)
- SQL Server automatic backup script (Database)
- Shell scripts get a snapshot of the page and generates thumbnails (Linux)
- Single-node Hadoop installation notes distributed pseudo & (Server)
- MySQL Online DDL tools of pt-online-schema-change (Database)
- JavaScript notes --Objects (Programming)
- Android memory optimization of the optimal load Bitmap (Linux)
- Use dump restore mode fast backup and recovery system FreeBSD (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.