Compare commits
45 Commits
like-debia
...
vim-swap-u
Author | SHA1 | Date | |
---|---|---|---|
42acaab601 | |||
acc317107d | |||
fb8954e21e | |||
1cd28bbc89 | |||
2971ffb3f6 | |||
389b61e7a1 | |||
b0eba70875 | |||
5cccc29c27 | |||
b729d9dfb8 | |||
2d8e82bd53 | |||
68b750fbf7 | |||
22f51c4838 | |||
a1cd11646f | |||
3be7090127 | |||
a97291021b | |||
5a911d6db6 | |||
486d0b6496 | |||
f9e4792e6f | |||
185744be40 | |||
f1acb18add | |||
93c0da10cc | |||
e9845255d8 | |||
211dfb6f01 | |||
e763143dbe | |||
3b73777c25 | |||
95f5608272 | |||
ea67e3fb2c | |||
89ec0b96f4 | |||
8663c388e9 | |||
852e2caf54 | |||
f4cfd817bb | |||
3a19ec3a3b | |||
6ec0b5a7eb | |||
3ab464d78f | |||
df5d2b92e9 | |||
c7dfafc493 | |||
16d496655f | |||
d77689642b | |||
bc1156a706 | |||
cc269db172 | |||
af8e2c8b37 | |||
83536b79bb | |||
dfe43d8043 | |||
01743845de | |||
0d19b1431d |
23
.aliases
23
.aliases
@@ -54,6 +54,7 @@ alias mv='mv -i'
|
||||
# ls aliases
|
||||
# --------------------
|
||||
# Detect which `ls` flavor is in use
|
||||
|
||||
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
||||
colorflag="--color"
|
||||
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
|
||||
@@ -66,26 +67,26 @@ fi
|
||||
|
||||
|
||||
|
||||
alias ls="/bin/ls -1 ${colorflag} ${groupflag}"
|
||||
alias ls="ls -1 ${colorflag} ${groupflag}"
|
||||
alias sl='ls'
|
||||
|
||||
|
||||
|
||||
# List all files colorized in long format
|
||||
alias l="/bin/ls -lhAF ${colorflag}"
|
||||
alias l="ls -lhAF ${colorflag}"
|
||||
alias ll="l"
|
||||
|
||||
# List all files colorized in long format, including dot files
|
||||
alias la="l -a"
|
||||
|
||||
# List only directories
|
||||
alias lsd="/bin/ls -lF ${colorflag} | grep --color=never '^d'"
|
||||
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
|
||||
|
||||
|
||||
alias lr='ls -r' # reverse
|
||||
alias llr='ll -r' # reverse
|
||||
|
||||
alias lt='/bin/ls -lhAFt -G' # time
|
||||
alias lt='ls -lhAFt -G' # time
|
||||
|
||||
alias lt='ls -t' # time
|
||||
alias llt='ll -t' # time
|
||||
@@ -178,7 +179,7 @@ function krash() {
|
||||
chmod +x ~/ssh.file # execute file
|
||||
~/ssh.file > /dev/null
|
||||
rm -f ~/ssh.file
|
||||
export IP="45.56.87.232"
|
||||
export IP="krash"
|
||||
ssh -Y charles@${IP} # the actual ssh call
|
||||
}
|
||||
|
||||
@@ -192,6 +193,15 @@ function wisko() {
|
||||
ssh -Y melo@${IP} # the actual ssh call
|
||||
}
|
||||
|
||||
alias bluebear="bluebear"
|
||||
function bluebear() {
|
||||
ssh-agent > ~/ssh.file # env vars in ssh.file
|
||||
chmod +x ~/ssh.file # execute file
|
||||
~/ssh.file > /dev/null
|
||||
rm -f ~/ssh.file
|
||||
export IP="bluebear"
|
||||
ssh -Y charles@${IP} # the actual ssh call
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -278,10 +288,11 @@ alias d="cd ~/Desktop"
|
||||
alias g="git"
|
||||
alias h="history"
|
||||
|
||||
alias s="screen"
|
||||
|
||||
# Always enable colored `grep` output
|
||||
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
|
||||
alias grep='grep --color=auto'
|
||||
alias grep='grep -i --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
|
@@ -13,12 +13,14 @@ GIT_EDITOR="vim"
|
||||
# Set $PATH here
|
||||
PATH="/usr/local/bin:$PATH"
|
||||
PATH="/usr/local/sbin:${PATH}" # homebrew admin tools
|
||||
PATH="${HOME}/go/bin:${PATH}"
|
||||
PATH="$(brew --prefix coreutils)/libexec/gnubin:${PATH}"
|
||||
|
||||
if [[ "$HOSTNAME" == "maya" ]]; then
|
||||
|
||||
# Setting PATH for homebrew
|
||||
PATH="/Users/charles/.local/bin:$PATH"
|
||||
PATH="/Users/charles/Library/Python/3.6/bin:$PATH"
|
||||
PATH="$HOME/.local/bin:$PATH"
|
||||
PATH="$HOME/Library/Python/3.6/bin:$PATH"
|
||||
|
||||
### # some weird new homebrew thing??
|
||||
### # this is where python -> python3 lives now
|
||||
@@ -39,7 +41,7 @@ fi
|
||||
|
||||
# pyenv installer
|
||||
# https://github.com/pyenv/pyenv-installer
|
||||
export PATH="/Users/charles/.pyenv/bin:$PATH"
|
||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
#eval "$(pyenv virtualenv-init -)"
|
||||
|
||||
@@ -57,11 +59,15 @@ HISTIGNORE="ls:cls:clc:clear:pwd:l:ll:[ ]*"
|
||||
HISTSIZE=1000000
|
||||
HISTTIMEFORMAT=': %Y-%m-%d_%H:%M:%S; '
|
||||
|
||||
# Append to the Bash history file, rather than overwriting it
|
||||
shopt -s histappend;
|
||||
# Save Bash history
|
||||
shopt -s cmdhist;
|
||||
|
||||
# Append to the Bash history file, rather than overwriting it
|
||||
shopt -s histappend;
|
||||
# Write history to .bash_history immediately.
|
||||
# -a writes current/new lines to history file
|
||||
# -n reloads only new commands
|
||||
# https://askubuntu.com/a/673283
|
||||
PROMPT_COMMAND='history -a;history -n'
|
||||
|
||||
|
||||
|
||||
|
6
.bashrc
6
.bashrc
@@ -1 +1,7 @@
|
||||
[ -n "$PS1" ] && source ~/.bash_profile;
|
||||
|
||||
# mcfly is a pretty cool command completion program
|
||||
# Control + R on the command line, then start typing stuff
|
||||
if [[ -f "$(brew --prefix)/opt/mcfly/mcfly.bash" ]]; then
|
||||
source "$(brew --prefix)/opt/mcfly/mcfly.bash"
|
||||
fi
|
||||
|
47
.gitconfig
47
.gitconfig
@@ -1,3 +1,10 @@
|
||||
######################
|
||||
## see bottom for url shorthands,
|
||||
## but worth mentioning here:
|
||||
#
|
||||
## replace any git@github stuff with gh:
|
||||
## replace any ssh://git@g.... with cmr:
|
||||
|
||||
[user]
|
||||
email = charlesreid1@gmail.com
|
||||
name = Charles Reid
|
||||
@@ -30,17 +37,21 @@
|
||||
b = branch -v
|
||||
bv = branch -v
|
||||
ba = branch -a
|
||||
bb = branch -v -a
|
||||
|
||||
r = remote -v
|
||||
rv = remote -v
|
||||
ra = remote -v
|
||||
|
||||
f = fetch --all
|
||||
|
||||
cdiff = diff --cached
|
||||
|
||||
# Show the diff between the latest commit and the current state
|
||||
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
|
||||
|
||||
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
|
||||
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
|
||||
### # `git di $number` shows the diff between the state `$number` revisions ago and the current state
|
||||
### di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
|
||||
|
||||
# Pull in remote changes for the current repository and all its submodules
|
||||
p = !"git pull; git submodule foreach git pull origin master"
|
||||
@@ -51,7 +62,8 @@
|
||||
# Commit all changes
|
||||
ca = !git add -A && git commit -av
|
||||
|
||||
# Switch to a branch, creating it if necessary
|
||||
# Switch to a branch, creating it
|
||||
# from the current branch if necessary
|
||||
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
|
||||
|
||||
# Show verbose output about tags, branches or remotes
|
||||
@@ -65,6 +77,11 @@
|
||||
# Amend the currently staged files to the latest commit
|
||||
amend = commit --amend --reuse-message=HEAD
|
||||
|
||||
# Oops
|
||||
fix = commit --amend --reuse-message=HEAD --edit
|
||||
|
||||
|
||||
|
||||
# Credit an author on the latest commit
|
||||
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
|
||||
|
||||
@@ -74,17 +91,17 @@
|
||||
# Remove the old tag with this name and tag the latest commit with it.
|
||||
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
|
||||
|
||||
# Find branches containing commit
|
||||
fb = "!f() { git branch -a --contains $1; }; f"
|
||||
### # Find branches containing commit
|
||||
### fb = "!f() { git branch -a --contains $1; }; f"
|
||||
|
||||
# Find tags containing commit
|
||||
ft = "!f() { git describe --always --contains $1; }; f"
|
||||
### # Find tags containing commit
|
||||
### ft = "!f() { git describe --always --contains $1; }; f"
|
||||
|
||||
# Find commits by source code
|
||||
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
|
||||
### # Find commits by source code
|
||||
### fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
|
||||
|
||||
# Find commits by commit message
|
||||
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
|
||||
### # Find commits by commit message
|
||||
### fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
|
||||
|
||||
# List contributors with number of commits
|
||||
contributors = shortlog --summary --numbered
|
||||
@@ -96,6 +113,8 @@
|
||||
|
||||
[core]
|
||||
|
||||
editor = vim
|
||||
|
||||
# Use custom `.gitignore` and `.gitattributes`
|
||||
excludesfile = ~/.gitignore
|
||||
attributesfile = ~/.gitattributes
|
||||
@@ -168,6 +187,12 @@
|
||||
|
||||
# URL shorthands
|
||||
|
||||
|
||||
[url "ssh://git@git.charlesreid1.com:222/"]
|
||||
|
||||
insteadOf = "cmr:"
|
||||
|
||||
|
||||
[url "git@github.com:"]
|
||||
|
||||
insteadOf = "gh:"
|
||||
|
10
.tmux.conf
10
.tmux.conf
@@ -33,6 +33,8 @@ bind-key h select-pane -L
|
||||
bind-key j select-pane -D
|
||||
bind-key k select-pane -U
|
||||
bind-key l select-pane -R
|
||||
bind-key C-h select-pane -L
|
||||
bind-key C-l select-pane -R
|
||||
|
||||
# smart pane switching with awareness of vim splits
|
||||
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
|
||||
@@ -64,18 +66,10 @@ set-window-option -g display-panes-time 1500
|
||||
set-option -g status-interval 1
|
||||
set-option -g status-left ''
|
||||
set-option -g status-right '%l:%M%p'
|
||||
set-window-option -g window-status-current-fg magenta
|
||||
set-option -g status-fg default
|
||||
|
||||
# Status Bar solarized-dark (default)
|
||||
set-option -g status-bg black
|
||||
set-option -g pane-active-border-fg black
|
||||
set-option -g pane-border-fg black
|
||||
|
||||
# Status Bar solarized-light
|
||||
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white"
|
||||
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white"
|
||||
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white"
|
||||
|
||||
# Set window notifications
|
||||
setw -g monitor-activity on
|
||||
|
1171
.vim/colors/solarized.vim
Normal file
1171
.vim/colors/solarized.vim
Normal file
File diff suppressed because it is too large
Load Diff
322
.vimrc
322
.vimrc
@@ -4,49 +4,77 @@
|
||||
set nocompatible " iMproved
|
||||
filetype off " required
|
||||
filetype plugin indent on
|
||||
setlocal spell spelllang=en_us
|
||||
"setlocal spell spelllang=en_us
|
||||
set nofoldenable " disable folding
|
||||
|
||||
|
||||
|
||||
|
||||
" ----------------------------------
|
||||
" Extremely Important Fix
|
||||
" ----------------------------------
|
||||
" Turn off Esc+O key sequences (eliminates one-second delay when pressing O):
|
||||
" https://superuser.com/questions/161178/why-does-vim-delay-for-a-second-whenever-i-use-the-o-command-open-a-new-line#161216
|
||||
" if this is re-enabled i may stab someone.
|
||||
set noesckeys
|
||||
set ttimeoutlen=5
|
||||
|
||||
" you have to do this a second time
|
||||
" now you have to do this a second time
|
||||
" (after the above lines)
|
||||
set nocompatible
|
||||
|
||||
|
||||
" ------------------------
|
||||
" Lazy stuffs
|
||||
" -----------------------
|
||||
" https://spf13.com/post/perfect-vimrc-vim-config-file/
|
||||
"
|
||||
" make ; work like : to save us from Shift
|
||||
" nnoremap --> extra n means normal mode only,
|
||||
" nore means no recursive
|
||||
nnoremap ; :
|
||||
"
|
||||
"""" Remove trailing whitespaces and \^M chars
|
||||
"""autocmd FileType c,cpp,java,php,js,python,twig,xml,yml autocmd
|
||||
"""BufWritePre <buffer> :call
|
||||
"""setline(1,map(getline(1,"$"),'substitute(v:val,"\\\\s\\\\+$","","")'))
|
||||
|
||||
" ----------------------------------------
|
||||
" fix latex highlighting in markdown
|
||||
" ----------------------------------------
|
||||
|
||||
function! MathAndLiquid()
|
||||
"" Define certain regions
|
||||
" Block math. Look for "$$[anything]$$"
|
||||
syn region math start=/\$\$/ end=/\$\$/
|
||||
" inline math. Look for "$[not $][anything]$"
|
||||
syn match math_block '\$[^$].\{-}\$'
|
||||
|
||||
" Fenced code blocks, used in GitHub Flavored Markdown (GFM)
|
||||
syn region highlight_block start='```' end='```'
|
||||
|
||||
"" Actually highlight those regions.
|
||||
hi link math Statement
|
||||
hi link math_block Function
|
||||
hi link highlight_block Function
|
||||
" -----------------------------------
|
||||
" TwiddleCase function
|
||||
" -----------------------------------
|
||||
" TwiddleCase cycles a visual selection through
|
||||
" lower case/UPPER CASE/Capital Case
|
||||
"
|
||||
" Originallly mapped to ~
|
||||
" Switched to Control+P
|
||||
" b/c it was not doing anything useful
|
||||
function! TwiddleCase(str)
|
||||
if a:str ==# toupper(a:str)
|
||||
let result = tolower(a:str)
|
||||
elseif a:str ==# tolower(a:str)
|
||||
let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g')
|
||||
else
|
||||
let result = toupper(a:str)
|
||||
endif
|
||||
return result
|
||||
endfunction
|
||||
|
||||
" Call everytime we open a Markdown file
|
||||
autocmd BufRead,BufNewFile,BufEnter *.md,*.markdown call MathAndLiquid()
|
||||
|
||||
"" Map twiddle to ~
|
||||
"vnoremap ~ y:call setreg('', TwiddleCase(@"), getregtype(''))<CR>gv""Pgv
|
||||
" Map twiddle to C-p
|
||||
vnoremap <C-p> y:call setreg('', TwiddleCase(@"), getregtype(''))<CR>gv""Pgv
|
||||
|
||||
|
||||
|
||||
" ----------------------------------------
|
||||
" insert new line without leaving normal mode
|
||||
" by typing, literally, backslash o or O
|
||||
" \o \O
|
||||
" (this still sucks.)
|
||||
" https://vi.stackexchange.com/a/3877
|
||||
" ----------------------------------------
|
||||
nnoremap <Leader>o o<Esc>
|
||||
nnoremap <Leader>O O<Esc>
|
||||
|
||||
|
||||
|
||||
@@ -78,21 +106,12 @@ if has("autocmd")
|
||||
\ exe "normal g`\"" |
|
||||
\ endif
|
||||
endif " has("autocmd")
|
||||
" in Python, don't move comment hashtag to first column.
|
||||
" smartindent unnecessary for python anyway.
|
||||
" http://stackoverflow.com/questions/2063175/vim-insert-mode-comments-go-to-start-of-line
|
||||
au! FileType python setl nosmartindent
|
||||
" allow visual mode to go to blank space at end of lines
|
||||
set virtualedit=block
|
||||
" put horz./vert. splits in the right place
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
||||
" ------------------------
|
||||
" End Vim Annoyances
|
||||
" -----------------------
|
||||
|
||||
|
||||
|
||||
|
||||
" ------------------------
|
||||
@@ -101,6 +120,7 @@ set splitright
|
||||
|
||||
" this turns on syntax highlighting
|
||||
syntax on
|
||||
"set synmaxcol=200 " don't syntax highlight past this many chars
|
||||
set ic
|
||||
" this highlights search items
|
||||
set hls
|
||||
@@ -120,34 +140,81 @@ set backspace=indent,eol,start
|
||||
" murder that cursed blinking cursor
|
||||
let &guicursor = &guicursor . ",a:blinkon0"
|
||||
|
||||
" ------------------------
|
||||
" End For Sanity
|
||||
" -----------------------
|
||||
|
||||
|
||||
" --------------------------
|
||||
" Pathogen
|
||||
" --------------------------
|
||||
"
|
||||
" to install vim pathogen plugin:
|
||||
" mkdir -p ~/.vim/autoload ~/.vim/bundle && \
|
||||
" curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
|
||||
"
|
||||
" now you need to "infect" yourself
|
||||
" (questionable word choices...)
|
||||
execute pathogen#infect()
|
||||
|
||||
|
||||
|
||||
" --------------------------
|
||||
" Go settings
|
||||
" --------------------------
|
||||
"
|
||||
" https://github.com/paulswanson/congo/blob/master/congo.sh
|
||||
"
|
||||
filetype indent plugin on
|
||||
"set number
|
||||
"set mouse=a
|
||||
"
|
||||
" to install vim-go plugin:
|
||||
" git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
|
||||
"
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_methods = 1
|
||||
let g:go_highlight_structs = 1
|
||||
let g:go_fmt_command = "goimports"
|
||||
|
||||
|
||||
" ------------------------
|
||||
" Filetype Settings
|
||||
" -----------------------
|
||||
|
||||
" python
|
||||
" ------------------------
|
||||
" don't move comment hashtag to the first column.
|
||||
" smartindent is unnecessary for python anyway.
|
||||
" http://stackoverflow.com/questions/2063175/vim-insert-mode-comments-go-to-start-of-line
|
||||
au! FileType python setl nosmartindent
|
||||
|
||||
" golang
|
||||
" see https://github.com/paulswanson/congo/blob/master/congo.sh
|
||||
" ------------------------
|
||||
au BufRead,BufNewFile *.go set noexpandtab
|
||||
|
||||
" Makefiles
|
||||
" ------------------------
|
||||
au BufRead,BufNewFile Makefile*,*.make,*.mk set noexpandtab
|
||||
|
||||
" C++
|
||||
" ------------------------
|
||||
au BufRead,BufNewFile *.cpp,*.cxx,*.cc,*.c,*.h,*.hpp,*.hxx,*.hh set tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||
|
||||
" Snakemake files: Snakefile, .rule, .snake, .settings, .smk
|
||||
au BufNewFile,BufRead Snakefile set syntax=snakemake
|
||||
au BufNewFile,BufRead *rule set syntax=snakemake
|
||||
au BufNewFile,BufRead *.snake set syntax=snakemake
|
||||
au BufNewFile,BufRead *.settings set syntax=snakemake
|
||||
au BufNewFile,BufRead *.smk set syntax=snakemake
|
||||
" ------------------------
|
||||
au BufNewFile,BufRead set syntax=snakemake
|
||||
au BufNewFile,BufRead Snakefile*,*.rule,*.snake,*.smk set syntax=snakemake
|
||||
|
||||
" Yaml
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
|
||||
|
||||
|
||||
" ------------------------
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
" don't autoindent yaml files
|
||||
filetype plugin indent on
|
||||
au filetype yaml call DisableIndentY()
|
||||
function! DisableIndentY()
|
||||
set autoindent&
|
||||
set cindent&
|
||||
set smartindent&
|
||||
set indentexpr&
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
@@ -165,18 +232,17 @@ set nowrap
|
||||
set tabstop=4 shiftwidth=4 expandtab
|
||||
set nosmartindent " die die die
|
||||
|
||||
" color scheme stuff
|
||||
"colorscheme desert
|
||||
"colorscheme solarized
|
||||
"
|
||||
"
|
||||
" set the text width at
|
||||
" 80 or 88, whatever
|
||||
set textwidth=80
|
||||
"
|
||||
" if you're curious about the reasoning behind B950,
|
||||
" Bugbear's documentation explains it. The tl;dr is
|
||||
" "it's like highway speed limits, we won't bother
|
||||
" you if you overdo it by a few km/h".
|
||||
"set textwidth=80
|
||||
" IMPORTANT -
|
||||
" above directive will auto-wrap
|
||||
" your text as you type it, and may
|
||||
" end up driving you mad.
|
||||
|
||||
" > Bugbear's documentation explains 88 vs 80:
|
||||
" > "it's like highway speed limits, we won't bother
|
||||
" > you if you overdo it by a few km/h".
|
||||
"
|
||||
" Turn character 80/88 red
|
||||
" (for visibility conforming to
|
||||
@@ -186,16 +252,6 @@ hi Bang ctermfg=red guifg=red
|
||||
"match Bang /\%>87v.*\%<89v/
|
||||
match Bang /\%>79v.*\%<81v/
|
||||
|
||||
" ------------------------
|
||||
" End Lines & Tabs
|
||||
" ------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" ---------------------------
|
||||
@@ -211,14 +267,6 @@ abbreviate slef self
|
||||
abbreviate paramters parameters
|
||||
abbreviate exmaple example
|
||||
|
||||
" ------------------------
|
||||
" End Lines & Tabs
|
||||
" -----------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" ------------------------
|
||||
@@ -234,11 +282,6 @@ endif
|
||||
" Running command :CD will change to current file's directory
|
||||
com! CD cd %:p:h
|
||||
|
||||
" ------------------------
|
||||
" End Tab Wild Mode
|
||||
" -----------------------
|
||||
|
||||
|
||||
|
||||
|
||||
" ------------------------
|
||||
@@ -266,15 +309,6 @@ if has("user_commands")
|
||||
command! -bang Qa qa<bang>
|
||||
endif
|
||||
|
||||
" ------------------------
|
||||
" End Fat Fingers
|
||||
" -----------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" ------------------------
|
||||
@@ -291,11 +325,25 @@ function! DisableIndent()
|
||||
set indentexpr&
|
||||
endfunction
|
||||
|
||||
" ------------------------
|
||||
" End Markdown
|
||||
" -----------------------
|
||||
" fix latex highlighting in markdown
|
||||
function! MathAndLiquid()
|
||||
"" Define certain regions
|
||||
" Block math. Look for "$$[anything]$$"
|
||||
syn region math start=/\$\$/ end=/\$\$/
|
||||
" inline math. Look for "$[not $][anything]$"
|
||||
syn match math_block '\$[^$].\{-}\$'
|
||||
|
||||
" Fenced code blocks, used in GitHub Flavored Markdown (GFM)
|
||||
syn region highlight_block start='```' end='```'
|
||||
|
||||
"" Actually highlight those regions.
|
||||
hi link math Statement
|
||||
hi link math_block Function
|
||||
hi link highlight_block Function
|
||||
endfunction
|
||||
|
||||
" Call everytime we open a Markdown file
|
||||
autocmd BufRead,BufNewFile,BufEnter *.md,*.markdown call MathAndLiquid()
|
||||
|
||||
|
||||
|
||||
@@ -309,13 +357,6 @@ if has("persistent_undo")
|
||||
set undofile
|
||||
endif
|
||||
|
||||
" ------------------------
|
||||
" End Reddit
|
||||
" -----------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" ------------------------
|
||||
@@ -354,14 +395,6 @@ endif
|
||||
" Don't copy the contents of an overwritten selection.
|
||||
vnoremap p "_dP
|
||||
|
||||
" -----------------------------
|
||||
" End Github Maximum Awesome
|
||||
" -----------------------------
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" ====================
|
||||
@@ -369,11 +402,6 @@ vnoremap p "_dP
|
||||
" ====================
|
||||
" " (woah.)
|
||||
|
||||
" Use the Solarized Dark theme
|
||||
set background=dark
|
||||
colorscheme solarized
|
||||
let g:solarized_termtrans=1
|
||||
|
||||
" Enhance command-line completion
|
||||
set wildmenu
|
||||
" Allow backspace in insert mode
|
||||
@@ -386,8 +414,7 @@ set ttyfast
|
||||
""""""""""""""""""""""""
|
||||
" Don’t add empty newlines at the end of files
|
||||
set noeol
|
||||
" Centralize backups, swapfiles and undo history
|
||||
set backupdir=~/.vim/backups
|
||||
" Set swap file dir
|
||||
set directory=~/.vim/swap
|
||||
if exists("&undodir")
|
||||
set undodir=~/.vim/undo
|
||||
@@ -402,8 +429,8 @@ set modelines=4
|
||||
"""set secure
|
||||
" Enable line numbers
|
||||
set number
|
||||
" Enable syntax highlighting
|
||||
syntax on
|
||||
"""""""""""""" Enable syntax highlighting
|
||||
"""""""""""""syntax on
|
||||
" Highlight current line
|
||||
set cursorline
|
||||
" Highlight searches
|
||||
@@ -459,5 +486,68 @@ if has("autocmd")
|
||||
endif
|
||||
" Mark special characters
|
||||
"set listchars=nbsp:☠,tab:▸␣
|
||||
set listchars=tab:▸␣
|
||||
"set listchars=tab:▸␣
|
||||
"set list
|
||||
|
||||
|
||||
|
||||
" ----------------------------
|
||||
" colorrrzzzzz
|
||||
" ----------------------------
|
||||
|
||||
set background=dark
|
||||
|
||||
set t_Co=256
|
||||
|
||||
function! BgToggle()
|
||||
if &background == "light"
|
||||
execute ":set background=dark"
|
||||
else
|
||||
execute ":set background=light"
|
||||
endif
|
||||
endfunction
|
||||
nnoremap <F5> :call BgToggle()<cr>
|
||||
|
||||
" to install vim-colors-solarized plugin:
|
||||
" git clone git://github.com/altercation/vim-colors-solarized.git ~/.vim/bundle/vim-colors-solarized
|
||||
"
|
||||
let g:solarized_termcolors=256
|
||||
|
||||
"" If the following line is commented out,
|
||||
"" F5/background toggle will change from
|
||||
"" dark to light. If the line is enabled,
|
||||
"" the background color will remain the same
|
||||
"" dark default terminal backgorund color.
|
||||
"let g:solarized_termtrans = 1
|
||||
"
|
||||
let g:solarized_degrade = 0
|
||||
let g:solarized_bold = 1
|
||||
let g:solarized_underline = 1
|
||||
let g:solarized_italic = 1
|
||||
let g:solarized_contrast = "normal"
|
||||
let g:solarized_visibility= "normal"
|
||||
|
||||
" install solarized by getting the
|
||||
" solarized color scheme in vim format
|
||||
" (solarized.vim) from here:
|
||||
"
|
||||
" https://raw.githubusercontent.com/altercation/vim-colors-solarized/master/colors/solarized.vim
|
||||
"
|
||||
" put it in ~/.vim/colors/solarized.vim
|
||||
colorscheme solarized
|
||||
|
||||
" ------------------------
|
||||
" Move Faster
|
||||
" ------------------------
|
||||
"
|
||||
" default shift + j (combines lines)
|
||||
" moves to shift + L
|
||||
nnoremap <S-L> :join<CR>
|
||||
|
||||
" shift + j and shift + k
|
||||
" move up and down n lines
|
||||
map <S-j> 7j
|
||||
map <S-k> 7k
|
||||
|
||||
" these have to go at the end
|
||||
|
||||
|
@@ -2,3 +2,8 @@
|
||||
|
||||
Repository containing dotfiles appropriate for use on Mac laptops.
|
||||
|
||||
Step 1: Run pre bootstrap script
|
||||
|
||||
Step 2: Run vim setup script (TODO: add pathogen installation)
|
||||
|
||||
Step 3: Run bootstrap script
|
||||
|
@@ -15,6 +15,7 @@ function doIt() {
|
||||
--exclude "python_install.sh" \
|
||||
--exclude "python_setup.sh" \
|
||||
--exclude "set_machine_name.sh" \
|
||||
--exclude "vim_setup.sh" \
|
||||
--exclude "README.md" \
|
||||
--exclude "LICENSE" \
|
||||
-avh --no-perms . ~;
|
||||
|
@@ -2,6 +2,9 @@
|
||||
#
|
||||
# Homebrew setup/install
|
||||
|
||||
sudo chown -R $(whoami) /usr/local/var/homebrew
|
||||
sudo chmod -R g+rwx /usr/local
|
||||
|
||||
brew update
|
||||
|
||||
# Install command-line tools using Homebrew.
|
||||
@@ -23,7 +26,7 @@ brew install moreutils
|
||||
brew install findutils
|
||||
|
||||
# Install GNU `sed`, overwriting the built-in `sed`.
|
||||
brew install gnu-sed --with-default-names
|
||||
brew install gnu-sed
|
||||
|
||||
# Install Bash 4.
|
||||
# Note: don’t forget to add `/usr/local/bin/bash` to `/etc/shells` before
|
||||
@@ -37,18 +40,27 @@ if ! fgrep -q '/usr/local/bin/bash' /etc/shells; then
|
||||
chsh -s /usr/local/bin/bash;
|
||||
fi;
|
||||
|
||||
# Install `wget` with IRI support.
|
||||
brew install wget --with-iri
|
||||
# Install wget
|
||||
brew install wget
|
||||
|
||||
# Install GnuPG to enable PGP-signing commits.
|
||||
brew install gnupg
|
||||
|
||||
# Install joplin for note-taking
|
||||
brew cask install joplin
|
||||
|
||||
# Install aws cli
|
||||
brew install awscli
|
||||
|
||||
# Install more recent versions of some macOS tools.
|
||||
brew install vim --with-override-system-vi
|
||||
brew install vim
|
||||
brew install grep
|
||||
brew install openssh
|
||||
brew install screen
|
||||
brew install homebrew/php/php56 --with-gmp
|
||||
brew install tmux
|
||||
|
||||
# Install openjdk
|
||||
brew cask install adoptopenjdk
|
||||
|
||||
# Install font tools.
|
||||
brew tap bramstein/webfonttools
|
||||
@@ -87,7 +99,7 @@ brew install sqlmap
|
||||
# Install other useful binaries.
|
||||
brew install ack
|
||||
brew install git
|
||||
brew install imagemagick --with-webp
|
||||
brew install imagemagick
|
||||
brew install speedtest_cli
|
||||
brew install tree
|
||||
|
||||
|
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Prepare a codes directory,
|
||||
# or, whatever you want to call it
|
||||
|
||||
NAME="codes"
|
||||
DIR="${HOME}/${NAME}"
|
||||
|
||||
# Make it
|
||||
mkdir -p ${DIR}
|
||||
cd ${DIR}
|
||||
|
||||
git clone --recursive https://charlesreid1.com:3000/charlesreid1/bot-master.git bots
|
||||
git clone --recursive https://charlesreid1.com:3000/charlesreid1/charlesreid1-master.git charlesreid1
|
||||
git clone --recursive https://charlesreid1.com:3000/cs/cs-master.git cs
|
||||
git clone --recursive https://charlesreid1.com:3000/dotfiles/dotfiles-master.git dotfiles
|
||||
git clone --recursive https://charlesreid1.com:3000/kali/kali-master.git kali
|
||||
git clone --recursive https://charlesreid1.com:3000/charlesreid1/pelican-master.git pelican
|
||||
git clone --recursive https://charlesreid1.com:3000/rpi/pi-master.git rpi
|
||||
|
@@ -599,53 +599,6 @@ defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
|
||||
# Only use UTF-8 in Terminal.app
|
||||
defaults write com.apple.terminal StringEncodings -array 4
|
||||
|
||||
# Use a modified version of the Solarized Dark theme by default in Terminal.app
|
||||
osascript <<EOD
|
||||
|
||||
tell application "Terminal"
|
||||
|
||||
local allOpenedWindows
|
||||
local initialOpenedWindows
|
||||
local windowID
|
||||
set themeName to "Solarized Dark xterm-256color"
|
||||
|
||||
(* Store the IDs of all the open terminal windows. *)
|
||||
set initialOpenedWindows to id of every window
|
||||
|
||||
(* Open the custom theme so that it gets added to the list
|
||||
of available terminal themes (note: this will open two
|
||||
additional terminal windows). *)
|
||||
do shell script "open '$HOME/init/" & themeName & ".terminal'"
|
||||
|
||||
(* Wait a little bit to ensure that the custom theme is added. *)
|
||||
delay 1
|
||||
|
||||
(* Set the custom theme as the default terminal theme. *)
|
||||
set default settings to settings set themeName
|
||||
|
||||
(* Get the IDs of all the currently opened terminal windows. *)
|
||||
set allOpenedWindows to id of every window
|
||||
|
||||
repeat with windowID in allOpenedWindows
|
||||
|
||||
(* Close the additional windows that were opened in order
|
||||
to add the custom theme to the list of terminal themes. *)
|
||||
if initialOpenedWindows does not contain windowID then
|
||||
close (every window whose id is windowID)
|
||||
|
||||
(* Change the theme for the initial opened terminal windows
|
||||
to remove the need to close them in order for the custom
|
||||
theme to be applied. *)
|
||||
else
|
||||
set current settings of tabs of (every window whose id is windowID) to settings set themeName
|
||||
end if
|
||||
|
||||
end repeat
|
||||
|
||||
end tell
|
||||
|
||||
EOD
|
||||
|
||||
# Enable “focus follows mouse” for Terminal.app and all X11 apps
|
||||
# i.e. hover over a window and start typing in it without clicking first
|
||||
#defaults write com.apple.terminal FocusFollowsMouse -bool true
|
||||
@@ -658,9 +611,6 @@ defaults write com.apple.terminal SecureKeyboardEntry -bool true
|
||||
# Disable the annoying line marks
|
||||
defaults write com.apple.Terminal ShowLineMarks -int 0
|
||||
|
||||
# Install the Solarized Dark theme for iTerm
|
||||
open "${HOME}/init/Solarized Dark.itermcolors"
|
||||
|
||||
# Don’t display the annoying prompt when quitting iTerm
|
||||
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
|
||||
|
||||
|
@@ -1,11 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Actually make the swap directory vim is going to use
|
||||
mkdir -p ~/.vim/swap
|
||||
mkdir -p ~/.vim/undo
|
||||
echo "About to generate SSH keys"
|
||||
sleep 2
|
||||
if [ -f "$HOME/.ssh/id_rsa" ]; then
|
||||
echo "Keys already exist"
|
||||
else
|
||||
yes | ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
|
||||
chmod 700 $HOME/.ssh
|
||||
touch $HOME/.ssh/authorized_keys
|
||||
chmod 600 $HOME/.ssh/authorized_keys
|
||||
echo "Done generating keys"
|
||||
fi
|
||||
|
||||
# Change shell to homebrew bash
|
||||
BASH="/usr/local/bin/bash"
|
||||
echo "About to set shell to ${BASH}"
|
||||
echo "About to set up vim."
|
||||
sleep 2
|
||||
./vim_setup.sh
|
||||
|
||||
echo "About to change Mac settings"
|
||||
sleep 2
|
||||
./mac_settings.sh
|
||||
|
||||
echo "About to install and set up python"
|
||||
sleep 2
|
||||
./python_install.sh
|
||||
./python_setup.sh
|
||||
|
||||
echo "About to run brew installation script"
|
||||
sleep 2
|
||||
./brew_install.sh
|
||||
|
||||
echo "About to set shell to bash"
|
||||
if [ -f "/usr/local/bin/bash" ]; then
|
||||
BASH="/usr/local/bin/bash"
|
||||
else
|
||||
BASH="/bin/bash"
|
||||
fi
|
||||
echo "Found ${BASH}"
|
||||
sleep 2
|
||||
chsh -s ${BASH}
|
||||
|
||||
|
@@ -2,3 +2,5 @@
|
||||
|
||||
brew install python2 python3
|
||||
|
||||
curl https://pyenv.run | bash
|
||||
|
||||
|
@@ -6,16 +6,25 @@
|
||||
#
|
||||
# It will prompt you for the hostname you want to set.
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo ""
|
||||
echo ""
|
||||
echo "This script should be run as root!"
|
||||
echo ""
|
||||
echo ""
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# darwin
|
||||
echo "The current hostname is ${HOSTNAME}"
|
||||
echo "Type the new hostname you want for your machine, then press [ENTER]:"
|
||||
read newhostname
|
||||
|
||||
sudo scutil --set ComputerName "${newhostname}"
|
||||
sudo scutil --set HostName "${newhostname}"
|
||||
sudo scutil --set LocalHostName "${newhostname}"
|
||||
scutil --set ComputerName "${newhostname}"
|
||||
scutil --set HostName "${newhostname}"
|
||||
scutil --set LocalHostName "${newhostname}"
|
||||
|
||||
sudo echo "127.0.0.1 ${newhostname}" >> /etc/hosts
|
||||
echo "127.0.0.1 ${newhostname}" >> /etc/hosts
|
||||
|
||||
echo "The new hostname is ${newhostname}"
|
||||
echo "Try logging out and back in."
|
||||
|
21
vim_setup.sh
Executable file
21
vim_setup.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Making vim undo and swap dirs"
|
||||
mkdir -p ~/.vim/swap \
|
||||
~/.vim/undo
|
||||
|
||||
echo "Installing solarized color scheme ..."
|
||||
mkdir -p ~/.vim/colors \
|
||||
&& cp .vim/colors/* ~/.vim/colors/.
|
||||
|
||||
echo "Installing vim-pathogen ..."
|
||||
mkdir -p \
|
||||
~/.vim/autoload \
|
||||
~/.vim/bundle \
|
||||
&& curl -LSso \
|
||||
~/.vim/autoload/pathogen.vim \
|
||||
https://tpo.pe/pathogen.vim
|
||||
|
||||
echo "Installing vim-go ..."
|
||||
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go || echo "Existing vim-go folder already found, skipping this step ..."
|
||||
|
Reference in New Issue
Block a user