Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ When Vim create Python scripts, vim autocomplete interpreter and encoding method     - How to Install Xombrero 1.6.4 (minimalist Web browser) on Ubuntu and Archlinux (Linux)

- Linux system security configuration (Linux)

- Android Custom View password box example (Programming)

- Defensive programming in PHP (Programming)

- Zookeeper cluster deployment (Server)

- After reloading the cinder-volume OpenStack not start properly (Server)

- Talk about the Linux ABI compatibility Application (Linux)

- How to install Git client in Ubuntu (Linux)

- Questions about Linux compiler u-boot (Programming)

- The practical application of Oracle synonyms + dblink (Database)

- Eclipse-ee Tomcat browser can not start Tomcat, and Web project service deployment (Server)

- Oracle 10g New Features - Archive Compression (Database)

- In the case of using cgroups Ubuntu 14.04 and Docker (Linux)

- How Linux Log Analysis (Linux)

- Installation Enpass secure password manager on Ubuntu (Linux)

- CentOS 6.6 installation certification system based on the ftp service (Server)

- Linux operating process information (Linux)

- Linux Tutorial: Open multiple tabs in the GNOME terminal in Ubuntu 15.04 (Linux)

- Getting the Linux shell variable test (Programming)

- Linux 101 hack book reading notes (Linux)

 
         
  When Vim create Python scripts, vim autocomplete interpreter and encoding method
     
  Add Date : 2016-08-05      
         
         
         
  Create a vimrc file in the user's home directory, and then add in the following:

function HeaderPython ()

call setline (1, "#! / usr / bin / env python")

call append (1, "# - * - coding: utf8 - * -")

normal G

normal o

normal o

endf

autocmd bufnewfile * .py call HeaderPython ()

Save out

For example, I use the root user, so I created as follows:

vim ~ / .vimrc

function HeaderPython ()

call setline (1, "#! / usr / bin / env python")

call append (1, "# - * - coding: utf8 - * -")

normal G

normal o

normal o

endf

autocmd bufnewfile * .py call HeaderPython ()

Save and exit

Then directly vim file name in any directory
     
         
         
         
  More:      
 
- Use Ansible to bulk manage remote servers (Server)
- Fedora 20 users install the Mate 1.8 desktop (Linux)
- Linux Powerful IDE - Geany configuration instructions (Linux)
- Usage Linux device tree (Programming)
- What is the Docker (Linux)
- How do you know your public IP terminal in Linux (Linux)
- Linux System Getting Started Learning: The Linux log (Linux)
- Linux security-related basics (Linux)
- Modular JavaScript (Programming)
- C # mobile side and PC-side data exchange (Database)
- WinSCP to transfer text files will automatically convert the format (Linux)
- Advanced network security tips Linux backdoor Technology and Practice (Linux)
- After the first remote installation GlassFish Web to remotely access their back office management system error solution appears (Server)
- MySQL partition table Comments (Database)
- Linux system versions organize local root password cracking method (Linux)
- Android Fragment everything you need to know (Programming)
- Linux OOM killer mechanism (Linux)
- Debian (Wheezy) Install Redmine 2.6 (Programming)
- How to install or upgrade to the Linux kernel in Ubuntu 4.2 (Linux)
- Into the Java keyword instanceof (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.