Skip to content

Instantly share code, notes, and snippets.

# See also http://vim-taglist.sourceforge.net/manual.html
# ~/.ctags
--regex-sh=/^[ \t]*(typeset|local)?[ \t]*([A-Za-z0-9_-]+)=/\2/v,variable,variables/
--regex-sh=/^[ \t]*(readonly|declare -r)[ \t]*([A-Za-z0-9_-]+)=/\2/c,constant,constants/
# ~/.vim/vimrc
let tlist_sh_settings = 'sh;f:functions;v:variables;c:constants'
let g:tagbar_type_sh = {
\ 'kinds':[
\ 'f:functions',
@dracorp
dracorp / clean_env.sh
Created April 27, 2018 11:07
How to run a script in clean environment
#!/usr/bin/env bash
set -e
DEFAULT_VARS=(
CLEANED=1
HOME=$HOME
TERM=$TERM
)
@dracorp
dracorp / perl-local-lib-alias.sh
Last active April 20, 2018 11:04
Custom alias for Perl module local::lib
__perl-local-lib() {
local local_directory="${1:-$HOME/perl5/local-lib}"
local alias_name="${2:-pll}"
case $1 in
-h|--help)
printf '%s\n' "Usage: ${FUNCNAME[0]} [directory for local::lib] [alias name]"
return;;
esac
if perl -I${local_directory}/lib/perl5 -Mlocal::lib=${local_directory} &>/dev/null; then
diff --git a/kshrc b/kshrc
old mode 100644
new mode 100755
index 5fd8cf3..90099fa
--- a/kshrc
+++ b/kshrc
@@ -1,7 +1,7 @@
export PERLBREW_SHELLRC_VERSION=0.82
@dracorp
dracorp / .zshrc
Last active February 19, 2018 22:02
if [[ -f /usr/share/zsh/share/antigen.zsh ]]; then
source /usr/share/zsh/share/antigen.zsh
elif [[ -f ~/.zsh.d/antigen.zsh ]]; then
source ~/.zsh.d/antigen.zsh
fi
if type antigen &>/dev/null; then
# Load a supported zsh pre-packaged framework
antigen use oh-my-zsh
export ZSH # localization for oh-my-zsh, provides e.g. tools/theme_chooser.sh
# git theming
SCM_THEME_PROMPT_DIRTY="${bold_red}✗"
SCM_THEME_PROMPT_CLEAN="${green}✓"
SCM_THEME_PROMPT_PREFIX="("
SCM_THEME_PROMPT_SUFFIX=")"
SCM_THEME_PROMPT_DIRTY="×"
SCM_THEME_PROMPT_CLEAN="✓"
function prompt_command() {
#--- FUNCTION ----------------------------------------------------------------
# NAME: _add2env
# DESCRIPTION: add new value to env variable, first parameter must be set
# rest is optional and if omitted then it'll set on PATH and :
# SYNOPSIS: _add2env values
# USAGE: _add2env value
# _add2env variable value
# _add2env variable value separator
# RETURNS: -
#-------------------------------------------------------------------------------
source ~/.zsh.d/antigen.zsh
antigen use oh-my-zsh
antigen bundle git
antigen bundle safe-paste
antigen theme https://github.com/denysdovhan/spaceship-prompt spaceship
antigen apply
pkgname=perl-mojolicious
pkgver=7.46
pkgrel=1
_author="S/SR/SRI"
_perlmod="Mojolicious"
pkgdesc="Mojolicious - Real-time web framework"
arch=('any')
url="http://search.cpan.org/dist/Mojolicious/"
license=('GPL' 'PerlArtistic')
depends=(perl)
@dracorp
dracorp / check_env.sh
Created September 15, 2017 09:20
Run a script in clean environment
#!/usr/bin/env bash
[[ -n "$HOME" ]] && exec /usr/bin/env -i bash --noprofile --norc "$0" "$@"
export
env