Format data and automatically allocate memory to be of sufficient length.
This is a care-free alternative to snprintf() with strings of arbitrary length.
" Use Tabs | |
function! UseTabs() | |
" Highlight tabs within lines, trailing whitespace and | |
" spaces at the beginning of lines | |
match errorMsg /[^\t]\zs\t\+\|\s\+$\|^[\t]*[ ]\+[\t]*[^\*]/ | |
set noexpandtab | |
endfunc | |
nnoremap <F5> :call UseTabs()<CR> | |
" Use Spaces |
#!/usr/bin/env bash | |
# Switch to next viewport | |
next_viewport() | |
{ | |
if (( X+VIEWPORT_WIDTH >= TOTAL_WIDTH )) | |
then | |
X=0 | |
if (( Y+VIEWPORT_HEIGHT >= TOTAL_HEIGHT )) |
set background=dark | |
highlight clear | |
if exists( "syntax on" ) | |
syntax reset | |
endif | |
let g:colors_name = "android" | |
hi Normal ctermfg=251 ctermbg=235 |
#!/usr/bin/env ruby | |
c = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789!-_".split( // ) | |
(ARGV.length.zero? ? [8] : ARGV).each do |n| | |
puts (0...n.to_i).map{ c[rand( c.size )] }.join | |
end |
------------------------------------------------------------------------------ | |
-- local members | |
------------------------------------------------------------------------------ | |
local devWidth, devHeight = 0, 0 | |
local viewport = nil | |
local layer = nil | |
local quad = nil | |
local prop = nil | |
local imgWidth, imgHeight = 0, 0 |