About: Autoconvert leading eight spaces to tab when type or paste in Makefile   Sponge Permalink

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

Makefiles punish you if instead of single tab somebody puts eight spaces in your makefile (happens when pasting between Makeiles). This script guards against this annoying pitfall. The following script auto-converts 8 spaces at the beginning of line (only in Makefiles, and only at the beginning of line) into tab, as you type or paste. It is suggested to have :set list in Makefiles, too. This script will only work if :set nopaste is set.

AttributesValues
rdfs:label
  • Autoconvert leading eight spaces to tab when type or paste in Makefile
rdfs:comment
  • Makefiles punish you if instead of single tab somebody puts eight spaces in your makefile (happens when pasting between Makeiles). This script guards against this annoying pitfall. The following script auto-converts 8 spaces at the beginning of line (only in Makefiles, and only at the beginning of line) into tab, as you type or paste. It is suggested to have :set list in Makefiles, too. This script will only work if :set nopaste is set.
Version
  • 6(xsd:integer)
dcterms:subject
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 1432(xsd:integer)
Author
  • Yakov Lerner
Complexity
  • intermediate
Created
  • 2006(xsd:integer)
ID
  • 1434(xsd:integer)
NEXT
  • 1435(xsd:integer)
Rating
  • 134(xsd:integer)
abstract
  • Makefiles punish you if instead of single tab somebody puts eight spaces in your makefile (happens when pasting between Makeiles). This script guards against this annoying pitfall. The following script auto-converts 8 spaces at the beginning of line (only in Makefiles, and only at the beginning of line) into tab, as you type or paste. It is suggested to have :set list in Makefiles, too. This script will only work if :set nopaste is set. " In Makefile, automatically convert eight spaces at the beginning " of line to tab, as you type (or paste). au FileType make :inoremap :call MapSpaceInMakefile() function! MapSpaceInMakefile() " if this space is 8th space from the beginning of line, replace 8 spaces with " one tab (only at the beginning of file) let line = getline('.') let col = col('.') if strpart(line, 0, 8) == ' ' let new = " " . strpart(line,8) call setline('.', new ) endif return "" endfunction
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