commit f3abc8e78bf7616197a84dc838810b4ed78998d9 Author: 1jamesthompson1 <1jamesthompson1@gmail.com> Date: Wed Sep 24 19:38:27 2025 +1200 init basics diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..12ad836 --- /dev/null +++ b/.bashrc @@ -0,0 +1,127 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi +alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +# Set the propmt +export PS1='\[\033[01;32m\]\t\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' + +# Lazy load conda +conda() { + unset -f conda + . "/home/james/miniconda3/etc/profile.d/conda.sh" + conda "$@" +} + +# Lazy load nvm +load_nvm() { + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" + [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" +} + +nvm() { load_nvm; nvm "$@"; } +node() { load_nvm; node "$@"; } +npm() { load_nvm; npm "$@"; } + +export EDITOR=vim +export VISUAL=vim + + +export PATH="/usr/local/bin:$PATH" +. "$HOME/.cargo/env" +if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then + exec tmux +fi + +# opencode +export PATH=/home/james/.opencode/bin:$PATH diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..6f68716 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,8 @@ +set-window-option -g mode-keys vi +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..87afcb1 --- /dev/null +++ b/.vimrc @@ -0,0 +1,53 @@ + +" An example for a vimrc file. +" +" Maintainer: Bram Moolenaar +" Last change: 2019 Dec 17 +" +" To use it, copy it to +" for Unix: ~/.vimrc +" for Amiga: s:.vimrc +" for MS-Windows: $VIM\_vimrc +" for Haiku: ~/config/settings/vim/vimrc +" for OpenVMS: sys$login:.vimrc + +" When started as "evim", evim.vim will already have done these settings, bail +" out. +if v:progname =~? "evim" + finish +endif + +" Get the defaults that most users want. +source $VIMRUNTIME/defaults.vim + +if has("vms") + set nobackup " do not keep a backup file, use versions instead +else + set backup " keep a backup file (restore to previous version) + if has('persistent_undo') + set undofile " keep an undo file (undo changes after closing) + endif +endif + +if &t_Co > 2 || has("gui_running") + " Switch on highlighting the last used search pattern. + set hlsearch +endif + +" Put these in an autocmd group, so that we can delete them easily. +augroup vimrcEx + au! + + " For all text files set 'textwidth' to 78 characters. + autocmd FileType text setlocal textwidth=78 +augroup END + +" Add optional packages. +" +" The matchit plugin makes the % command work better, but it is not backwards +" compatible. +" The ! means the package won't be loaded right away but when plugins are +" loaded during initialization. +if has('syntax') && has('eval') + packadd! matchit +endif