recentpopularlog in

kme : dotfile   47

tmux windows and pane split's on current directory (Example)
Apparently this behavior changed in 1.9, but the link to the changelog in this article is broken.

<code>bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"</code>
tmux  movein  config  dotfile  fuckina  solution 
8 weeks ago by kme
Shell Tricks: .inputrc binding fun - BrettTerpstra.com
In Bash, there are some great but lesser-known default bindings. You may know that Option-. will insert the last argument of the previous command (e.g. running ls ~/Desktop and then typing cd and pressing Option-. will turn it into cd ~/Desktop), but did you know you can actually yank the argument at any index from the last command (without using history or ! operators)?

Just press Option-[#], where # is the position of the argument you want, then type Option-. to insert it in the current command.
inputrc  bash  dotfile  configfile 
8 weeks ago by kme
X resources - ArchWiki | https://wiki.archlinux.org/
Load a resource file (such as the conventional .Xresources), replacing any current settings:
<code class="language-bash">
$ xrdb ~/.Xresources
</code>

Load a resource file, and merge with the current settings:
<code class="language-bash">
$ xrdb -merge ~/.Xresources
</code>

Note:
Most Display managers load the ~/.Xresources file on login.
The older ~/.Xdefaults file is read when an X11 program starts, but only if xrdb has not been used in the current session. [1]
x11  configfuration  xdefaults  xresources  reference  xterm  urxvt  configfile  dotfile 
july 2019 by kme
How (and Why) to Log Your Entire Bash History
Interesting technique, but as mentioned in the comments, you can use Bash's built-in features to do basically the same thing.

Curiously, this was the same basic approach as in the "eternal history" article at https://debian-administration.org/article/543/Bash_eternal_history.
interesting  bash  history  histfile  promptcommand  dotfile 
july 2019 by kme
7 Tips - Tuning Command Line History in Bash - ShellHacks
There's nothing here that isn't in the manual, but it's a concise reference that's all in one place. Every 'shopt' and 'HISTCONTROL' option listed here seems to be supported in Bash 4.1 and above (this means CentOS 6).

The 'PROMPT_COMMAND' example, though, would clobber an existing PROMPT_COMMAND, so do it like this instead:
<code class="language-bash">PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }history -a"</code>
bash  history  histfile  configfile  dotfile  essential  movein  reference 
july 2019 by kme
Share your .screenrc : linux
r/linux: All things Linux and GNU/Linux -- this is neither a community exclusively about the kernel Linux, nor is exclusively about the GNU operating system.
screen  showmeyour  screenrc  dotfile  configfile 
may 2019 by kme
A nice default screenrc · GitHub
A nice default screenrc. GitHub Gist: instantly share code, notes, and snippets.
screen  screenrc  configfile  dotfile  movein  newbie  terminalmultiplexer 
may 2019 by kme
Linuxart » Blog Archive » Super-useful inputrc | https://web.archive.org/
Not sure if really *any* of these work. Or maybe they just *work* now, by default, for most Linux distros, since this post was from 2005.
inputrc  dotfile  configfile 
april 2019 by kme
A ~/.inputrc for Humans - Top Bug Net | https://www.topbug.net/
<code class="language-inputrc">
$include /etc/inputrc
"\C-p":history-search-backward
"\C-n":history-search-forward

set colored-stats On
set completion-ignore-case On
set completion-prefix-display-length 3
set mark-symlinked-directories On
set show-all-if-ambiguous On
set show-all-if-unmodified On
set visible-stats On
</code>

I would add these, too:
<code class="language-inputrc">
$if mode=vi
set keymap vi-command
# these are for vi-command mode
"\e[A": history-search-backward
"\e[B": history-search-forward

set keymap vi-insert
# these are for vi-insert mode
"\e[A": history-search-backward
"\e[B": history-search-forward

# source: https://brettterpstra.com/2015/07/09/shell-tricks-inputrc-binding-fun/
"\e[1;5C": forward-word
"\e[1;5D": backward-word
$endif
</code>
bash  commandline  editing  configfile  dotfile  movein  essential  newbie  inputrc  readline 
april 2019 by kme
Autocompletion for your python shell|console|interpreter | http://blog.e-shell.org/
You really do need to set PYTHONSTARTUP in your login scripts.
So, all you have to do is, first, add this two lines to a file, for example, called .pythonrc in your home:
<code class="language-bash">cat ~/.pythonrc
# import rlcompleter, readline
# readline.parse_and_bind('tab:complete')
</code>

Second, add the PYTHONSTARTUP variable to your shell profile file. If you are using csh, tcsh or similar shells, this will do it:
<code class="language-bash">echo "setenv PYTHONSTARTUP ~/.pythonrc" >> ~/.cshrc</code>

If your shell is sh, bash, ksh or similars, this will do it:
<code class="language-bash">echo "export PYTHONSTARTUP=~/.pythonrc" >> ~/.profile</code>


On macOS, where the system Python is probably compiled against libedit instead of readline, you need to do this instead:

<code class="language-python">import readline
import rlcompleter
if 'libedit' in readline.__doc__:
readline.parse_and_bind("bind ^I rl_complete")
else:
readline.parse_and_bind("tab: complete")</code>
python  repl  autocompletion  tabcompletion  configfile  dotfile  solution 
march 2019 by kme
kragen/xcompose: for sharing .XCompose keybindings | https://github.com/
for sharing .XCompose keybindings. Contribute to kragen/xcompose development by creating an account on GitHub.
linux  x11  dotfile  composekey  specialcharacters  reference 
january 2019 by kme
node.js - Install NPM into home directory with distribution nodejs package (Ubuntu) - Stack Overflow
Easier still: add prefix=$HOME/.local/lib/node_modules to your ~/.npmrc and then add that path + '/bin' to your PATH.

<code class="language-bash">
npm config set prefix $HOME/.local/lib/node_modules
echo "PATH=$HOME/.local/lib/node_modules/bin:$PATH" >> ~/.bashrc
</code>
nodejs  npm  configfile  dotfile  annoyance  solution 
march 2017 by kme
python - Disable IPython Exit Confirmation - Stack Overflow
If you also want Ctrl-D to exit without confirmation, in IPython 0.11, add
<code class="language-python">
c.TerminalInteractiveShell.confirm_exit = False
</code>
to your config file (~/.ipython/profile_default/ipython_config.py).

If you don't have a config file yet, run ipython profile create to create one.

It's worth noting that 'ipython locate profile <profilename>' will reveal where IPython will look for th...
ipython  annoyance  configfile  dotfile  solution  flask  fuckina 
january 2017 by kme
How to auto-update SSH agent environment variables when attaching to existing tmux sessions - Stack Overflow
There's an excellent gist by Martijn Vermaat, which addresses your problem in great depth, although it is intended for screen users, so I'm adjusting it for tmux here.

To summarize:

create ~/.ssh/rc if it doesn't exist yet, and add the following content:

#!/bin/bash

# Fix SSH auth socket location so agent forwarding works with tmux
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi

Make it work in tmux, add this to your ~/.tmux.conf:

# fix ssh agent when tmux is detached
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock

solution  tmux  screen  ssh-agent  dotfile  authentication 
june 2016 by kme
git merge - What's the simplest way to git a list of conflicted files? - Stack Overflow [http://stackoverflow.com/]
I created an alias for this:

git config --global alias.conflicts "diff --name-only --diff-filter=U"
git  conflicts  merging  diff  solution  movein  essential  dotfile 
june 2016 by kme
linux - Bash Prompt with Last Exit Code - Stack Overflow
export PROMPT_COMMAND=__prompt_command # Func to gen PS1 after CMDs

function __prompt_command() {
local EXIT="$?" # This needs to be first
PS1=""

local RCol='\[\e[0m\]'

local Red='\[\e[0;31m\]'
local Gre='\[\e[0;32m\]'
local BYel='\[\e[1;33m\]'
local BBlu='\[\e[1;34m\]'
local Pur='\[\e[0;35m\]'

if [ $EXIT != 0 ]; then
PS1+="${Red}\u${RCol}" # Add red if exit code non 0
else
PS1+="${Gre}\u${RCol}"
fi

PS1+="${RCol}@${BBlu}\h ${Pur}\W${BYel}$ ${RCol}"
}
ps1  bash  promptstring  exitstatus  shellscripting  dotfile  solution  customization 
april 2016 by kme
tmux Configuration [http://nakkaya.com/]
Maybe it's just impossible to set up and attach sessions within a config file. The sample script on this page just does it all from the command line, *then* attaches to it at the end:
TERM=xterm-256color
tmux has-session -t dev
if [ $? != 0 ]
then
tmux new-session -s dev -n emacs -d
tmux send-keys -t dev 'cd ~/' C-m
tmux send-keys -t dev 'emacs -main-instance' C-m
tmux new-window -n dired -t dev
tmux send-keys -t dev 'cd ~/' C-m
tmux send-keys -t dev 'emacs' C-m
fi
tmux attach -t dev
tmux  reference  dotfile  configfile  maybesolution 
october 2014 by kme
Zsh - ArchWiki
Configuring $PATH

Information about setting up the system path per user in zsh can be found here: http://zsh.sourceforge.net/Guide/zshguide02.html#l24

In short, put the following in ~/.zshenv:

~/.zshenv

typeset -U path
path=(~/bin /other/things/in/path $path)
dotfile  configfile  shell  zsh  solution 
january 2014 by kme
Lab 11 - Git Immersion - Brought to you by Neo
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p

# Bash aliases:
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'

alias got='git '
alias get='git '
git  aliases  bash  commandline  configfile  dotfile  tipsandtricks  devel 
april 2013 by kme

Copy this bookmark:





to read