Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Working with Linux ??? Quick Hacks for the Command Line

You're reading from   Working with Linux ??? Quick Hacks for the Command Line Command line power like you've never seen

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781787129184
Length 222 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Bogdan Vaida Bogdan Vaida
Author Profile Icon Bogdan Vaida
Bogdan Vaida
Petru I»ôfan Petru I»ôfan
Author Profile Icon Petru I»ôfan
Petru I»ôfan
Arrow right icon
View More author details
Toc

Supercharging Vim


Let's start by opening a new hidden file called .vimrc in our home folder and pasting a few lines:

set nocompatible
filetype off

" Settings to replace tab. Use :retab for replacing tab in existing files.
set tabstop=4
set shiftwidth=4
set expandtab

" Have Vim jump to the last position when reopening a file
if has("autocmd")
   au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif

" Other general vim options:
syntax on
set showmatch      " Show matching brackets.
set ignorecase     " Do case insensitive matching
set incsearch      " show partial matches for a search phrase
set nopaste
set number           
set undolevels=1000

Now let's close and reopen the file, so that we can see the configuration take effect. Let's go into a little more detail regarding some of the options.

First of all, as you've probably guessed, the lines starting with " are comments, so they can be ignored. Lines 5, 6, and 7 tell vim to always use...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime