Skip to content

Instantly share code, notes, and snippets.

View ggsalas's full-sized avatar

Gabriel Salas ggsalas

View GitHub Profile
@ggsalas
ggsalas / vimUsage.md
Last active February 16, 2017 00:22
Simple way to use Vim

Vim Usage

  • Verbs could be use in conjunction with objects, for example: ciw that means Change In a Word.
  • Also, the verbs could be use in conjunction with numbers to multiply the action, for example: d2+ => delete 2 lines down.
Verbs Objects
d => Delete iw => Inner Word
c => Change it => Inner Tag
> => indent i" => Inner quotes
@ggsalas
ggsalas / .vimrc
Last active March 1, 2017 00:45
My vimrc configuration
"" first install with:
"" [x] git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
"" then, in vim do: :PluginInstall
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'pangloss/vim-javascript'
@ggsalas
ggsalas / .tern-project
Last active July 29, 2017 21:36
Global ternjs configuration
{
"libs": [
"browser"
],
"loadEagerly": [],
"dontLoad": [],
"plugins": {
"node": {},
"es_modules": {}
}
@ggsalas
ggsalas / .bash_profile
Last active January 9, 2018 04:08
Bash profile on macos
# GIT autocompleted
# Download from: https://gist.github.com/carlosvillu/e4ada4f991d495d07604
# then do: $ source ~/.bash_profile
source ~/.git-completion.sh
# prompt
# https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
# 38: front color, 48: background color
light="\[\033[38;5;8m\]"
normal="\[\033[38;5;7m\]"
@ggsalas
ggsalas / myposts.php
Created October 5, 2015 13:52
Wordpress plugin to display posts of the displayed user on a new buddypress user tab
<?php
/*
Plugin Name: Tab "My Posts"
Plugin URI:
Description: Wordpress plugin to display posts of the displayed user on a new buddypress user tab
Version: 1.0
Author: GGsalas
Author URI: http://ggsalas.com
*/
@ggsalas
ggsalas / .bashrc
Created June 24, 2018 23:43
All my config on .bashrc and a symbolic link to .bash_profile to get work on Neovim-terminal
# GIT autocompleted
# Download from: https://gist.github.com/carlosvillu/e4ada4f991d495d07604
# then do: $ source ~/.bash_profile
source ~/.git-completion.sh
# prompt
# https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
# 38: front color, 48: background color
light="\[\033[38;5;8m\]"
normal="\[\033[38;5;7m\]"
@ggsalas
ggsalas / multipleSelect.js
Created May 28, 2019 13:52
multiple selection array, inspired on selection of gmail list of emails
// Reusable function to select multimple itens
// with start and end element
// array: array of elements to select
// selection: previously selected elements
// start: first element selected
// end: last element selected
function multipleSelect(array, selection, start, end) {
const startIndex = array.findIndex(item => item == start)
const endIndex = array.findIndex(item => item == end)
{
"suggest.echodocSupport": true,
"suggest.maxCompleteItemCount": 20,
"prettier.eslintIntegration": true,
"prettier.tslintIntegration": true,
"coc.preferences.formatOnSaveFiletypes": ["javascript", "typescript", "typescriptreact", "json", "javascriptreact"],
"eslint.filetypes": ["javascript", "typescript", "typescriptreact", "javascriptreact"],
"diagnostic.errorSign": "x",
"diagnostic.warningSign": "i",
"diagnostic.infoSign": "-"
@ggsalas
ggsalas / .gitconfig
Last active July 20, 2019 21:50
My ~/.gitconfig
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = Gabriel Salas
email = ggsalas@gmail.com
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
dt = difftool
ch = checkout
br = branch
@ggsalas
ggsalas / .tmux.conf
Created August 11, 2019 01:54
Tmux config
unbind-key C-b
set-option -g prefix C-s
bind-key -r C-s send-prefix
set-environment -g "LC_ALL" "en_US.UTF-8"
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color*:Tc:smso"
# Allow us to reload our Tmux configuration while
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"