Skip to content

Instantly share code, notes, and snippets.

@dahu
dahu / gist:2435943
Created April 21, 2012 09:01
My DISC Values
High Aesthetic : You very much prefer form, harmony and balance. You are
likely a strong advocate for green initiatives and
protecting personal time and space.
Very Low Economic : You may try to help meet customers' needs (internal and
external) before your own.
High Individualistic : You have no problem standing up for your own rights and
may impart this energy into others as well.
@dahu
dahu / gist:2700225
Created May 15, 2012 09:04
generate header-file
" Creates a header file from the function declarations within the current C
" file.
" Barry Arthur, 2012 05 15
let header = expand('%:r') . '.h'
if filereadable(header)
echo "Header file " . header . " exists!"
finish
endif
silent exe "!touch " . header
@dahu
dahu / gist:2717762
Created May 17, 2012 09:34
Tabnewleft
" Tabnewleft - Open tab page to the left of the current tab page
" Barry Arthur, 2012 5 17
function! Tabnewleft()
let curtabpage = tabpagenr()
tabnew
exe "tabmove " . (curtabpage - 1)
endfunction
command! Tabnewleft call Tabnewleft()
@dahu
dahu / gist:2723903
Created May 18, 2012 08:08
Diffalicious - Compare two mouse-selected texts in Vim
" Diffalicious - Compare two mouse-selected texts in Vim
" Barry Arthur, 2012 5 18
let s:second_window_text = "Select text to compare with other window and press <enter> here."
function! Diffalicious()
tabnew
call DiffPasteIt()
botright vnew
call setline(1, s:second_window_text)
@dahu
dahu / gist:2852448
Created June 1, 2012 14:15
ExpandHelpWord()
" Help terms can include characters typically not considered within keywords.
function! ExpandHelpWord()
let iskeyword = &iskeyword
set iskeyword=!-~,^),^*,^\|,^",192-255
let word = expand('<cword>')
let &iskeyword = iskeyword
return word
endfunction
" F1 to show context sensitive help for keyword under cursor
@dahu
dahu / gist:2917493
Created June 12, 2012 13:25
sanitized & sorted list of vimgor requests on #vim between 2010-07-03 to 2012-06-12
129 tabs
117 smartindent
104 buffers
93 nohl
93 csapprox
92 anyone
78 indent
77 vim-tiny
75 doesn't work
69 movement
@dahu
dahu / gist:2969237
Created June 21, 2012 23:28
vim filetype test
#include <stdio.h>
int main() {
printf("")
}
@dahu
dahu / gist:2969324
Created June 21, 2012 23:57
ubuntu 12.04 filetype.vim
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Feb 03
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
finish
endif
let did_load_filetypes = 1
@dahu
dahu / gist:2996208
Created June 26, 2012 14:45
spacedots
set conceallevel=2 concealcursor=nc
syntax match spaceDots " " conceal cchar=·
hi spaceDots ctermbg=fg ctermfg=197
@dahu
dahu / gist:2996267
Created June 26, 2012 14:57
spacedots II
set conceallevel=2 concealcursor=nciv
syntax match spaceDots " " conceal cchar=·
hi clear Conceal
hi Conceal ctermfg=244 ctermbg=233