Skip to content

Instantly share code, notes, and snippets.

View lopesivan's full-sized avatar
🚧
Working from home

Mr. Ivan lopesivan

🚧
Working from home
View GitHub Profile
"Press <m-t> to start
function! s:Chaves(string)
echomsg a:string
endfunction
function! s:Chiquinha(string)
echomsg a:string
endfunction
@lopesivan
lopesivan / build_emacs-nox.md
Created April 30, 2022 04:10
Build emacs

Build emacs

A one-liner to install all dependencies is:

$ sudo apt update
$ sudo apt install build-essential libgtk-3-dev libgnutls28-dev \
  libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev \
 libncurses-dev texinfo \

Bash has built in features to access the last command executed. But that's the last whole command (e.g. the whole case command), not individual simple commands like you originally requested.

!:0 = the name of command executed.

!:1 = the first parameter of the previous command

!:4 = the fourth parameter of the previous command
CONF_NAME = nvim
GIT_DIR = ${HOME}/developer/dotfiles/.$(CONF_NAME)
WORK_TREE = ${HOME}/.config/$(CONF_NAME)
GIT = /usr/bin/git --git-dir=$(GIT_DIR) --work-tree=$(WORK_TREE)
include dev.mk
nvim-treesitter.tgz:
tar cvzf nvim-treesitter.tgz site/pack/packer/start/nvim-treesitter
@lopesivan
lopesivan / man_gcc.sh
Created April 28, 2022 04:33
Um exemplo de como usar o less como pager com man
#!/usr/bin/env bash
man(){
env \
PAGER=less \
MANPAGER=less \
LESS_TERMCAP_mb=$(tput bold; tput setaf 2) \
LESS_TERMCAP_md=$(tput bold; tput setaf 6) \
LESS_TERMCAP_me=$(tput sgr0) \
LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) \
@lopesivan
lopesivan / dica_1.md
Last active April 17, 2022 01:59
Dica: Bloco de código em markdown.

Dica de aprimoramento de codificação número 1

Objetivo

Criar um comando que permita ao usuário envolver um bloco de código com ```.

exemplo:

Antes:

@lopesivan
lopesivan / vim_oo.md
Last active April 16, 2022 01:48
Hello World orientado a objetos em VimScript

Em Vim Script

 1 " metodos
 2 """""""""
 3 
 4 function helloWorld#Show() dict
 5       echo s:message
 6 endfunction
@lopesivan
lopesivan / migracao.txt
Created April 13, 2022 18:22
última postagem do dia, a migração de código está fluindo bem, então compartilho esse trecho de código com vcs.
última postagem do dia, a migração de código está fluindo bem, então
compartilho esse trecho de código com vcs.
Arquivo 1: em vimscript -- DEPRECATED
" on_yank.vim - on_yank
" Maintainer: Ivan Lopes
" ~/.config/nvim/after/plugin
" Cool highlighting
@lopesivan
lopesivan / motion.vim
Created April 12, 2022 22:29
Script para move linha e bloco
" $Id$
" Name Of File: |n|
"
" Description: Vim plugin
"
" Author: Ivan Lopes <lopesivan (at) email >
" Maintainer: Ivan Lopes <lopesivan (at) email>
"
" Last Change: $Date:$
" Version: $Revision:$
#include <stdio.h>
#include <sqlite3.h>
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#define MAX_THREADS 100