This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Embelish(thing) | |
let line = line('.') | |
let l = getline(line) | |
if l !~ a:thing . '\s*$' | |
let l = l . a:thing | |
endif | |
call setline(line, [l]) | |
endfunction | |
autocmd CursorMoved * call Embelish(';') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Insertlessly | |
n <BS> <Plug>BSPastBOL | |
n <Del> <Plug>DelAtEOL | |
n <CR> <Plug>InsertNewline | |
n <S-CR> <Plug>OpenNewline | |
n <Space> <Plug>InsertSpace | |
" Buffalo | |
n <Space>l <Plug>BuffaloTrigger | |
c <C-G> <Plug>BuffaloRecursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! GoToDoc() | |
exec '!echo http://docs.unity3d.com/Documentation/ScriptReference/' . @* . '.html' | |
endfunction | |
vnoremap <leader>d :<c-u>call GoToDoc()<cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
highlight ExtraWhitespace ctermbg=red guibg=red | |
" add to or replace 'text' with filetypes | |
" you want to prevent whitespace highlighting on | |
function! ExtraWhitespace(pattern) | |
if index(['text'], &ft) == -1 | |
exe 'match ExtraWhitespace /' . a:pattern . '/' | |
endif | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" SimpleTabComplete redux | |
" Barry Arthur (bairui), 2014-03-21 | |
" modified from https://gist.github.com/anonymous/9678319 | |
function! SimpleTabComplete(direction, mapping) | |
" "n"ext or "f"orward vs, say "p"rev or "b"ackward | |
let dirs = ["\<c-p>", "\<c-n>"] | |
let dir = a:direction =~? '[nf]' | |
let map = a:mapping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Ronin() | |
substitute/\%V"/'&'/g | |
nohl | |
call histdel("search", -1) | |
endfunction | |
vnoremap <leader>q :<c-u>call Ronin()<cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! IList() | |
let term = input("IList: /") | |
if term == '' | |
let term = expand('<cword>') | |
endif | |
let v:errmsg = '' | |
redir =>slist | |
exe 'ilist /' . term | |
redir END | |
if v:errmsg == '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Barry Arthur | |
" 2014-03-26 | |
" VimPEG Example: reducing a list of comma separated function calls to the | |
" deepest parenthetic argument, or the bare function name if it contains no | |
" arguments. | |
" | |
" Examples | |
" | |
" given: | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" I extracted the magic out into a new plugin: https://github.com/dahu/Vimpartial | |
" which provides the b:partial_word used below. | |
function! AppendTags() | |
let tags = ['FIXME', 'TODO', 'NOTE'] | |
let tags = filter(tags, 'v:val =~ "^" . b:partial_word') | |
if !empty(tags) | |
let tag = matchstr(tags[0], b:partial_word . '\zs.*') | |
return tag . "-" . strftime("%s") | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" init vimple vars | |
for [var, val] in [ | |
\ ['bl', 1] | |
\,['hl', 1] | |
\,['sn', 1] | |
\,['vn', 1] | |
\,['ma', 1] | |
\,['ul', 1] | |
\,['mp', 1] | |
\] |
OlderNewer