Onur Yasarlar
  • About Me
  • Linux
    • How to Install KVM on CentOS 7/8 and Ubuntu 18/20
    • How to Install VirtualBox on CentOS 7/8 and Ubuntu 18
    • How to Install Vagrant on Centos 7/8 and Ubuntu 18
    • Using vim Effectively
  • Kubernetes
    • How to Install a Kubernetes Cluster
      • Installing Prerequisites for Kubernetes Cluster Installation
      • Installing Container Runtime Interface
      • Installing kubeadm
    • How to Install and Use K3D
  • CI/CD
    • GitLab CICD Pipeline Concepts
      • Stages
    • Quick Introduction to GitLab CICD Pipelines
    • How to install custom Gitlab runners with libvirt executor
  • Azure
    • Azure Infrastructure Automation with Gitlab CI
  • TERRAFORM
    • How to create a Terraform Module
Powered by GitBook
On this page

Was this helpful?

  1. Linux

Using vim Effectively

PreviousHow to Install Vagrant on Centos 7/8 and Ubuntu 18NextHow to Install a Kubernetes Cluster

Last updated 4 years ago

Was this helpful?

One said vim is dead, but I quite disagree. The power of the modern IDEs like or cannot be ignored, but there are lots of developers, administrators out there using vim as their primary interface. Even if it is not the primary one, there can still be an improvement to use vim more effectively. Here vim plugins run to our aid. I personally use vim a lot and have a "must-have" plugins. I wanted to keep them in a and I believe the best way is to add all plugins as .

Let me list down my "must-have" plugins below and thank their developers, contributors:

I personally use to install and use the plugins so the way how you will edit your .vimrc file is one of the most important things. I am currently using a simple one but I add more in the future to make my life easier

.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
set nocompatible      " We're running Vim, not Vi!

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set number
set cursorline

setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal autoindent

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

" Lighline plugin activation
if !has('gui_running')
  set t_Co=256
endif
set laststatus=2

" Python indentation
syntax on
autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=4
filetype plugin indent on
set autoindent

" Ruby indentation
syntax on
autocmd FileType ruby setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
filetype plugin indent on
set autoindent

" YAML indentation
syntax on
autocmd FileType yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
filetype plugin indent on
set autoindent

" Bash indentation
syntax on
autocmd FileType bash setlocal expandtab shiftwidth=2 tabstop=2
filetype plugin indent on
set autoindent


" auto indent by F7
map <F7> mzgg=G`z

" Paste mode on / off by F2
set pastetoggle=<F2>

" vimdiff coloring change
map <F6> :windo set syn=OFF<CR>

" Nerdtree open side menu by "ctrl-o"
map <C-o> :NERDTreeToggle<CR>

Visual Studio Code
Atom
Git repository
git submodules
nerdtree
syntastic
lightline
bash-support.vim
pathogen