Skip to content

Latest commit

 

History

History
187 lines (163 loc) · 5.36 KB

README.md

File metadata and controls

187 lines (163 loc) · 5.36 KB

VIM useful commmands

Aimer G. Diaz 9/27/2021

VIM as the best text editor for Unix platforms: List of useful commands

Vim as a text editor is highly editable or customizable and extensible, meaning provides extensive support to various plugins in order to enhance the Vim’s functionality. But one of its most important feature, at least, for bioinformatic purpose is that Vim consume fewer system resources than emacs, nano, or especially the graphical editors. Additionally Vim is lightweight and very fast, even when modifying the large numbers of files source code. Even more, you can run it over ssh for various remote operations on any type of server.

  1. Useful configurations of vim on ~/.vimrc
# Must-have configurations for all the vim files of the user:

# Show the enumeration per line
set number 

# Have you ever waste time on codes that do not work just because the file encoding was not appropriated 
# Before to get into the details of each language, each time working with new text documents, check first the encoding format by using the command.  

file -bi FILE

# In case of getting a file in a different format than UTF-8, by using vim you can re-format the document
set encoding=utf-8 
set bomb 
# A single command line 
vim +"argdo se bomb | se fileencoding=utf-8 | w"
#  Finally  sometimes is needed delete characters like ^M, which can be done with
dos2unix  

# Copy and paste files from a text open with vim to wherever you want 
set clipboard=unnamed
# 

Some other vim configurations might be useful for you, but I haven’t explored here

  1. Useful commands of Vim:
  • Delete a line or a specific set of lines
# A line which number is known 
d #  
# Remove the line where you are located 
dd 

More commands here 3. .