Skip to content

Instantly share code, notes, and snippets.

View ninrod's full-sized avatar
🤓
git commiting since 2014

Filipe Silva ninrod

🤓
git commiting since 2014
View GitHub Profile
#!/usr/local/bin/zsh
vimfolder=~/.vim
target=.vim(:a)
# verificando se o link simbólico da pasta ~/.vim já está montado.
if [[ -h $vimfolder ]]; then
print '"'$vimfolder'" já existe.'
else
print 'montando link simbólico "'$vimfolder'" -> "'$target'"'
ln -s .vim(:a) ~/.vim
#!/usr/local/bin/zsh
f1 () {
local a=$1
local b=$2
local c;
let "c=$1+$2"
print $c
}
@ninrod
ninrod / param_exp.zsh
Created December 30, 2015 13:50
exemplo de uso de glob modifier para expandir um parâmetro de uma função zsh interpretado como um filename para um full qualified name (full path)
#!/usr/local/bin/zsh
#location of default vim folder
vimfolder=~/.vim
#path of local .vim folder
target=.vim
foo() {
# seria a mesma coisa que $1(:a)
@ninrod
ninrod / GPL.md
Created January 15, 2016 16:30 — forked from jnrbsn/GPL.md
A Markdown-formatted GPL for your GitHub projects.

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Operador oper = new Operador();
Transacao utx2 = null;
utx2 = GerenciadorTransacoes.getInstancia().getTransacao();
utx2.begin();
try {
oper = FachadaPessoal.getInstancia().buscarOperador(operadorNome);
utx2.rollback();
} catch (BCRepositorioException re) {
throw new BCObjetoInvalidoException(FachadaProcorf.RESOURCE_BUNDLE,
@ninrod
ninrod / build-zsh.sh
Created February 11, 2016 13:00
Build last stable version of ZSH from sources on Ubuntu, or any other version with small changes
#!/bin/bash
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Make script gives up on any error
set -e
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall
@ninrod
ninrod / grok_vi.mdown
Created February 23, 2016 01:54 — forked from nifl/grok_vi.mdown
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@ninrod
ninrod / terminal-control.sh
Created April 8, 2016 21:21 — forked from bcap/terminal-control.sh
Useful terminal control characters
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"
@ninrod
ninrod / solarized-colors.md
Created April 12, 2016 19:07
Solarized Dark values on different color palettes

Solarized Dark values on different color palettes

SOLARIZED HEX 16/8 TERMCOL XTERM HEX L*A*B RGB HSB GNU screen
base03 #002b36 8/4 brblack 234 #1c1c1c 15,-12,-12 0,43,54 193,100,21 K
base02 #073642 0/4 black 235 #262626 20,-12,-12 7,54,66 192,90,26 k
base01 #586e75 10/7 brgreen 240 #585858 45,-07,-07 88,110,117 194,25,46 G
base00 #657b83 11/7 bryellow 241 #626262 50,-07,-07 101,123,131 195,23,51 Y
base0 #839496 12/6 brblue 244 #808080 60,-06,-03 131,148,150 186,13,59 B
base1 #93a1a1 14/4 brcyan 245 #8a8a8a `65,-05
@ninrod
ninrod / vim-centos-build-from-source.sh
Last active September 1, 2019 22:52 — forked from juxtin/vim74centos
Build Vim from source on Centos
#!/bin/bash
yum groupinstall 'Development tools' -y
yum install ncurses ncurses-devel -y
git clone --depth 1 https://github.com/vim/vim.git
cd vim
./configure --prefix=/usr --with-features=huge --enable-pythoninterp --enable-multibyte
make
sudo make install