mirror of https://git.decapod.one/brethil/dotfiles
Compare commits
3 Commits
b50a9dec24
...
937555cd8d
Author | SHA1 | Date |
---|---|---|
bretello | 937555cd8d | |
bretello | 5b575986c9 | |
bretello | 3df7a304c4 |
|
@ -1,9 +1,6 @@
|
||||||
# vim:ft=zsh ts=2 sw=2 sts=2
|
# vim:ft=zsh ts=2 sw=2 sts=2
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
|
|
||||||
# Set DISABLE_DOTFILES_AUTOUPDATE=true to disable updates
|
|
||||||
source "${DOTFILES}/check_for_update.zsh"
|
|
||||||
|
|
||||||
# theme-related variables
|
# theme-related variables
|
||||||
export ZSH_CUSTOM="$DOTFILES"
|
export ZSH_CUSTOM="$DOTFILES"
|
||||||
export ZSH_THEME="brethil"
|
export ZSH_THEME="brethil"
|
||||||
|
@ -17,6 +14,7 @@ antibody bundle < "$DOTFILES/antibody_plugins.txt"
|
||||||
|
|
||||||
# Setup completion style
|
# Setup completion style
|
||||||
source $DOTFILES/completion_style.zsh
|
source $DOTFILES/completion_style.zsh
|
||||||
|
source $DOTFILES/extras/fzf-tab-config.zsh
|
||||||
|
|
||||||
if [[ "$(command -v systemctl)" ]]; then
|
if [[ "$(command -v systemctl)" ]]; then
|
||||||
antibody bundle robbyrussell/oh-my-zsh path:plugins/systemd
|
antibody bundle robbyrussell/oh-my-zsh path:plugins/systemd
|
||||||
|
@ -127,3 +125,7 @@ test -f "${ssh_file}" && source "${ssh_file}"
|
||||||
export PATH=$PATH:$HOME/bin
|
export PATH=$PATH:$HOME/bin
|
||||||
|
|
||||||
autoload -U compinit && compinit
|
autoload -U compinit && compinit
|
||||||
|
autoload -U bashcompinit && bashcompinit
|
||||||
|
|
||||||
|
# Set DISABLE_DOTFILES_AUTOUPDATE=true to disable updates
|
||||||
|
source "${DOTFILES}/extras/check_for_update.zsh"
|
||||||
|
|
|
@ -42,8 +42,6 @@ function update_dotfiles() {
|
||||||
return;
|
return;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
emulate -L zsh
|
|
||||||
|
|
||||||
local epoch_target mtime option LAST_EPOCH
|
local epoch_target mtime option LAST_EPOCH
|
||||||
|
|
||||||
# Remove lock directory if older than a day
|
# Remove lock directory if older than a day
|
||||||
|
@ -65,8 +63,9 @@ function update_dotfiles() {
|
||||||
# assumed to have been handled, and execution continues normally. Otherwise, the shell
|
# assumed to have been handled, and execution continues normally. Otherwise, the shell
|
||||||
# will behave as interrupted except that the return status of the trap is retained.
|
# will behave as interrupted except that the return status of the trap is retained.
|
||||||
trap "
|
trap "
|
||||||
unset -f current_epoch _update_dotfiles_update update_dotfiles
|
unset -f current_epoch _update_dotfiles_update update_dotfiles &>/dev/null
|
||||||
command rm -rf '$DOTFILES/update.lock'
|
command rmdir '$DOTFILES/update.lock' &>/dev/null
|
||||||
|
echo
|
||||||
return 1
|
return 1
|
||||||
" EXIT INT QUIT
|
" EXIT INT QUIT
|
||||||
|
|
||||||
|
@ -87,17 +86,13 @@ function update_dotfiles() {
|
||||||
if [[ "$DISABLE_UPDATE_PROMPT" = true ]]; then
|
if [[ "$DISABLE_UPDATE_PROMPT" = true ]]; then
|
||||||
update_dotfiles
|
update_dotfiles
|
||||||
else
|
else
|
||||||
# input sink to swallow all characters typed before the prompt
|
|
||||||
# and add a newline if there wasn't one after characters typed
|
|
||||||
while read -t -k 1 option; do true; done
|
|
||||||
[[ "$option" != ($'\n'|"") ]] && echo
|
|
||||||
|
|
||||||
echo -n "[brethil-dotfiles] Would you like to update? [Y/n] "
|
echo -n "[brethil-dotfiles] Would you like to update? [Y/n] "
|
||||||
read -r -k 1 option
|
read -r -k 1 option
|
||||||
[[ "$option" != $'\n' ]] && echo
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
[yY$'\n']) update_dotfiles ;;
|
[yY$'\n']) update_dotfiles ;;
|
||||||
[nN]) _update_dotfiles_update ;;
|
[nN]) _update_dotfiles_update ;;
|
||||||
|
*) echo -n "[brethil dotfiles] Skipping. Update using \`dotfiles_selfupdate\`" && echo ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
unset -f current_epoch update_dotfiles _update_dotfiles_update
|
|
@ -0,0 +1,25 @@
|
||||||
|
# disable sort when completing options of any command
|
||||||
|
zstyle ':completion:complete:*:options' sort false
|
||||||
|
|
||||||
|
# use input as query string when completing zlua
|
||||||
|
zstyle ':fzf-tab:complete:_zlua:*' query-string input
|
||||||
|
|
||||||
|
# (experimental, may change in the future)
|
||||||
|
# some boilerplate code to define the variable `extract` which will be used later
|
||||||
|
# please remember to copy them
|
||||||
|
local extract="
|
||||||
|
# trim input(what you select)
|
||||||
|
local in=\${\${\"\$(<{f})\"%\$'\0'*}#*\$'\0'}
|
||||||
|
# get ctxt for current completion(some thing before or after the current word)
|
||||||
|
local -A ctxt=(\"\${(@ps:\2:)CTXT}\")
|
||||||
|
# real path
|
||||||
|
local realpath=\${ctxt[IPREFIX]}\${ctxt[hpre]}\$in
|
||||||
|
realpath=\${(Qe)~realpath}
|
||||||
|
"
|
||||||
|
|
||||||
|
# give a preview of commandline arguments when completing `kill`
|
||||||
|
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm,cmd -w -w"
|
||||||
|
zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps --pid=$in[(w)1] -o cmd --no-headers -w -w' --preview-window=down:3:wrap
|
||||||
|
|
||||||
|
# give a preview of directory by exa when completing cd
|
||||||
|
zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always $realpath'
|
|
@ -54,8 +54,8 @@ let g:ale_keep_list_window_open = 1
|
||||||
|
|
||||||
let g:ale_lint_on_save = 1
|
let g:ale_lint_on_save = 1
|
||||||
let g:ale_lint_on_enter = 1 " uncomment if you do not want to lint files on open
|
let g:ale_lint_on_enter = 1 " uncomment if you do not want to lint files on open
|
||||||
let g:ale_lint_on_insert_leave = 1
|
let g:ale_lint_on_insert_leave = 0
|
||||||
" let g:ale_lint_on_text_changed = 1
|
let g:ale_lint_on_text_changed = 0
|
||||||
let g:ale_lint_delay = 2500 " lint 2.5 seconds after text has changed
|
let g:ale_lint_delay = 2500 " lint 2.5 seconds after text has changed
|
||||||
let g:ale_fix_on_save = 1
|
let g:ale_fix_on_save = 1
|
||||||
let g:ale_completion_enabled = 1
|
let g:ale_completion_enabled = 1
|
||||||
|
|
|
@ -44,7 +44,7 @@ Plug 'https://github.com/nathanaelkane/vim-indent-guides'
|
||||||
Plug 'https://github.com/igankevich/mesonic'
|
Plug 'https://github.com/igankevich/mesonic'
|
||||||
|
|
||||||
" fzf
|
" fzf
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf'
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
" Open tags with fzf's :Tags
|
" Open tags with fzf's :Tags
|
||||||
Plug 'https://github.com/ludovicchabant/vim-gutentags.git'
|
Plug 'https://github.com/ludovicchabant/vim-gutentags.git'
|
||||||
|
|
|
@ -46,7 +46,7 @@ map <leader>cp :cp<CR>
|
||||||
|
|
||||||
"disable highlighting for current word
|
"disable highlighting for current word
|
||||||
map <silent> <leader><CR> :noh<CR>
|
map <silent> <leader><CR> :noh<CR>
|
||||||
map <leader>ss :setlocal spell!<CR>
|
map <leader>S :setlocal spell!<CR>
|
||||||
|
|
||||||
nnoremap <leader>M :bel copen<bar>silent make <bar>redraw!<CR>
|
nnoremap <leader>M :bel copen<bar>silent make <bar>redraw!<CR>
|
||||||
nnoremap <leader>wz :call WinZoomToggle()<CR>
|
nnoremap <leader>wz :call WinZoomToggle()<CR>
|
||||||
|
@ -56,7 +56,7 @@ nnoremap <leader>B :Bclose<CR>
|
||||||
nnoremap <leader>k :Rg<CR>
|
nnoremap <leader>k :Rg<CR>
|
||||||
|
|
||||||
"" Fugitive
|
"" Fugitive
|
||||||
nnoremap <leader>/ :Git<CR>
|
nnoremap <leader>/ :vert Git<CR>
|
||||||
nnoremap <leader>\ :0Git<CR>
|
nnoremap <leader>\ :0Git<CR>
|
||||||
nnoremap <leader>d :Gvdiffsplit<CR>
|
nnoremap <leader>d :Gvdiffsplit<CR>
|
||||||
nnoremap <leader>b :Git blame<CR>
|
nnoremap <leader>b :Git blame<CR>
|
||||||
|
|
|
@ -27,8 +27,10 @@ colorscheme gruvbox
|
||||||
set nowrap
|
set nowrap
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set relativenumber number
|
set relativenumber number
|
||||||
set foldlevelstart=3 foldmethod=indent foldenable "without nofoldenable all folds are closed at startup"
|
set foldlevelstart=3 foldmethod=indent nofoldenable "without foldenable all folds are open at startup"
|
||||||
set ttymouse=xterm2 " fix mouse when used in tmux/byobu https://unix.stackexchange.com/q/50733
|
set ttymouse=xterm2 " fix mouse when used in tmux/byobu https://unix.stackexchange.com/q/50733
|
||||||
|
set shell=zsh
|
||||||
|
"set shellcmdflag=-ilc " make builtin shell interactive
|
||||||
|
|
||||||
set nobackup nowb noswapfile " no need for backups of every file
|
set nobackup nowb noswapfile " no need for backups of every file
|
||||||
set history=10000
|
set history=10000
|
||||||
|
|
Loading…
Reference in New Issue