Skip to content

Instantly share code, notes, and snippets.

filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Plugins
Plugin 'tpope/vim-fugitive'
@Johnytran
Johnytran / vim
Created July 2, 2016 07:46
install vim ball file
Simply open the vimball file in Vim and then execute :source %.
@Johnytran
Johnytran / vim
Last active June 17, 2016 01:12
tab a block code
To adjust the indent on three lines:
Put the cursor anywhere in the first line.
Press V then jj to visually select the three lines.
Press > to indent (shift text one 'shiftwidth' to the right), or press < to shift left.
Press . to repeat the indent, or u to undo if you have shifted too far.
Type gv if you want to reselect the lines (not needed).
If you’re copying blocks of text around and need to align the indent of a block in its new location,
use ]p instead of just p. This aligns the pasted block with the surrounding text.
@Johnytran
Johnytran / vim
Created June 16, 2016 00:45
set folding code
set fdm=indent
set fdc=4
set fdl=1
@Johnytran
Johnytran / vim
Created June 15, 2016 05:05
close current window
ctrl w q
@Johnytran
Johnytran / vim
Created June 15, 2016 04:53
show full path file
:S
@Johnytran
Johnytran / vim
Created June 13, 2016 02:52
split window in vim
Using windows
Ctrl-W s and Ctrl-W v to split the current window horizontally and vertically. You can also use :split and :vertical split (:sp and :vs)
Ctrl-W w to switch between open windows, and Ctrl-W h (or j or k or l) to navigate through open windows.
Ctrl-W c to close the current window, and Ctrl-W o to close all windows except the current one.
Starting vim with a -o or -O flag opens each file in its own split.
@Johnytran
Johnytran / vim
Last active June 13, 2016 02:20
copy paste text to clipboard
Use:
:%y+
to yank all lines.
Explanation:
% to refer the next command to work on all the lines
y to yank those lines
@Johnytran
Johnytran / vim
Created June 13, 2016 01:36
color picker
https://github.com/KabbAmine/vCoolor.vim
using
alt - c
@Johnytran
Johnytran / gist:50db742daf27bbae49dfd1263b237910
Created June 12, 2016 04:17 — forked from Steven-Rose/gist:3943830
VI: Select all + delete, select all + copy
Select all and delete (actually move to buffer)
:%d
Select all and copy to buffer
:%y
Use p to paste the buffer.