We may earn money or products from the companies mentioned in this post.
Thank you for helping to support my work!
ysst - surround on current line, ignore whitespace, no indent
y_ou
s_surround(ing)
s_selection
t_ag
ySS - surround, put surrounded text on own line, indent
viwSt
v_isual mode
i_nner
w_ord -keep hitting w to select more words-
S_urround(ing)
t_ag
cs
c_hange
s_urround(ing)
t_ag
Example cs"' will change double quotes to single
ds
d_elete
s_urround(ing)
Example: dst will delete surrounding tags
ds" will delete surrounding double quotes
GET RID OF ^M
type :%s/
press CTRL-VCTRL-M
type //g
press Enter
:set fileencoding=utf-8
" Leave Latin-1 behind, set to UTF-8
:%s/[\u0026]\{1}/\&/g
" Convert ampersands from unicode to HTML
:%s/[\u2026]\{1}/\…/g
" Convert elipses from unicode to HTML
:%s/[\u201C]/\“/g
" Convert double quotes, left from unicode to HTML
:%s/[\u201D]/\”/g
" Convert double quotes, right from unicode to HTML
:%s/[\u2018]/\‘/g
" Convert single quotes, left from unicode to HTML
:%s/[\u2019]/\’/g
" Convert single quotes, right from unicode to HTML
:%s/[\u2013]/\–/g
" Convert N Dashes from unicode to HTML
:%s/--/\–/g
" Convert double dashes to N Dashes from unicode to HTML
:%s/ / /g
" Remove double spaces
:%s/ / /g
" Remove triple spaces
:%s/[\uA0]\{2}/ /g
" Remove double non-breaking spaces
:%s/[\uA0]\{1}/ /g
" Remove single non-breaking spaces
:%s/.*<//
" Delete everything in front of < ex: name <name@domain.com> produces name@domain.com>
:%s/>//
" Delete all instances of > character
:%s/,/\r/g
" Find and replace commas with a linebreak
:%s/\v\d{3}-?\d{4}//g
" delete all 7 digit numbers with dash
%s!^!"!
"add " to the beginning of each line
And for laughs, here’s my .vimrc
set shell=fish
set nocompatible
filetype off
set number
set wrap
set linebreak
set autochdir
set ruler
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'ap/vim-css-color'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-notes'
Plugin 'jceb/vim-orgmode'
call vundle#end()
syntax enable
colorscheme monokai
filetype plugin indent on
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
Photo by Kevin Ku