Skip to content

Commit

Permalink
Merge pull request #1 from nicholashoule/v1.0.x
Browse files Browse the repository at this point in the history
V1.0.x
  • Loading branch information
nicholashoule authored Oct 3, 2022
2 parents 7fd7f94 + 4fccbae commit 24964e1
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 92 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ curl -sSL https://get.rvm.io | bash -s stable --auto-dotfiles

[GitHub - VundleVim](https://github.com/VundleVim/Vundle.vim)

Launch vim and run `:PluginInstall`
```
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
```

To install from command line: `vim +PluginInstall +qall`

Launch vim and run `:PluginInstall`

##### Set up .oh-my-zsh

[GitHub - Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh)
Expand Down
40 changes: 20 additions & 20 deletions home/.aliases
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@

# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then
colorflag='--color=always' # GNU `ls`
colorflag='--color=always' # GNU ls
else
colorflag="-G" # OS X `ls`
colorflag="-G" # OS X ls
fi

# Vim aliases & helpers
alias vi='vim' # Ensure Vi IMproved
alias PluginInstall="vim +PluginInstall +qall" # Quick PluginInstall
alias PluginClean='vim +Pluginclean +qall' # Quick PluginClean
alias vi='vim' # Ensure Vi IMproved
alias PluginInstall="vim +PluginInstall +qall" # Quick PluginInstall
alias PluginClean='vim +Pluginclean +qall' # Quick PluginClean

# Canonical hex dump; some systems have this symlinked
command -v hd > /dev/null || alias hd="hexdump -C"
# macOS has no `md5sum`, so use `md5` as a fallback
# macOS has no md5sum, so use md5 as a fallback
command -v md5sum > /dev/null || alias md5sum="md5"
# macOS has no `sha1sum`, so use `shasum` as a fallback
# macOS has no sha1sum, so use shasum as a fallback
command -v sha1sum > /dev/null || alias sha1sum="shasum"

# General
alias sudo='sudo ' # Enable aliases to be sudo'ed
alias tree='tree -C' # Pretty color tree
alias path='echo -e ${PATH//:/\\n}' # Pretty path
alias sudo='sudo ' # Enable aliases to be sudo'ed
alias tree='tree -C' # Pretty color tree
alias path='echo -e ${PATH//:/\\n}' # Pretty path

# directory listings
alias ls="command ls -hF ${colorflag}" # Always use color output for `ls`
alias l="ls -lF ${colorflag}" # List all files colorized in long format
alias ls="command ls -hF ${colorflag}" # Always use color output for `ls`
alias l="ls -lF ${colorflag}" # List all files colorized in long format
alias l.="ls -d .* ${colorflag}"
alias ll="ls -aF ${colorflag}"
alias la="ls -laF ${colorflag}" # List all files colorized in long format, including dot files
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" # List only directories
alias la="ls -laF ${colorflag}" # List all files colorized in long format, including dot files
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" # List only directories
alias dir="ls ${colorflag}--format=vertical"
alias vdir="ls ${colorflag} --format=long"

Expand Down Expand Up @@ -68,19 +68,19 @@ done
alias urlencode='python3 -c "import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]));"'

# MacOS Helpers
# macOS Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
# Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
alias update='sudo softwareupdate -i -a && brew update && brew upgrade --all && brew cleanup && brew cask cleanup'

# macOS Delete `.DS_Store` files
# Delete `.DS_Store` files
alias cleanupds="find . -type f -name '*.DS_Store' -ls -delete"

# macOS System Logs to improve shell startup speed
# macOS Empty the Trash on all mounted volumes
# Remove system logs and empty the Trash on all mounted volumes
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"

# OSX Show/hide hidden files in Finder
# Show/hide hidden files in Finder
# To-do: Testing, this method might not be a solution with the latest OSX, or macOS updates
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"

# OSX Lock the screen (when going AFK)
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
4 changes: 3 additions & 1 deletion home/.git-template/hooks/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://pre-commit.com/hooks.html
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Expand All @@ -13,3 +13,5 @@ repos:
rev: 3.0.0
hooks:
- id: shellcheck
types: [shell]
args: [-e, SC1071, -e, SC2034]
1 change: 1 addition & 0 deletions home/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ set-option -g display-panes-time 800 # pane indicators display time
set-option -g display-time 1000 # status messages display time
set-option -g base-index 1 # Start window numbers at 1
set-option -g renumber-windows on # Renumber windows when one is closed
set-option -g focus-events on # focus events

# }}}
# VISUALS & CLOCK {{{
Expand Down
9 changes: 4 additions & 5 deletions home/.vimrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vundle requirements
" GitHub: https://github.com/VundleVim/Vundle.vim
set nocompatible " be iMproved, required
filetype off " required
set nocompatible " be iMproved, required
filetype off " required

" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
Expand All @@ -11,14 +11,13 @@ call vundle#begin()
Plugin 'VundleVim/Vundle.vim'

" GitHub plugins
Plugin 'godlygeek/tabular'
Plugin 'airblade/vim-gitgutter'
Plugin 'dense-analysis/ale'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
call vundle#end() " required
filetype plugin indent on " required

:so ~/.vimrc.settings
95 changes: 62 additions & 33 deletions home/.vimrc.settings
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
" Vim documentation: help
" https://vimdoc.sourceforge.net/htmldoc/
" https://vimdoc.sourceforge.net/htmldoc/fold.html
" [UTF-8 Miscellaneous Symbols](https://www.w3schools.com/charsets/ref_utf_symbols.asp)

" }}}
" FOLDING {{{
Expand Down Expand Up @@ -38,7 +39,7 @@ function! ToggleNumber()
endif
endfunction

" toggle between paste, and nopaste
" Toggle between paste, and nopaste
function! TogglePaste()
if(&paste == 1)
set nopaste nopaste?
Expand All @@ -59,6 +60,25 @@ function! Preserve(command)
call cursor(l, c)
endfunction

" GitStatus(), airblade/vim-gitgutter
function! GitStatus()
let [a,m,r] = GitGutterGetHunkSummary()
return printf('+%d ~%d -%d', a, m, r)
endfunction

" LinterStatus(), dense-analysis/ale
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors

return l:counts.total == 0 ? 'OK' : printf(
\ '%dW %dE',
\ all_non_errors,
\ all_errors
\)
endfunction

" }}}
" AUTOGROUPS {{{

Expand Down Expand Up @@ -113,66 +133,51 @@ set encoding=utf-8
"}}}
" PLUGIN OPTIONS {{{

" Plugin: airblade/vim-gitgutter options
let g:gitgutter_set_sign_backgrounds = 0
highlight link GitGutterChangeLine DiffText

" Plugin: dense-analysis/ale options
let g:ale_fix_on_save = 0
let g:ale_open_list = 0
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─']
let g:ale_echo_msg_format = '%severity% [%linter%] %s'
let g:ale_change_sign_column_color = 1
let g:ale_sign_column_always = 1
"let g:ale_sign_error = '●'
"let g:ale_sign_warning = '.'
let g:ale_echo_msg_format = '[%severity%] [%linter%] %s '
let g:ale_set_highlights = 0
let g:ale_change_sign_column_color = 0
let g:ale_sign_error = '🚩'
let g:ale_sign_warning = '🚧'
let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}}
let g:ale_linters = {
\ 'javascript': ['prettier', 'eslint'],
\ 'ruby': ['rubocop'],
\ 'go': ['golint'],
\}
let g:ale_linter_aliases = {
\ 'Dockerfile': 'dockerfile',
\ 'zsh': 'sh',
\ 'csh': 'sh',
\ 'ps1': 'powershell',
\ 'vimwiki': 'markdown',
\ 'xsd': ['xsd', 'xml'],
\ 'xslt': ['xslt', 'xml'],
\}
let g:ale_linters_ignore = {
\ 'typescript': ['tslint']
\}
let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}}
let g:ale_fixers = {'go': ['gofmt'], '*': ['prettier']}
let g:ale_fixers = {'javascript': ['eslint'], '*': ['prettier']}

" Plugin: vim-airline/vim-airline options
let g:airline_highlighting_cache = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'default'
let g:airline#extensions#ale#enabled = 1

" MOVED TO THEME OPTIONS SECTION
" Plugin: vim-airline/vim-airline-theme options
"let g:airline_theme='luna'
"set statusline+=%{LinterStatus()}
"set statusline+=%{GitStatus()}

"}}}
" THEME OPTIONS {{{

" Set colorscheme, overriden by plugins
"colorscheme solarized
let g:airline_theme='bubblegum'

" }}}
" {{{ INDENTATION, SPACES & TABS

" Indentation
set autoindent
set smartindent

" Tell VIM to honor two-spaces after a period
set cpo+=J

" Spaces and tabs
set tabstop=2
set expandtab
set shiftwidth=2
set softtabstop=2
let g:airline_theme='distinguished'

" }}}
" UI CONFIG {{{
Expand All @@ -192,6 +197,9 @@ set cursorline
" Number of lines that are checked for set commands
set modeline

" Vim 7.4.2201
set signcolumn=yes

" Highlight column 140
if exists('+colorcolumn')
set colorcolumn=80
Expand All @@ -212,6 +220,22 @@ set completeopt=longest,menu
" Set to allow you to backspace while back past insert mode
set backspace=2

" }}}
" {{{ INDENTATION, SPACES & TABS

" Indentation
set autoindent
set smartindent

" Tell VIM to honor two-spaces after a period
set cpo+=J

" Spaces and tabs
set tabstop=2
set expandtab
set shiftwidth=2
set softtabstop=2

" }}}
" SEARCHING {{{

Expand Down Expand Up @@ -266,14 +290,19 @@ nmap <silent> <Leader>p :call TogglePaste()<CR>
:command! W w
:command! Q q

" ale, navigate between errors quickly
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)

" }}}
" SESSIONS, BACKUPS & HISTORY {{{

" File changes
set autoread

" Mapping key press wait timeout
set timeout timeoutlen=1000
set timeout timeoutlen=50
set ttimeoutlen=50

" Hide buffers after they are abandoned
set hidden
Expand Down
Loading

0 comments on commit 24964e1

Please sign in to comment.