diff options
author | mjfernez <mjf@mjfer.net> | 2021-12-22 17:50:34 -0500 |
---|---|---|
committer | mjfernez <mjf@mjfer.net> | 2021-12-22 17:50:34 -0500 |
commit | 864ce0cff6ad530cdbe0bee133204c114d1905da (patch) | |
tree | 428b2c46ceeda798fda1f5c637f11118aac3135f | |
download | dotfiles-master.tar.gz |
-rw-r--r-- | .bash_aliases | 33 | ||||
-rw-r--r-- | .bashrc | 97 | ||||
-rw-r--r-- | .bashrc.min | 96 | ||||
-rw-r--r-- | .tmux.conf | 40 | ||||
-rw-r--r-- | .vimrc | 147 | ||||
-rw-r--r-- | .vimrc.min | 97 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | config.fish | 77 |
8 files changed, 590 insertions, 0 deletions
diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..d40ce6e --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,33 @@ +##Fun bullshit aliases +# quicker base64 decryption +alias based="base64 -d" +# color cat, pip install Pygments, if you dont have +alias ccat="pygmentize -g -O style=fruity" +# sources changes to bashrc faster +alias bashrc="source ~/.bashrc" +# easy dec to hex, must be single quoted or bash misunderstands +alias hexcalc='echo "obase=16;$(cat)" | bc' +# vim/gdb like quit +alias q="exit" +alias :q="exit" +##Necessary aliases +# pull input to clipboard +alias clip="xclip -selection c" +# some more ls aliases +alias ll="ls -lh" +alias la="ls -Ah" +alias lt="ls -Aulth" +alias lS="ls -AlSh" +alias l="ls" +# makes speaker-test less annoying +alias speaker-test="speaker-test -t wav -c 2 -l 1" + +##Python stuff +# virtual env aliases +alias venv="source ./env/bin/activate" +alias newvenv="python -m venv ./env" +# pycharm because they made it weird +alias charm="/opt/pycharm-community-2020.3.3/bin/pycharm.sh" + +# old st config, now I just stuck this in /bin/st +# alias st="/usr/local/bin/st -f 'Fira Mono for Powerline-18' -e tmux" @@ -0,0 +1,97 @@ +DEFAULT_PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/games:/usr/games:/usr/sbin:/usr/local/sbin +LOCAL_PATHS=~/.local/bin:~/perl5/bin:~/.cargo/bin + +export PATH="$DEFAULT_PATH:$LOCAL_PATHS" +# For fun animations +PATH="~/perl5/bin${PATH:+:${PATH}}"; export PATH; +PERL5LIB="~/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; +PERL_LOCAL_LIB_ROOT="~/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; +PERL_MB_OPT="--install_base \"~/perl5\""; export PERL_MB_OPT; +PERL_MM_OPT="INSTALL_BASE=~/perl5"; export PERL_MM_OPT; + + +#### Most of this part is just default bashrc from debian #### + +# 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)" + +# 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 +PS1_SIG=$'\[\033[01;92m\]\u@\h\[\033[00m\]' +PS1_DIR=$'\[\033[01;94m\]\w\[\033[00m\]' +PS1_TIME=$'\[\033[01;97m\](\D{%F %T})\[\033[00m\]' +PS1_PROMPT=$'\$ ' +PS1="$PS1_SIG:$PS1_DIR $PS1_TIME\n$PS1_PROMPT" + + +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' + +# 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 + +#Import aliases +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +#### #### diff --git a/.bashrc.min b/.bashrc.min new file mode 100644 index 0000000..cabaf41 --- /dev/null +++ b/.bashrc.min @@ -0,0 +1,96 @@ +DEFAULT_PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/games:/usr/games:/usr/sbin:/usr/local/sbin +LOCAL_PATHS=~/.local/bin + +export PATH="$DEFAULT_PATH:$LOCAL_PATHS" + +#### Most of this part is just default bashrc from debian #### +# 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)" + +# 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 + + +if [ "$color_prompt" = yes ]; then + PS1_SIG=$'\[\033[01;92m\]\u@\h\[\033[00m\]' + PS1_DIR=$'\[\033[01;94m\]\w\[\033[00m\]' + PS1_TIME=$'\[\033[01;97m\](\D{%F %T})\[\033[00m\]' + PS1_PROMPT=$'\$ ' + PS1="$PS1_SIG:$PS1_DIR $PS1_TIME\n$PS1_PROMPT" +else + # Not sure if this ever activates but I trust in debian + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +#unset color_prompt force_color_prompt + +# 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' + +#Import aliases +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# 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 + + +#### Most of this part is just default bashrc from debian #### diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..73a533a --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,40 @@ +# Options +set -g mouse on # I know, I'm a monster +set -g default-shell $SHELL +# Start windows and panes at 1, not 0 +set -g base-index 1 +setw -g pane-base-index 1 +setw -g mode-keys vi +set-option -s set-clipboard off + +# Bindings +unbind-key C-b +set -g prefix M-w + + +bind-key % split-window -h -c "#{pane_current_path}" +bind-key '"' split-window -v -c "#{pane_current_path}" +bind-key C-v split-window -h -c "#{pane_current_path}" +bind-key C-h split-window -v -c "#{pane_current_path}" +bind-key C-n new-window -c "#{pane_current_path}" +# vim like pane swap +bind-key C-r swap-pane -D + + +unbind-key C +bind-key W command-prompt 'rename-window %%' +bind-key S command-prompt 'rename-session %%' +bind-key Q kill-server +bind-key K kill-session -a +bind-key C kill-window +# bind y run -b "tmux show-buffer | xclip -selection c > /dev/null" + +# https://www.rockyourcode.com/copy-and-paste-in-tmux/ +bind P paste-buffer +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -se c -i' +unbind -T copy-mode-vi Enter +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i' + + @@ -0,0 +1,147 @@ +" Pathogen runtime +execute pathogen#infect() +call pathogen#helptags() + +colorscheme desert +" URL: http://vim.wikia.com/wiki/Example_vimrc +" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode +set nocompatible +filetype indent plugin on +filetype plugin on +syntax on +set list +set number +set hidden +set wildmenu +set showcmd +set hlsearch +set smartcase +" Allow backspacing over autoindent, line breaks and start of insert action +set backspace=indent,eol,start +set smartindent +set nostartofline +" Display the cursor position on the last line of the screen or in the status +" line of a window +set ruler +set confirm +set visualbell +set mouse=a +"set cmdheight=2 +"set laststatus=2 +" Quickly time out on keycodes, but never time out on mappings +set notimeout ttimeout ttimeoutlen=200 +set spell + +"------------------------------------------------------------ +"----- CUSTOM MAPPINGS +" Map Y to act like D and C, i.e. to yank until EOL, rather than act as yy, +" which is the default +map Y y$ +" Map <C-L> (redraw screen) to also turn off search highlighting until the +" next search +nnoremap <C-L> :nohl<CR><C-L> + +" From https://github.com/theicfire/dotfiles/blob/master/vim/.vimrc +" With a map leader it's possible to do extra key combinations +" like <leader>w saves the current file +let mapleader = " " +" auto indent for brackets +inoremap {<CR> {<CR>}<Esc>O +" paste from outside buffer (i.e. outside of vim) +nnoremap <leader>p :set paste<CR>"+p:set nopaste<CR> +vnoremap <leader>p <Esc>:set paste<CR>gv"+p:set nopaste<CR> +" copy to outside buffer +vnoremap <leader>y "+y +" select all +nnoremap <leader>a ggVG +" paste from 0 register +" Useful because `d` overwrites the <quote> register +nnoremap <leader>P "0p +vnoremap <leader>P "0p + +" Easy quoting from: +" https://stackoverflow.com/questions/2147875/what-vim-commands-can-be-used-to-quote-unquote-words +:nnoremap <leader>qq ciW""<Esc>P +:nnoremap <leader>'' ciW''<Esc>P + +" remove scratch preview from autocomplete +set completeopt-=preview + + +" ------------------------------------------------------------ +" ----- PLUGIN SETTINGS + +let g:python3_host_prog = '/usr/bin/python3' +" Start NERDTree when Vim is started without file arguments. +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * + \ if (argc() == 0 && !exists('s:std_in') || isdirectory(argv(1)) ) | + \ NERDTree | + \ endif + +" https://techstructiveblog.hashnode.dev/vim-nerdtree +augroup DIRCHANGE + au! + autocmd DirChanged global :NERDTreeCWD +augroup END + +autocmd BufEnter NERD_tree_* | execute 'normal R' +au CursorHold * if exists("t:NerdTreeBufName") | call <SNR>15_refreshRoot() | endif + +let g:syntastic_shell = "/usr/bin/fish" +let g:syntastic_always_populate_loc_list = 0 +let g:syntastic_auto_loc_list = 0 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 +let g:syntastic_enable_signs = 1 +let g:syntastic_enable_highlighting = 1 +let g:syntastic_python_checkers = ['flake8'] + +" Best AirlineTheme +set t_Co=256 +let g:airline_theme = 'dark_minimal' +let g:airline_left_sep = '>' +let g:airline_detect_spell = 1 +let g:airline_powerline_fonts = 1 +let g:airline#extensions#nerdtree_statusline = 1 +let g:airline#extensions#syntastic#enabled = 1 +let g:airline#extensions#branch#enabled = 1 +let g:airline_section_z = airline#section#create(['%3v', 'linenr', 'maxlinenr']) + +"------------------------------------------------------------ +" ----- DEFAULT SPACING/INDENTATION OPTIONS +" Indent with spaces by default like a sane person +set shiftwidth=4 +set softtabstop=4 +set expandtab +set textwidth=72 + +" ------------------------------------------------------------ +" ----- FILE TYPE CONFIGS + +set fileformat=unix + +" Enable x86 custom highlight, turn off syntax crap +au BufNewFile,BufRead *.asm + \ set syntax=nasm | + \ let g:syntastic_check_on_open=0 | + \ let g:syntastic_enable_signs=0 | + \ let g:syntastic_enable_highlighting=0 + +" auto PEP8 for python +au BufNewFile,BufRead *.py + \ set tabstop=4 | + \ set softtabstop=4 | + \ set shiftwidth=4 | + +" 8 spaces for c, per Linus +au BufNewFile,BufRead *.c + \ set tabstop=8 | + \ set softtabstop=8 | + \ set shiftwidth=8 | + \ set cindent | + +" For the one absolute mad lad +au BufNewFile,BufRead Makefile + \set noexpandtab + diff --git a/.vimrc.min b/.vimrc.min new file mode 100644 index 0000000..b8aad21 --- /dev/null +++ b/.vimrc.min @@ -0,0 +1,97 @@ +set list +set spell +hi SpellBad ctermfg=000 guifg=#000000 + +let g:python3_host_prog = '/usr/bin/python3' +" URL: http://vim.wikia.com/wiki/Example_vimrc +set nocompatible +filetype indent plugin on +filetype plugin on +syntax on +set hidden +set wildmenu +set showcmd +set hlsearch +set ignorecase +set smartcase +set backspace=indent,eol,start +set autoindent +set nostartofline +set ruler +set laststatus=2 +set confirm +set visualbell +set mouse=a +set cmdheight=2 +set number +set notimeout ttimeout ttimeoutlen=200 +set pastetoggle=<F11> +"------------------------------------------------------------ +"----- CUSTOM MAPPINGS +map Y y$ +" Map <C-L> (redraw screen) to also turn off search highlighting until the +" next search +nnoremap <C-L> :nohl<CR><C-L> + +" From https://github.com/theicfire/dotfiles/blob/master/vim/.vimrc +" With a map leader it's possible to do extra key combinations +" like <leader>w saves the current file +let mapleader = " " +" auto indent for brackets +inoremap {<CR> {<CR>}<Esc>O +" shortcut for search without highlight +nnoremap <leader>sh :nohlsearch<Bar>:echo<CR> +" paste from outside buffer (i.e. outside of vim) +nnoremap <leader>p :set paste<CR>"+p:set nopaste<CR> +vnoremap <leader>p <Esc>:set paste<CR>gv"+p:set nopaste<CR> +" copy to outside buffer +vnoremap <leader>y "+y +" select all +nnoremap <leader>a ggVG +" paste from 0 register +" Useful because `d` overwrites the <quote> register +nnoremap <leader>P "0p +vnoremap <leader>P "0p + +" Easy quoting from: +" https://stackoverflow.com/questions/2147875/what-vim-commands-can-be-used-to-quote-unquote-words +nnoremap <leader>qq ciW""<Esc>P +nnoremap <leader>'' ciW''<Esc>P + +"------------------------------------------------------------ +" ----- DEFAULT SPACING/INDENTATION OPTIONS +" Indent with spaces by default like a sane person +set shiftwidth=4 +set softtabstop=4 +set expandtab + +" b/c it fits half screen nicely +set textwidth=72 + +" ------------------------------------------------------------ +" ----- FILE TYPE CONFIGS + +set fileformat=unix + +" Enable x86 custom highlight +au BufNewFile,BufRead *.asm + \ set syntax=nasm + +" auto PEP8 for python +au BufNewFile,BufRead *.py + \ set tabstop=4 | + \ set softtabstop=4 | + \ set shiftwidth=4 | + \ set smartindent | + +" 8 spaces for c, per Linus +au BufNewFile,BufRead *.c + \ set tabstop=8 | + \ set softtabstop=8 | + \ set shiftwidth=8 | + \ set cindent | + +" For the one absolute mad lad +au BufNewFile,BufRead Makefile + \set noexpandtab + diff --git a/README.md b/README.md new file mode 100644 index 0000000..0792935 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Config files that I'm constantly copying everywhere so I finally made a +git repo for. Files with ".min" are files to use with minimal setups +where you might not want to use certain plugins (or any). diff --git a/config.fish b/config.fish new file mode 100644 index 0000000..68af3a6 --- /dev/null +++ b/config.fish @@ -0,0 +1,77 @@ +### PROMPT + +set fish_prompt_pwd_dir_length 0 +function fish_prompt + set_color green + echo -n (whoami) + set_color normal + echo -n '@' + set_color red + echo -n (hostname) + set_color normal + echo -n ':' + set_color blue + echo (prompt_pwd) + set_color normal + echo "~> " +end + +function fish_greeting + ### cowsay 'hey, '(whoami)'...' | lolcat + echo -n "" +end + +### ENV +set -l DEFAULT_PATH "/bin:/usr/bin:/usr/local/bin:/usr/local/games:/usr/games:/usr/sbin:/usr/local/sbin" +set -l LOCAL_PATHS "~/.local/bin:~/perl5/bin:~/.cargo/bin" + +set -x PATH "$DEFAULT_PATH:$LOCAL_PATHS" +set -x TERM 'xterm' + +# For fun animations +set -x PERL_MB_OPT "--install_base \"~/perl5\"" +set -x PERL_MM_OPT "INSTALL_BASE=~/perl5" + +### FUNCTIONS +# easy dec to hex for fish +function hexcalc + echo "obase=16;$argv[1]" | bc +end + + +### ALIASES + +##Fun bullshit aliases +# quicker base64 decryption +alias based="base64 -d" +# color cat, pip install Pygments, if you dont have +alias ccat="pygmentize -g -O style=fruity" +# sources changes to bashrc faster +alias bashrc="source ~/.bashrc" +# sources changes to fishrc faster +alias fishrc="source ~/.config/fish/config.fish" + +# vim/gdb like quit +alias q="exit" +alias :q="exit" +##Necessary aliases +# pull input to clipboard +alias clip="xclip -selection c" +# some more ls aliases +alias ll="ls -lh" +alias la="ls -Ah" +alias lt="ls -Aulth" +alias lS="ls -AlSh" +alias l="ls" +# makes speaker-test less annoying +alias speaker-test="speaker-test -t wav -c 2 -l 1" +# tmux copy +alias tsb="tmux show-buffer" +alias y="tmux show-buffer | clip" + +##Python stuff +# virtual env aliases +alias venv="source env/bin/activate.fish" +alias newvenv="python -m venv env" +# pycharm because they made it weird +alias charm="/opt/pycharm-community-2020.3.3/bin/pycharm.sh" |