Skip to content

shahanavazm/vim-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

vim-notes

copy and paste

use the following setting in vimrc to enable easy copy and paste between vim and other applications.
set clipboard^=unnamed,unnamedplus
autocmd TerminalWinOpen * set clipboard^=unnamed,unnamedplus

with this setting in place, the following will happen:
when deleting with d, c, x or s, content is copied to registers ", * and +.
when yanking with y, content is copied to registers ", *, + and 0.
when yanking with "ay, conent goes to a, it does not go to 0 or +, which are undistrubed.
when pasting with p or P, content is pasted from register +.
when pasting in insert mode, try to use ctrl r +.
to paste from yank register (register 0) use "0p or "0P or ctrl r 0.
so in summary consider + as the default register and 0 as the yank register.
frequently we need to copy a text to yank register and then clear it, then use something like: ygvc

vim operator grammer:

operator ( motion | text-object )
operator = ["register] [repetition] ( d | c | y ...)
motion = [repetition] ( h | l | j | k | w | b | /text | ?text | `a ...)
text-object = [repetition] modifer object
modifier = a | i
object = w | W | p | s | ( | ) | { | } | [ | ] | " | ' | `...

examples:
"02d2/text
"02d2aw

navigation and text objects

a frequet pattern which works almost everywhere:
jump to a location using search, for example /{
use text objects to operate on an area, for example ci{

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published