Skip to content

Instantly share code, notes, and snippets.

View Raimondi's full-sized avatar

Israel Chauca Fuentes Raimondi

View GitHub Profile
*.pbxproj -crlf -diff -merge
@Raimondi
Raimondi / Test.vim
Created June 9, 2010 06:08
Enter insert with the appropiate indentation.
function! IndentWithI()
if len(getline('.')) == 0
return "ix\<Esc>==s"
else
return "i"
endif
endfunction
nnoremap <expr> i IndentWithI()
#!/usr/bin/env ruby
#
# Usage:
# cd /git/project/directory
# git hub-diff 223d60f5486075e74851075fcfeb366d45c17d8b 13c86f00cbfe820c415b46bfd19268284db2a274
# Future features:
# * generate SHAs from refs
# * launchy support
require 'rubygems'
@Raimondi
Raimondi / Test.vim
Created July 13, 2010 09:17
Delete a buffer and keep window distribution.
function! Bd()
let curbuf = bufnr('%')
bnext
exec "bdelete ".curbuf
endfunction
command Bd call Bd()
" Type :so % to run VimLint.
" {{{1
" ============================================================================
" File: vimlint.vim
" Description: Vim plugin that checks your Vim environment, settings and
" loaded scripts for conflicts, omissions and ill-advised
" configurations.
" Author: Barry Arthur <barry.arthur at gmail dot com>
" Last Change: 22 July, 2010
" Website: http://github.com/dahu/VimLint
@Raimondi
Raimondi / Move on wrapped lines
Created July 28, 2010 09:11
Mappings to move on wrapped lines
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
nnoremap <Home> g<Home>
nnoremap <End> g<End>
vnoremap <Home> g<Home>
vnoremap <End> g<End>
function! AutoCompile()
if exists('g:autocompile')
echom 'make'
unlet g:autocompile
endif
endfunction
augroup autocompile
au!
au BufWrite * call AutoCompile()
" Status Line {{{
" -----------
"
" Reset status line:
set statusline=
" Default color:
set statusline+=%*
" Relative file path:
@Raimondi
Raimondi / rename_tab.vim
Created September 11, 2010 01:17
Set a static label for a tab.
"http://groups.google.com/group/vim_mac/browse_frm/thread/63b4a8ed1bd0fc5c
function! MyLabel()
if exists('t:name')
return t:name
else
return ''
endif
endfunction
function! ReplaceCurrentChar(match, replace)
let save_cursor = getpos('.')
let col = col('.')
exec 's/\%'.col.'v./\=getline(".")[col-1] ==# "'.a:match.'" ? "'.a:replace.'" : submatch(0) /'
call setpos('.', save_cursor)
endfunction