About: Surround selection with text   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

For example, to quote a selection: before: bla bla Selected Text bla bla :'<,'>call Surround('"', '"') after : bla bla "Selected Text" bla bla fun! Surround(s1, s2) range exe "normal vgvmboma\" normal `a let lineA = line(".") let columnA = col(".") normal `b let lineB = line(".") let columnB = col(".") " exchange marks if lineA > lineB || lineA <= lineB && columnA > columnB " save b in c normal mc " store a in b normal `amb " set a to old b normal `cma endif exe "normal `ba" . a:s2 . "\`ai" . a:s1 . "\" endfun Surround also works for a selection over more than one line. Some handy mappings:

AttributesValues
rdfs:label
  • Surround selection with text
rdfs:comment
  • For example, to quote a selection: before: bla bla Selected Text bla bla :'<,'>call Surround('"', '"') after : bla bla "Selected Text" bla bla fun! Surround(s1, s2) range exe "normal vgvmboma\" normal `a let lineA = line(".") let columnA = col(".") normal `b let lineB = line(".") let columnB = col(".") " exchange marks if lineA > lineB || lineA <= lineB && columnA > columnB " save b in c normal mc " store a in b normal `amb " set a to old b normal `cma endif exe "normal `ba" . a:s2 . "\`ai" . a:s1 . "\" endfun Surround also works for a selection over more than one line. Some handy mappings:
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 987(xsd:integer)
Author
  • Jan Christoph Ebersbach
Complexity
  • basic
Created
  • 2005-09-09(xsd:date)
ID
  • 988(xsd:integer)
NEXT
  • 989(xsd:integer)
Rating
  • 3(xsd:integer)
abstract
  • For example, to quote a selection: before: bla bla Selected Text bla bla :'<,'>call Surround('"', '"') after : bla bla "Selected Text" bla bla fun! Surround(s1, s2) range exe "normal vgvmboma\" normal `a let lineA = line(".") let columnA = col(".") normal `b let lineB = line(".") let columnB = col(".") " exchange marks if lineA > lineB || lineA <= lineB && columnA > columnB " save b in c normal mc " store a in b normal `amb " set a to old b normal `cma endif exe "normal `ba" . a:s2 . "\`ai" . a:s1 . "\" endfun Surround also works for a selection over more than one line. before: bla bla Selec ted Text bla bla :'<,'>call Surround('"', '"') after : bla bla "Selec ted Text" bla bla Some handy mappings: vnoremap _" :call Surround('"', '"') vnoremap _( :call Surround('(', ')') vnoremap _[ :call Surround('[', ']') vnoremap _{ :call Surround('{', '}') I defined it as a command to perform fast on-demand-surroundings command! -range -nargs=* Sur call Surround() before: bla bla Selected Text bla bla :'<,'>Sur (<\ - -\ >) after : bla bla (< -Selected Text- >) bla bla
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software