Skip to content

Instantly share code, notes, and snippets.

@subfuzion
subfuzion / global-gitignore.md
Last active April 23, 2024 22:47
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 23, 2024 15:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@mislav
mislav / _readme.md
Last active March 28, 2024 00:47
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@othiym23
othiym23 / npm-upgrade-bleeding.sh
Created September 20, 2014 19:36
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@romainl
romainl / .ctags
Last active June 14, 2023 09:19
My ctags config
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss
@BoltsJ
BoltsJ / qfsign.vim
Last active December 5, 2022 06:30
Automatically place signs based on the quickfix list.
if exists('g:loaded_qfsign')
finish
endif
let g:loaded_qfsign=1
sign define QFErr texthl=QFErrMarker text=E
sign define QFWarn texthl=QFWarnMarker text=W
sign define QFInfo texthl=QFInfoMarker text=I
augroup qfsign
@crmne
crmne / download_zeal_user_docsets.py
Last active June 6, 2022 08:37
A solution to the lack of UI for Dash's user docsets in Zeal. Uses Python 3 and easygui (pip3 install easygui)
"""Download Dash User Docsets and install them in Zeal"""
import configparser
import json
import tarfile
import urllib.request
from pathlib import Path
from sys import platform
import easygui
@ethagnawl
ethagnawl / .inputrc
Last active May 5, 2021 19:54
Display Vim mode in Bash prompt
# requires >= Bash 4.3
# note: the prompt will not be updated if you use a custom PS1 which contains a newline character
set editing-mode vi
set keymap vi-command
set show-mode-in-prompt on
# if it's configured correctly, your prompt will be prefixed with a `+` while in insert mode and a `:` when in command mode.
" save all the completions
let s:completions = []
function! asyncomni#omnifunc(findstart, base)
if a:findstart
let l:line_string = getline('.')
let l:line = line('.')
let l:col = col('.')
" locate start of the word
let l:start = l:col -1