Compare commits
No commits in common. "63999efd2d7a5bfa66fffcdf68a8034f6539a68d" and "16a5456fd7ba854f79d1938451381ac2ca438a76" have entirely different histories.
63999efd2d
...
16a5456fd7
|
|
@ -12,8 +12,8 @@ RUN pacman -Sy --noconfirm openssh sudo vim git curl which gnupg make gcc binuti
|
||||||
WORKDIR /home/files
|
WORKDIR /home/files
|
||||||
COPY --chown=1000:1000 . /home/files/.files
|
COPY --chown=1000:1000 . /home/files/.files
|
||||||
USER 1000
|
USER 1000
|
||||||
RUN rm -rf .bash_rc .bash_logout .zshrc .profile .zlogin .zshrc .bashrc mkshrc \
|
RUN rm -rf .bash_rc .bash_logout .zshrc .profile .zlogin .zshrc .bashrc mkshrc
|
||||||
&& cat /home/files/.files/install_script.sh > /home/files/.bash_profile \
|
RUN echo "[[ -f '/home/files/.files/sourceme.sh' ]] && source /home/files/.files/sourceme.sh" > /home/files/.bash_profile
|
||||||
&& source /home/files/.bash_profile
|
RUN source /home/files/.files/sourceme.sh
|
||||||
|
|
||||||
CMD ["bash", "--login"]
|
CMD ["bash", "--login"]
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
export FILES_ROOT="${HOME}/.files";
|
export FILES_ROOT="${HOME}/.files";
|
||||||
|
|
||||||
# Set plugins to load here. Run files_plugins_list to see available plugins.
|
# Set plugins to load here. Run files_plugins_list to see available plugins.
|
||||||
export FILES_PLUGINS=("asdf" "ssh" "vim" "git-extras" "kubectl" "helm" "starship" "extras");
|
export FILES_PLUGINS=("brew" "ssh" "vim" "git-extras" "asdf" "helm" "starship" "extras");
|
||||||
|
|
||||||
[[ -s "${HOME}/.files/sourceme.sh" ]] && source ${HOME}/.files/sourceme.sh;
|
[[ -s "${HOME}/.files/sourceme.sh" ]] && source ${HOME}/.files/sourceme.sh;
|
||||||
|
|
||||||
starship_run bash
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,28 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
# Find where asdf should be installed
|
# Find where asdf should be installed
|
||||||
ASDF_VERSION="${ASDF_VERSION:-"0.8.1"}";
|
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
|
||||||
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}";
|
ASDF_COMPLETIONS="$ASDF_DIR/completions"
|
||||||
ASDF_COMPLETIONS="$ASDF_DIR/completions";
|
|
||||||
|
|
||||||
|
# If not found, check for Homebrew package
|
||||||
if [[ ! -f "$ASDF_DIR/asdf.sh" ]]; then
|
if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && [[ -f $(which brew 2>&1) ]]; then
|
||||||
echo "[asdf] Installing asdf to ${ASDF_DIR}...";
|
ASDF_DIR="$(brew --prefix asdf)"
|
||||||
git clone https://github.com/asdf-vm/asdf.git ${HOME}/.asdf --branch v${ASDF_VERSION};
|
ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -f "$ASDF_DIR/asdf.sh" ]] && . "$ASDF_DIR/asdf.sh"
|
if ! [[ -f "${ASDF_DIR}/asdf.sh" ]] && [[ -f $(which brew 2>&1) ]]; then
|
||||||
[[ -f "${ASDF_COMPLETIONS}/asdf.bash" ]] && . ${ASDF_COMPLETIONS}/asdf.bash;
|
echo "[asdf] Installing asdf via brew";
|
||||||
|
brew install asdf;
|
||||||
alias asdf_list_all='asdf plugin list all';
|
fi
|
||||||
alias asdf_add='asdf plugin add';
|
|
||||||
alias asdf_list_versions='asdf list all';
|
|
||||||
|
# Load command
|
||||||
|
if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
|
||||||
# adds a plugin @ a version, installs and uses it
|
. "$ASDF_DIR/asdf.sh"
|
||||||
asdf_use() {
|
|
||||||
local plugin=${1};
|
# Load completions
|
||||||
local version=${2:-'latest'};
|
if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then
|
||||||
|
. "$ASDF_COMPLETIONS/asdf.bash"
|
||||||
|
fi
|
||||||
if [[ -z "${plugin}" ]]; then
|
|
||||||
echo "usage: asdf_use <plugin> [version]"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
asdf plugin add ${plugin};
|
|
||||||
asdf install ${plugin} ${version};
|
|
||||||
asdf local ${plugin} ${version};
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,15 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
export LINUX_BREW_PATH="/home/linuxbrew/.linuxbrew";
|
export LINUX_BREW_PATH="/home/linuxbrew/.linuxbrew";
|
||||||
export MAC_BREW_PATH="/usr/local/Homebrew";
|
|
||||||
|
|
||||||
if [[ ! -d "${LINUX_BREW_PATH}" && ! -d "${MAC_BREW_PATH}" ]]; then
|
if ! [[ -d "${LINUX_BREW_PATH}" ]]; then
|
||||||
echo "Installing brew";
|
|
||||||
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o /tmp/brew_install.sh;
|
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o /tmp/brew_install.sh;
|
||||||
chmod +x /tmp/brew_install.sh;
|
chmod +x /tmp/brew_install.sh;
|
||||||
/tmp/brew_install.sh;
|
/tmp/brew_install.sh;
|
||||||
rm -rf /tmp/brew_install.sh;
|
rm -rf /tmp/brew_install.sh;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -f "${LINUX_BREW_PATH}/bin/brew" ]] && eval "$(${LINUX_BREW_PATH}/bin/brew shellenv)";
|
[[ -f "${LINUX_BREW_PATH}/bin/brew" ]] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)";
|
||||||
[[ -f "${MAC_BREW_PATH}/bin/brew" ]] && eval "$(${MAC_BREW_PATH}/bin/brew shellenv)";
|
|
||||||
|
|
||||||
[[ -f "$(brew --prefix bash-completion)/etc/bash_completion" ]] || brew install bash-completion
|
[[ -f "$(brew --prefix bash-completion)/etc/bash_completion" ]] || brew install bash-completion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ function targz() {
|
||||||
# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json`
|
# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json`
|
||||||
function json() {
|
function json() {
|
||||||
if [ -t 0 ]; then # argument
|
if [ -t 0 ]; then # argument
|
||||||
python -mjson.tool < "$*" | pygmentize -l javascript;
|
python -mjson.tool <<< "$*" | pygmentize -l javascript;
|
||||||
else # pipe
|
else # pipe
|
||||||
python -mjson.tool | pygmentize -l javascript;
|
python -mjson.tool | pygmentize -l javascript;
|
||||||
fi;
|
fi;
|
||||||
|
|
@ -120,7 +120,7 @@ function gitio() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# list files
|
# list files
|
||||||
alias ll='ls -hGla'
|
alias ll='ls -hGla --color'
|
||||||
|
|
||||||
#git
|
#git
|
||||||
alias gs='git status'
|
alias gs='git status'
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,4 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
HELM_VERSION=${HELM_VERSION:-"latest"};
|
|
||||||
|
|
||||||
if ! [[ -f "$(which helm 2>&1)" ]] && [[ -d "${HOME}/.asdf" ]]; then
|
|
||||||
asdf plugin add helm;
|
|
||||||
asdf install helm ${HELM_VERSION};
|
|
||||||
asdf local helm ${HELM_VERSION};
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$(which helm 2>&1)" ]]; then
|
if [[ -f "$(which helm 2>&1)" ]]; then
|
||||||
source <(helm completion bash)
|
source <(helm completion zsh)
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,11 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
KUBECTL_VERSION=${KUBECTL_VERSION:-"latest"};
|
if [[ -f "$(which brew 2>&1)" ]]; then
|
||||||
|
brew install kubectl;
|
||||||
if ! [[ -f "$(which kubectl 2>&1)" ]] && [[ -d "${HOME}/.asdf" ]]; then
|
|
||||||
asdf plugin add kubectl;
|
|
||||||
asdf install kubectl ${KUBECTL_VERSION};
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$(which kubectl 2>&1)" ]]; then
|
if [[ -f "$(which kubectl)" ]] && [[ -d "$(brew --prefix bash-completion)/etc/bash_completion.d" ]]; then
|
||||||
[[ -f "/etc/bash_completion.d/kubectl" ]] || kubectl completion bash > /etc/bash_completion.d/kubectl;
|
kubectl completion bash > "$(brew --prefix bash-completion)/etc/bash_completion.d/kubectl";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This command is used a LOT both below and in daily life
|
# This command is used a LOT both below and in daily life
|
||||||
|
|
@ -104,7 +101,6 @@ kres(){
|
||||||
|
|
||||||
# Rollout management.
|
# Rollout management.
|
||||||
alias kgrs='kubectl get rs'
|
alias kgrs='kubectl get rs'
|
||||||
alias kdrs='kubectl describe rs'
|
|
||||||
alias krh='kubectl rollout history'
|
alias krh='kubectl rollout history'
|
||||||
alias kru='kubectl rollout undo'
|
alias kru='kubectl rollout undo'
|
||||||
|
|
||||||
|
|
@ -169,3 +165,15 @@ alias kgcj='kubectl get cronjob'
|
||||||
alias kecj='kubectl edit cronjob'
|
alias kecj='kubectl edit cronjob'
|
||||||
alias kdcj='kubectl describe cronjob'
|
alias kdcj='kubectl describe cronjob'
|
||||||
alias kdelcj='kubectl delete cronjob'
|
alias kdelcj='kubectl delete cronjob'
|
||||||
|
|
||||||
|
# Only run if the user actually has kubectl installed
|
||||||
|
if (( ${+_comps[kubectl]} )); then
|
||||||
|
kj() { kubectl "$@" -o json | jq; }
|
||||||
|
kjx() { kubectl "$@" -o json | fx; }
|
||||||
|
ky() { kubectl "$@" -o yaml | yh; }
|
||||||
|
|
||||||
|
# this stuff fails on OSX
|
||||||
|
# compdef kj=kubectl
|
||||||
|
# compdef kjx=kubectl
|
||||||
|
# compdef ky=kubectl
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,15 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
STARSHIP_VERSION=${STARSHIP_VERSION:-"latest"};
|
if ! [[ -f "$(which starship 2>&1)" ]] && [[ -f "$(which brew 2>&1)" ]]; then
|
||||||
|
brew install starship;
|
||||||
if ! [[ -f "$(which starship 2>&1)" ]] && [[ -d "${HOME}/.asdf" ]]; then
|
|
||||||
asdf plugin add starship;
|
|
||||||
asdf install starship ${STARSHIP_VERSION};
|
|
||||||
asdf local starship ${STARSHIP_VERSION};
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$(which starship 2>&1)" ]]; then
|
if [[ -f "$(which starship 2>&1)" ]]; then
|
||||||
export STARSHIP_CONFIG_DIR="${FILES_USER_CONFIG}";
|
export STARSHIP_CONFIG_DIR="${FILES_USER_CONFIG}/starship";
|
||||||
export STARSHIP_CACHE="${STARSHIP_CONFIG_DIR}/cache";
|
export STARSHIP_CACHE="${STARSHIP_CONFIG_DIR}/cache";
|
||||||
|
|
||||||
files_debug_log "[starship] installing default config";
|
files_debug_log "[starship] installing default config";
|
||||||
[[ -f "${FILES_USER_CONFIG}/starship.toml" ]] || ln -sf "${FILES_PLUGIN_ROOT}/defaults.d/starship.toml" ${FILES_USER_CONFIG};
|
files_linkdir "${FILES_PLUGIN_ROOT}/defaults.d/" "${STARSHIP_CONFIG_DIR}/";
|
||||||
|
|
||||||
starship_run() {
|
starship_run() {
|
||||||
local shell=${1:-bash};
|
local shell=${1:-bash};
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,32 @@
|
||||||
" change runtime path
|
" change runtime path
|
||||||
set runtimepath=~/.config/vim/runtime/
|
set runtimepath=~/.config/vim/runtime/
|
||||||
|
|
||||||
call pathogen#infect()
|
execute pathogen#infect()
|
||||||
Helptags
|
execute pathogen#helptags()
|
||||||
|
|
||||||
"color schemes
|
|
||||||
"colorscheme ecostation
|
|
||||||
"colorscheme jellybeans
|
|
||||||
"colorscheme torte
|
|
||||||
"colorscheme dragon-energy
|
|
||||||
"colorscheme wombat256i
|
|
||||||
"colorscheme vim-colors-solarized
|
|
||||||
"colorscheme rdark
|
|
||||||
"colorscheme vilight
|
|
||||||
"colorscheme vim-tomorrow-theme
|
|
||||||
colorscheme monokai
|
|
||||||
"colorscheme inkpot
|
|
||||||
|
|
||||||
|
|
||||||
" Enable file type detection
|
|
||||||
filetype plugin indent on
|
|
||||||
"
|
|
||||||
"we don't want vi compatibility AKA Make Vim more useful
|
"we don't want vi compatibility AKA Make Vim more useful
|
||||||
set nocompatible
|
set nocompatible
|
||||||
|
|
||||||
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
|
"color schemes
|
||||||
set clipboard=unnamed
|
"colorscheme torte
|
||||||
|
"colorscheme jellybeans
|
||||||
|
"colorscheme molokai
|
||||||
|
"colorscheme wombat256i
|
||||||
|
"colorscheme dragon-energy
|
||||||
|
"colorscheme patagonia-vim
|
||||||
|
"colorscheme vim-colors-solarized
|
||||||
|
"colorscheme vim-obsidian
|
||||||
|
"colorscheme rdark
|
||||||
|
"colorscheme ecostation
|
||||||
|
"colorscheme vilight
|
||||||
|
"colorscheme vim-tomorrow-theme
|
||||||
|
"colorscheme monokai
|
||||||
|
"colorscheme inkpot
|
||||||
|
"colorscheme CmptrClr
|
||||||
|
|
||||||
set omnifunc=syntaxcomplete#Complete
|
set omnifunc=syntaxcomplete#Complete
|
||||||
set completeopt-=preview
|
set completeopt-=preview
|
||||||
|
|
||||||
set termguicolors
|
|
||||||
set wildignore=*.png,*.jpg,node_modules,*.min.js,*.txt,*.bak,*.exe,vendor.js
|
set wildignore=*.png,*.jpg,node_modules,*.min.js,*.txt,*.bak,*.exe,vendor.js
|
||||||
set autochdir
|
set autochdir
|
||||||
set tags=./.git/tags,tags;$HOME
|
set tags=./.git/tags,tags;$HOME
|
||||||
|
|
@ -40,7 +35,9 @@ set backupcopy=yes
|
||||||
set autoread
|
set autoread
|
||||||
set selection=exclusive
|
set selection=exclusive
|
||||||
set ttimeoutlen=70
|
set ttimeoutlen=70
|
||||||
|
set termguicolors
|
||||||
|
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
|
||||||
|
set clipboard=unnamedplus
|
||||||
" Enhance command-line completion
|
" Enhance command-line completion
|
||||||
set wildmenu
|
set wildmenu
|
||||||
" Allow cursor keys in insert mode
|
" Allow cursor keys in insert mode
|
||||||
|
|
@ -59,15 +56,9 @@ set binary
|
||||||
" Don't add empty newlines at the end of files
|
" Don't add empty newlines at the end of files
|
||||||
set noeol
|
set noeol
|
||||||
|
|
||||||
" Number of things to remember in history.
|
set history=500 " Number of things to remember in history.
|
||||||
set history=1500
|
|
||||||
set t_Co=256
|
set t_Co=256
|
||||||
|
|
||||||
if has('gui_running')
|
|
||||||
set go =mt
|
|
||||||
set guifont=Literation\ Mono\ for\ Powerline:h12,Literation_Mono_for_Powerline:h12,Inconsolata\ for\ Powerline:h10,Ubuntu\ Mono:h26,Consolas:h12,Courier:h12
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Centralize backups, swapfiles and undo history
|
" Centralize backups, swapfiles and undo history
|
||||||
if exists("&backupdir")
|
if exists("&backupdir")
|
||||||
set backupdir=~/.config/vim/backups/
|
set backupdir=~/.config/vim/backups/
|
||||||
|
|
@ -98,7 +89,6 @@ set tabstop=4
|
||||||
set expandtab
|
set expandtab
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
|
|
||||||
|
|
||||||
" Show “invisible” characters
|
" Show “invisible” characters
|
||||||
set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
|
set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
|
||||||
set list
|
set list
|
||||||
|
|
@ -130,6 +120,10 @@ set showcmd
|
||||||
" Start scrolling x lines before the horizontal window border
|
" Start scrolling x lines before the horizontal window border
|
||||||
set scrolloff=4
|
set scrolloff=4
|
||||||
|
|
||||||
|
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 expandtab
|
||||||
|
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||||
|
autocmd Filetype go setlocal ts=4 sw=4 sts=4 noexpandtab
|
||||||
|
|
||||||
|
|
||||||
" Change mapleader
|
" Change mapleader
|
||||||
let mapleader = ","
|
let mapleader = ","
|
||||||
|
|
@ -202,7 +196,6 @@ noremap <leader>W :w !sudo tee % > /dev/null<CR>
|
||||||
" generate tags
|
" generate tags
|
||||||
nnoremap <leader>c :! ctags -R -f ./.git/tags .<CR>
|
nnoremap <leader>c :! ctags -R -f ./.git/tags .<CR>
|
||||||
|
|
||||||
|
|
||||||
" enable neocomplete
|
" enable neocomplete
|
||||||
let g:neocomplete#enable_at_startup = 0
|
let g:neocomplete#enable_at_startup = 0
|
||||||
|
|
||||||
|
|
@ -228,7 +221,35 @@ let g:go_highlight_build_constraints = 1
|
||||||
let g:go_highlight_extra_types = 1
|
let g:go_highlight_extra_types = 1
|
||||||
let g:go_fmt_command = "goimports"
|
let g:go_fmt_command = "goimports"
|
||||||
let g:go_fmt_autosave = 1
|
let g:go_fmt_autosave = 1
|
||||||
|
" -b -w -p"
|
||||||
|
|
||||||
|
let g:syntastic_go_checkers = ['go', 'errcheck', 'gofmt', 'golint', 'govet']
|
||||||
|
"let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
|
||||||
|
|
||||||
|
" Automatic commands
|
||||||
|
if has("autocmd")
|
||||||
|
" Use relative line numbers
|
||||||
|
if exists("&relativenumber")
|
||||||
|
set relativenumber
|
||||||
|
au BufReadPost * set relativenumber
|
||||||
|
endif
|
||||||
|
|
||||||
|
" rename symbol
|
||||||
|
au FileType go nmap <Leader>r <Plug>(go-rename)
|
||||||
|
|
||||||
|
" show type info
|
||||||
|
au FileType go nmap <Leader>ki <Plug>(go-info)
|
||||||
|
|
||||||
|
" go def
|
||||||
|
au FileType go nmap <Leader>di <Plug>(go-def-split)
|
||||||
|
au FileType go nmap <Leader>ds <Plug>(go-def-vertical)
|
||||||
|
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
|
||||||
|
|
||||||
|
" go docs
|
||||||
|
au FileType go nmap <Leader>gd <Plug>(go-doc)
|
||||||
|
au FileType go nmap <Leader>gi <Plug>(go-doc-vertical)
|
||||||
|
au FileType go nmap <Leader>gb <Plug>(go-doc-browser)
|
||||||
|
endif
|
||||||
|
|
||||||
" ctrl p
|
" ctrl p
|
||||||
let g:ctrlp_map = '<C-P>'
|
let g:ctrlp_map = '<C-P>'
|
||||||
|
|
@ -238,6 +259,7 @@ let g:ctrlp_cmd = 'CtrlPLastMode'
|
||||||
let g:ctrlp_extensions = ['line']
|
let g:ctrlp_extensions = ['line']
|
||||||
let g:ctrlp_show_hidden = 1
|
let g:ctrlp_show_hidden = 1
|
||||||
|
|
||||||
|
|
||||||
"'c' - the directory of the current file.
|
"'c' - the directory of the current file.
|
||||||
"'a' - the directory of the current file, unless it is a subdirectory of the cwd
|
"'a' - the directory of the current file, unless it is a subdirectory of the cwd
|
||||||
"'r' - the nearest ancestor of the current file that contains one of these directories or files: .git .hg .svn .bzr _darcs
|
"'r' - the nearest ancestor of the current file that contains one of these directories or files: .git .hg .svn .bzr _darcs
|
||||||
|
|
@ -317,72 +339,38 @@ let g:syntastic_loc_list_height = 1
|
||||||
let g:syntastic_enable_balloons = 1
|
let g:syntastic_enable_balloons = 1
|
||||||
|
|
||||||
let g:syntastic_javascript_checkers = ['standard']
|
let g:syntastic_javascript_checkers = ['standard']
|
||||||
let g:syntastic_go_checkers = ['go', 'errcheck', 'gofmt', 'golint', 'govet']
|
|
||||||
"let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
|
|
||||||
|
|
||||||
" YCM
|
" YCM
|
||||||
let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
|
let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
|
||||||
|
|
||||||
|
" Enable file type detection
|
||||||
|
filetype plugin indent on
|
||||||
|
|
||||||
|
augroup myvimrc
|
||||||
|
au!
|
||||||
|
au BufWritePost .vimrc so $MYVIMRC
|
||||||
|
augroup END
|
||||||
|
|
||||||
" Automatic commands
|
" Automatic commands
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
" Use relative line numbers
|
" Treat .json files as .js
|
||||||
if exists("&relativenumber")
|
autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
|
||||||
set relativenumber
|
" Treat .md files as Markdown
|
||||||
au BufReadPost * set relativenumber
|
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
|
||||||
endif
|
|
||||||
|
|
||||||
" rename symbol
|
|
||||||
au FileType go nmap <Leader>r <Plug>(go-rename)
|
|
||||||
|
|
||||||
" show type info
|
|
||||||
au FileType go nmap <Leader>ki <Plug>(go-info)
|
|
||||||
|
|
||||||
" go def
|
|
||||||
au FileType go nmap <Leader>di <Plug>(go-def-split)
|
|
||||||
au FileType go nmap <Leader>ds <Plug>(go-def-vertical)
|
|
||||||
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
|
|
||||||
|
|
||||||
" go docs
|
|
||||||
au FileType go nmap <Leader>gd <Plug>(go-doc)
|
|
||||||
au FileType go nmap <Leader>gi <Plug>(go-doc-vertical)
|
|
||||||
au FileType go nmap <Leader>gb <Plug>(go-doc-browser)
|
|
||||||
|
|
||||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.html setfiletype html syntax=htmldjango
|
autocmd BufRead,BufNewFile *.html setfiletype html syntax=htmldjango
|
||||||
autocmd BufRead,BufNewFile *.template setfiletype html template syntax=htmldjango
|
autocmd BufRead,BufNewFile *.template setfiletype html template syntax=htmldjango
|
||||||
autocmd BufRead,BufNewFile *.php setfiletype php syntax=go
|
|
||||||
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
|
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.go setfiletype golang syntax=go
|
autocmd BufRead,BufNewFile *.go setfiletype golang syntax=go
|
||||||
autocmd Filetype go setlocal ts=4 sw=4 sts=4 noexpandtab
|
autocmd BufRead,BufNewFile *.php setfiletype php syntax=go
|
||||||
|
autocmd BufRead,BufNewFile Dockerfile* setfiletype Dockerfile syntax=go
|
||||||
" Treat .json files as .js
|
|
||||||
autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
|
|
||||||
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 expandtab
|
|
||||||
|
|
||||||
" Spell check and line wrap just for git commit messages
|
" Spell check and line wrap just for git commit messages
|
||||||
autocmd Filetype gitcommit setlocal spell textwidth=80
|
autocmd Filetype gitcommit setlocal spell textwidth=80
|
||||||
|
|
||||||
" Source vim configuration upon save
|
|
||||||
augroup vimrc
|
|
||||||
autocmd! BufWritePost $MYVIMRC source % | echom "Reloaded " . $MYVIMRC | redraw
|
|
||||||
autocmd! BufWritePost $MYGVIMRC if has('gui_running') | so % | echom "Reloaded " . $MYGVIMRC | endif | redraw
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" Auto reload files when edited outside of vim
|
|
||||||
" Triger `autoread` when files changes on disk
|
|
||||||
" https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044
|
|
||||||
" https://vi.stackexchange.com/questions/13692/prevent-focusgained-autocmd-running-in-command-line-editing-mode
|
|
||||||
autocmd FocusGained,BufEnter,CursorHold,CursorHoldI *
|
|
||||||
\ if mode() !~ '\v(c|r.?|!|t)' && getcmdwintype() == '' | checktime | endif
|
|
||||||
|
|
||||||
" Notification after file change
|
|
||||||
" https://vi.stackexchange.com/questions/13091/autocmd-event-for-autoread
|
|
||||||
autocmd FileChangedShellPost *
|
|
||||||
\ echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl None
|
|
||||||
|
|
||||||
au GUIEnter * set vb t_vb=
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
au GUIEnter * set vb t_vb=
|
||||||
|
|
||||||
|
if has('gui_running')
|
||||||
|
set go =mt
|
||||||
|
set guifont=Literation\ Mono\ for\ Powerline:h12,Literation_Mono_for_Powerline:h12,Inconsolata\ for\ Powerline:h10,Ubuntu\ Mono:h26,Consolas:h12,Courier:h12
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,7 @@ git://github.com/ervandew/supertab.git
|
||||||
git://github.com/tpope/vim-repeat.git
|
git://github.com/tpope/vim-repeat.git
|
||||||
git://github.com/tpope/vim-surround.git
|
git://github.com/tpope/vim-surround.git
|
||||||
git://github.com/kien/ctrlp.vim.git
|
git://github.com/kien/ctrlp.vim.git
|
||||||
git://github.com/vim-scripts/tComment.git
|
git://github.com/vim-scripts/tComment
|
||||||
git://github.com/wellle/targets.vim.git
|
|
||||||
# syntax
|
# syntax
|
||||||
git://github.com/cakebaker/scss-syntax.vim.git
|
git://github.com/cakebaker/scss-syntax.vim.git
|
||||||
git://github.com/pangloss/vim-javascript.git
|
git://github.com/pangloss/vim-javascript.git
|
||||||
|
|
|
||||||
16
sourceme.sh
16
sourceme.sh
|
|
@ -1,13 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
files_debug_off() {
|
|
||||||
unset FILES_DEBUG;
|
|
||||||
}
|
|
||||||
|
|
||||||
files_debug_on() {
|
|
||||||
export FILES_DEBUG=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
# debug logging
|
# debug logging
|
||||||
files_debug_log() {
|
files_debug_log() {
|
||||||
if ! [[ -z "${FILES_DEBUG}" ]]; then
|
if ! [[ -z "${FILES_DEBUG}" ]]; then
|
||||||
|
|
@ -29,7 +21,6 @@ files_linkdir() {
|
||||||
find "${SOURCE}" -type f | sed "s=${SOURCE}==" | xargs -I {} ln -fs ${SOURCE}{} ${DEST}{};
|
find "${SOURCE}" -type f | sed "s=${SOURCE}==" | xargs -I {} ln -fs ${SOURCE}{} ${DEST}{};
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ln on windows pretty much only works with hardlinks it seems
|
# ln on windows pretty much only works with hardlinks it seems
|
||||||
#ls -lA "${SOURCE}" | grep "^-" | awk '{print $9}' | xargs -I {} ln -vfs "${SOURCE}/{}" "${DEST}/{}"
|
#ls -lA "${SOURCE}" | grep "^-" | awk '{print $9}' | xargs -I {} ln -vfs "${SOURCE}/{}" "${DEST}/{}"
|
||||||
}
|
}
|
||||||
|
|
@ -67,13 +58,6 @@ load_env() {
|
||||||
files_debug_log "[load_env] \$FILES_ROOT = ${FILES_ROOT}";
|
files_debug_log "[load_env] \$FILES_ROOT = ${FILES_ROOT}";
|
||||||
export FILES_USER_CONFIG="${HOME}/.config";
|
export FILES_USER_CONFIG="${HOME}/.config";
|
||||||
|
|
||||||
export FILES_CACHE_DIR="${FILES_ROOT}/.tmp/";
|
|
||||||
|
|
||||||
if [[ -d "${FILES_CACHE_DIR}" ]]; then
|
|
||||||
files_debug_log "[load env] Setting up cache directory @ ${FILES_CACHE_DIR}";
|
|
||||||
mkdir -p ${FILES_CACHE_DIR};
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "${FILES_PLUGINS}" ]]; then
|
if [[ -z "${FILES_PLUGINS}" ]]; then
|
||||||
export FILES_PLUGINS=("brew" "ssh" "vim" "git-extras" "asdf" "helm" "starship" "extras");
|
export FILES_PLUGINS=("brew" "ssh" "vim" "git-extras" "asdf" "helm" "starship" "extras");
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue