Verified Commit 5b731ae2 authored by Hermann Mayer's avatar Hermann Mayer
Browse files

BashRC: Added a new TERM_APP environment variable to detect the terminal host...

BashRC: Added a new TERM_APP environment variable to detect the terminal host app. Added a catnl helper for fast string embedding. VimRC: Added more swap words and a new Ruby tooling (:CA) which creates missing alternate files. Also the NERDTree plugin collection was increased and basic tooling for Github links was added. Last but not least the Vim performance (boot and runtime) was improved by not using a Bash login shell.

Signed-off-by: Hermann Mayer's avatarHermann Mayer <hermann.mayer92@gmail.com>
parent b95599d5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -32,6 +32,19 @@ __getBashRCSourceRoot
export BASHRC_VERSION=$(cd "$BASHRC_SOURCE_ROOT" && git log --pretty="%h" -n1 HEAD)
export PATH="$PATH:${BASHRC_SOURCE_ROOT}/../bin:${BASHRC_SOURCE_ROOT}/../vendors"

# Find the current bash process host process (eg. urxvt, gvim)
# term_pid=$$
# declare -a term_coms
# while true; do
#   term_pid=$(ps -h -o ppid -p $term_pid 2>/dev/null)
#   term_com=$(ps -h -o comm -p $term_pid 2>/dev/null)
#   term_coms+=($term_com)
#   test -z "${term_com}" && break
#   test "${term_com}" = 'systemd' && break
#   test "${term_com}" = 'clone-terminal' && break
# done
# export TERM_APP=${term_coms[-2]}

# +-------------------------------------------------
# | LDAP Config
# +-------------------------------------------------

dotrc/.fonts/.uuid

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
24699ffe-94e4-4e38-81c4-144689074b51
 No newline at end of file
+229 KiB

File added.

No diff preview for this file type.

+64 −0
Original line number Diff line number Diff line
#!/usr/bin/env ruby
require 'fileutils'

file = ARGV[0]
exit 1 unless File.exist? file

def project_root(file)
  dir = File.dirname(file)
  loop do
    git = File.exist? File.join(dir, '.git')
    readme = File.exist? File.join(dir, 'README.md')
    return dir if git && readme

    dir = File.expand_path(File.join(dir, '..'))
    exit 1 if dir == '/'
  end
end

def spec?(rel)
  rel.match? %r{^(spec|test|tests)/}
end

def spec_dir(base)
  return 'spec' if File.directory? File.join(base, 'spec')
  return 'test' if File.directory? File.join(base, 'test')
  return 'tests' if File.directory? File.join(base, 'tests')

  'spec'
end

def app_dir(base)
  return 'app' if File.directory? File.join(base, 'app')
  return 'lib' if File.directory? File.join(base, 'lib')
  return 'src' if File.directory? File.join(base, 'src')

  'app'
end

def switch_base(rel, new_base)
  parts = rel.split('/')
  parts.shift
  parts.unshift(new_base)
  parts.join('/')
end

base = project_root(file)
rel = file.gsub(%r{^#{base}/}, '')

if spec? rel
  rel = switch_base(rel, app_dir(base)).gsub(/_spec\.rb$/, '.rb')
else
  rel = switch_base(rel, spec_dir(base)).gsub(/\.rb$/, '_spec.rb')
end

abs = File.join(base, rel)

exit if File.exist? abs

FileUtils.mkdir_p(File.dirname(abs))
File.write(abs, <<~EOF
  # frozen_string_literal: true
EOF
)
puts abs
+9 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ if 1 == VimRCBundlesMisc
  let g:indent_guides_enable_on_vim_startup = 1
  let g:indent_guides_exclude_filetypes = ['help', 'nerdtree']
  let g:nerdtree_open_cmd = 'setsid xdg-open'
  let g:nerdtree_plugin_open_cmd = 'setsid xdg-open'

  " +-----------------------------------------------
  " | delimitMate
@@ -394,6 +395,14 @@ if 1 == VimRCBundlesDevel
      \ ['Header', 'Footer'],
      \ ['with', 'without'],
      \ ['first', 'last'],
      \ ['Given', 'When', 'Then', 'And'],
      \ ['before', 'after'],
      \ ['allow', 'expect'],
      \ ['failed', 'succeeded'],
      \ ['included', 'class_methods'],
      \ ['requires', 'optional'],
      \ ['same', 'different'],
      \ ['when', 'with', 'without'],
      \]

  autocmd VimEnter * :IndentGuidesEnable
Loading