Home

abawchen's graffiti

18 Jan 2018

Live with Vim instead of Sublime

As a developer, I have admired those who code fast and easily with the vim – syntax highlight, auto-completion, split/switch tabs, jump to the searched keyword/files … etc – and everything only with keyboard. It’s really cool and impressive.

And yes, you may say most of the them can be fullfilled in Sublime (or other IDE), but everything in terminal is the critical one, which means we don’t have to switch between different applications for coding and running the program, and can live well by ssh to any remote host to do the jobs as efficient as at the local.

That I decide to say goodbye to my favoriate editor Sublime and embrace Vim from today. Given that I am really new to Vim (yes, only :wq) and always have a bunch of work on-hand, so I begin with finding out the corresponding features I most used in Sublime, by that way I can switch to Vim streamingly and dig out more later.


Let’s go!

  • Vundle: The plug-in manager for Vim.

  • CtrlP: Full path fuzzy file, buffer, mru, tag, … finder for Vim. As Command + P

  • NERDTree: The NERDTree is a file system explorer for the Vim editor. Using this plugin, users can visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations.

  • NERDTree-Git: A plugin of NERDTree showing git status flags.

  • indentLine: This plugin is used for displaying thin vertical lines at each indentation level for code indented with spaces.

  • YouCompeleteMe: A code-completion engine for Vim.

  • vim-gitgutter: A Vim plugin which shows a git diff in the ‘gutter’ (sign column). It shows whether each line has been added, modified, and where lines have been removed. You can also stage and undo individual hunks.

  • fugitive.vim: A Git wrapper so awesome.

  • vim-airline: Lean & mean status/tabline for vim that’s light as air.

  • terryma/vim-multiple-cursors: True Sublime Text style multiple selections for Vim.

My ~/.vimrc as follows:

"========================
" Basic configuration
"========================
set nocompatible
set number
set guioptions-=r
set guioptions-=L
set guioptions-=b
set showtabline=0
syntax on
set nowrap
set fileformat=unix
set cindent
set tabstop=4
set shiftwidth=4
set showmatch
set scrolloff=5
set laststatus=2
set fenc=utf-8
set backspace=2
set mouse=a
set selection=exclusive
set selectmode=mouse,key
set matchtime=5
set incsearch
set hlsearch
set noexpandtab
set whichwrap+=<,>,h,l
set autoread
set cursorline

"========================
" Vundle with Plugins
"========================
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'vim-airline/vim-airline'
Plugin 'Yggdroot/indentLine'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'terryma/vim-multiple-cursors'
call vundle#end()
filetype plugin indent on

"========================
" NERDTree
"========================
map <F10> :NERDTreeToggle<CR>
let NERDTreeChDirMode=1
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$']
let NERDTreeWinSize=25

"========================
" CtrlP
"========================
let g:ctrlp_max_files=0
let g:ctrlp_max_depth=40

Happy Coding :)

Til next time,
abawchen at 22:27