From 6c0416d8c02f731244f24890fce575c1b5d3460b Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 10 Jan 2018 17:31:15 +0100 Subject: Sort references by time --- bin/bin/references | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/bin/references b/bin/bin/references index 209c9f9..93ef5f4 100755 --- a/bin/bin/references +++ b/bin/bin/references @@ -1,5 +1,5 @@ #!/bin/bash REF_DIR="$HOME/phd/references" -PDF=$(find $REF_DIR -regex ".*.\(pdf\|djvu\|PDF\|ps\)" -printf "%P\n") +PDF=$(find $REF_DIR -regex ".*.\(pdf\|djvu\|PDF\|ps\)" -printf "%C@ %P\n" | sort | tac | cut -d' ' -f2-) TARGET=$(echo "${PDF//"$REF_DIR/"/}" | dmenu -i -p "Open File:") [[ -n $TARGET ]] && exec zathura "$REF_DIR/$TARGET" -- cgit v1.2.3 From 93a8f4479e0e61a153239dc15fe8b0e42979870c Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 10 Jan 2018 17:31:15 +0100 Subject: Sort references by time --- bin/bin/references | 2 +- guix/.guix-env | 20 ++++++++++ guix/.guix-profile | 13 ------- zsh/.zsh/.zprofile | 3 -- zsh/.zsh/.zshenv | 11 ++++++ zsh/.zsh/.zshrc | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++--- zsh/.zsh/alias | 25 ------------ zsh/.zsh/functions | 40 ------------------- zsh/.zsh/plugins | 39 ------------------- zsh/.zshenv | 5 +-- 10 files changed, 138 insertions(+), 131 deletions(-) create mode 100644 guix/.guix-env delete mode 100644 guix/.guix-profile create mode 100644 zsh/.zsh/.zshenv delete mode 100644 zsh/.zsh/alias delete mode 100644 zsh/.zsh/functions delete mode 100644 zsh/.zsh/plugins mode change 100644 => 120000 zsh/.zshenv diff --git a/bin/bin/references b/bin/bin/references index 209c9f9..93ef5f4 100755 --- a/bin/bin/references +++ b/bin/bin/references @@ -1,5 +1,5 @@ #!/bin/bash REF_DIR="$HOME/phd/references" -PDF=$(find $REF_DIR -regex ".*.\(pdf\|djvu\|PDF\|ps\)" -printf "%P\n") +PDF=$(find $REF_DIR -regex ".*.\(pdf\|djvu\|PDF\|ps\)" -printf "%C@ %P\n" | sort | tac | cut -d' ' -f2-) TARGET=$(echo "${PDF//"$REF_DIR/"/}" | dmenu -i -p "Open File:") [[ -n $TARGET ]] && exec zathura "$REF_DIR/$TARGET" diff --git a/guix/.guix-env b/guix/.guix-env new file mode 100644 index 0000000..8069fa0 --- /dev/null +++ b/guix/.guix-env @@ -0,0 +1,20 @@ +## Guix + +# Locale +export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale +export LC_ALL=en_US.utf8 + +# Paths +export PATH="$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin${PATH:+:}$PATH" +export CPATH="/home/urbain/.guix-profile/include${CPATH:+:}$CPATH" +export LIBRARY_PATH="/home/urbain/.guix-profile/lib${LIBRARY_PATH:+:}$LIBRARY_PATH" + +# Custom packages +export GUIX_PACKAGE_PATH=$HOME/Dropbox/projects/guix-packages + +## Guile +export GUILE_LOAD_PATH=$HOME/.guix-profile/share/guile/site/2.2:$GUILE_LOAD_PATH +export GUILE_LOAD_COMPILED_PATH=$HOME/.guix-profile/lib/guile/2.2/site-ccache:$GUILE_LOAD_COMPILED_PATH +export GUILE_WARN_DEPRECATED=detailed + +# vim: set ft=sh diff --git a/guix/.guix-profile b/guix/.guix-profile deleted file mode 100644 index d1495ae..0000000 --- a/guix/.guix-profile +++ /dev/null @@ -1,13 +0,0 @@ -# Guix -export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale -export GUIX_PACKAGE_PATH=$HOME/Dropbox/projects/guix-packages -export PATH="$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin${PATH:+:}$PATH" -export CPATH="/home/urbain/.guix-profile/include${CPATH:+:}$CPATH" -export LIBRARY_PATH="/home/urbain/.guix-profile/lib${LIBRARY_PATH:+:}$LIBRARY_PATH" - -# Guile -export GUILE_LOAD_PATH=$HOME/.guix-profile/share/guile/site/2.2:$GUILE_LOAD_PATH -export GUILE_LOAD_COMPILED_PATH=$HOME/.guix-profile/lib/guile/2.2/site-ccache:$GUILE_LOAD_COMPILED_PATH -export GUILE_WARN_DEPRECATED=detailed - -# vim: set ft=sh diff --git a/zsh/.zsh/.zprofile b/zsh/.zsh/.zprofile index 13942bb..38e7bb0 100644 --- a/zsh/.zsh/.zprofile +++ b/zsh/.zsh/.zprofile @@ -1,8 +1,5 @@ export EDITOR=vim export HISTSIZE=1000000 -# We need to reset $PATH because /etc/profile is read after ~/.zshenv -export PATH="$HOME/bin:$HOME/.guix-profile/bin:$HOME/bin:/usr/lib/surfraw${PATH:+:}$PATH" - # Start X automatically [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx diff --git a/zsh/.zsh/.zshenv b/zsh/.zsh/.zshenv new file mode 100644 index 0000000..2cd7b6a --- /dev/null +++ b/zsh/.zsh/.zshenv @@ -0,0 +1,11 @@ +export ZDOTDIR=$HOME/.zsh + +# Source guix & nix profiles +guix_profile=$HOME/.guix-env +nix_profile=$HOME/.nix-profile/etc/profile.d/nix.sh + +[[ -f $guix_profile ]] && . $guix_profile +[[ -f $nix_profile ]] && . $nix_profile + +# Export pass without repetitions +export -U PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:$HOME/bin:$HOME/.gem/ruby/2.5.0/bin:/usr/lib/surfraw${PATH:+:}$PATH" diff --git a/zsh/.zsh/.zshrc b/zsh/.zsh/.zshrc index a5fdea8..95d0bb0 100644 --- a/zsh/.zsh/.zshrc +++ b/zsh/.zsh/.zshrc @@ -1,9 +1,42 @@ -# source /home/urbain/.nix-profile/etc/profile.d/nix.sh +## zgen {{{ -# Source configuration files -source "$HOME/.zsh/plugins" -source "$HOME/.zsh/functions" -source "$HOME/.zsh/alias" +[ ! -d ~/.zsh/zgen ] && git clone https://github.com/tarjoilija/zgen.git ~/.zsh/zgen +source "$HOME/.zsh/zgen/zgen.zsh" + +# Load plugins +if ! zgen saved; then + + echo "Creating a zgen save" + + # Load oh-my-zsh framework + zgen oh-my-zsh + + # Oh-my-zsh plugins + zgen oh-my-zsh plugins/git + zgen oh-my-zsh plugins/vi-mode + + # Navigation plugins + zgen load urbainvaes/fzf-marks + + # Other plugins + zgen load rupa/z + + # zsh-users plugins + zgen load zsh-users/zsh-completions src + zgen load zsh-users/zsh-syntax-highlighting + zgen load zsh-users/zsh-autosuggestions + + # Save all to init script + zgen save +fi + +# Autosuggestion +{ + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' + bindkey '^y' autosuggest-accept +} + +# }}} # Custom key bindings for built-in widgets bindkey -a 'k' history-beginning-search-backward @@ -13,11 +46,14 @@ bindkey '^N' history-beginning-search-forward PROMPT='%0~ $ ' -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # Options unsetopt histverify +## fzf {{{ + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + # Use fzf with z unalias z 2> /dev/null z() { @@ -27,3 +63,66 @@ z() { } zle -N z bindkey '^z' z + +# }}} +## Colors {{{ + +[[ -z ${ZSH_COLORS} ]] && ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh +[[ -f ${ZSH_COLORS} ]] && source ${ZSH_COLORS} + +colorschemes=$(ls ${HOME}/.Xresources) + +function colo { + + XRESOURCE=$1 + XRESOURCE_FILE=${HOME}/.Xresources/${XRESOURCE} + + # Change colors for current session + if [[ ! -z "$TMUX" ]]; then + printf '\x1bPtmux;' + esc='\x1b\x1b' + else + esc='\x1b' + fi + + /usr/bin/cpp ${XRESOURCE_FILE} | tr -d ' \t' | sed -n \ + -e "s/.*background:/${esc}]11;/p" \ + -e "s/.*foreground:/${esc}]10;/p" \ + -e "s/.*borderColor:/${esc}]708;/p" \ + -e "s/.*color\\([0-9][^:]*\\):/${esc}]4;\\1;/p" | tr \\n \\a + + # Change color for future sessions + xrdb ${XRESOURCE_FILE} +} + +# Completion for colorschemes (-M -> Case insensitive) +compctl -k "(${colorschemes})" -M 'm:{a-z}={A-Z}' colo + +# }}} +## Aliases {{{ + +# Commands +alias cdd='cd ~/dotfiles' + +# Programs +alias a='vifm . .' +alias ff='FreeFem++' +alias m='cd ~/.mutt/attachments && mutt && cd -' +alias e='nvim' +alias mux='tmuxinator' +alias n='nvim' +alias ns='nvim -S Session.vim' +alias v='vim' +alias vs="vim -S Session.vim" +alias email="mbsync -a" + +# Git +alias g='git' +alias rd='cd $(git rev-parse --show-toplevel)' + +# GNU Make +alias mi='make install' +alias mc='make clean' +alias mca='make clean-all' + +# }}} diff --git a/zsh/.zsh/alias b/zsh/.zsh/alias deleted file mode 100644 index 5f6a856..0000000 --- a/zsh/.zsh/alias +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/zsh - -# Commands -alias cdd='cd ~/dotfiles' - -# Programs -alias a='vifm . .' -alias ff='FreeFem++' -alias m='cd ~/.mutt/attachments && mutt && cd -' -alias e='nvim' -alias mux='tmuxinator' -alias n='nvim' -alias ns='nvim -S Session.vim' -alias v='vim' -alias vs="vim -S Session.vim" -alias email="mbsync -a" - -# Git -alias g='git' -alias rd='cd $(git rev-parse --show-toplevel)' - -# GNU Make -alias mi='make install' -alias mc='make clean' -alias mca='make clean-all' diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions deleted file mode 100644 index c5bbb09..0000000 --- a/zsh/.zsh/functions +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/zsh - -[[ -z ${ZSH_COLORS} ]] && ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh -[[ -f ${ZSH_COLORS} ]] && source ${ZSH_COLORS} - -colorschemes=$(ls ${HOME}/.Xresources) - -function colo { - - XRESOURCE=$1 - XRESOURCE_FILE=${HOME}/.Xresources/${XRESOURCE} - - # Change colors for current session - if [[ ! -z "$TMUX" ]]; then - printf '\x1bPtmux;' - esc='\x1b\x1b' - else - esc='\x1b' - fi - - /usr/bin/cpp ${XRESOURCE_FILE} | tr -d ' \t' | sed -n \ - -e "s/.*background:/${esc}]11;/p" \ - -e "s/.*foreground:/${esc}]10;/p" \ - -e "s/.*borderColor:/${esc}]708;/p" \ - -e "s/.*color\\([0-9][^:]*\\):/${esc}]4;\\1;/p" | tr \\n \\a - - # Change color for future sessions - xrdb ${XRESOURCE_FILE} - - # Change default environment variable for future sessions - mkdir -p $(dirname ${ZSH_COLORS}) - - echo "export COLORSCHEME=${XRESOURCE%.*}" > ${ZSH_COLORS} - echo "export BACKGROUND=${XRESOURCE#*.}" >> ${ZSH_COLORS} - echo "export XRESOURCE=${XRESOURCE}" >> ${ZSH_COLORS} - source ${ZSH_COLORS} -} - -# Completion for colorschemes (-M -> Case insensitive) -compctl -k "(${colorschemes})" -M 'm:{a-z}={A-Z}' colo diff --git a/zsh/.zsh/plugins b/zsh/.zsh/plugins deleted file mode 100644 index 649f00d..0000000 --- a/zsh/.zsh/plugins +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/zsh - -# Load zgen -[ ! -d ~/.zsh/zgen ] && git clone https://github.com/tarjoilija/zgen.git ~/.zsh/zgen -source "$HOME/.zsh/zgen/zgen.zsh" - -# Load plugins -if ! zgen saved; then - - echo "Creating a zgen save" - - # Load oh-my-zsh framework - zgen oh-my-zsh - - # Oh-my-zsh plugins - zgen oh-my-zsh plugins/git - zgen oh-my-zsh plugins/vi-mode - - # Navigation plugins - zgen load urbainvaes/fzf-marks - - # Other plugins - zgen load rupa/z - zgen load djui/alias-tips - - # zsh-users plugins - zgen load zsh-users/zsh-completions src - zgen load zsh-users/zsh-syntax-highlighting - zgen load zsh-users/zsh-autosuggestions - - # Save all to init script - zgen save -fi - -# Autosuggestion -{ - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' - bindkey '^y' autosuggest-accept -} diff --git a/zsh/.zshenv b/zsh/.zshenv deleted file mode 100644 index 95701e8..0000000 --- a/zsh/.zshenv +++ /dev/null @@ -1,4 +0,0 @@ -export ZDOTDIR=$HOME/.zsh -export PATH="$HOME/bin:$HOME/bin:/usr/lib/surfraw${PATH:+:}$PATH" - -source $HOME/.guix-profile diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 120000 index 0000000..135f05c --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1 @@ +.zsh/.zshenv \ No newline at end of file -- cgit v1.2.3 From 642702c81e40615a1424de7c3b3724ae796aa698 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 10 Jan 2018 17:45:02 +0100 Subject: Update vimtex configuration to latest version --- vim/.vimrc | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 1b73266..517df88 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -29,6 +29,7 @@ Plug 'jamessan/vim-gnupg' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'junegunn/gv.vim' +Plug 'junegunn/heytmux' Plug 'junegunn/vim-easy-align' Plug 'junegunn/vim-peekaboo' Plug 'junegunn/vim-slash' @@ -160,28 +161,13 @@ let g:airline#extensions#tabline#tab_min_count = 2 let g:airline#extensions#tabline#show_buffers = 0 let g:airline_symbols_ascii = 1 -" Deoplete / neocomplete +" Deoplete let g:deoplete#enable_at_startup = 1 -let g:neocomplete#enable_at_startup = 1 -if !exists('g:deoplete#omni_patterns') - let g:deoplete#omni_patterns = {} -endif -if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} -endif -let g:neocomplete#sources#omni#input_patterns.tex = - \ '\v\\%(' - \ . '\a*cite\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*' - \ . '|\a*ref%(\s*\{[^}]*|range\s*\{[^,}]*%(}\{)?)' - \ . '|hyperref\s*\[[^]]*' - \ . '|includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*' - \ . '|%(include%(only)?|input)\s*\{[^}]*' - \ . '|\a*(gls|Gls|GLS)(pl)?\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*' - \ . '|includepdf%(\s*\[[^]]*\])?\s*\{[^}]*' - \ . '|includestandalone%(\s*\[[^]]*\])?\s*\{[^}]*' - \ . ')' -let g:deoplete#omni_patterns.tex = g:neocomplete#sources#omni#input_patterns.tex.'\m' let g:deoplete#sources#jedi#show_docstring = 1 +if !exists('g:deoplete#omni#input_patterns') + let g:deoplete#omni#input_patterns = {} +endif +let g:deoplete#omni#input_patterns.tex = g:vimtex#re#deoplete " FZF.vim let g:fzf_buffers_jump = 1 @@ -263,6 +249,7 @@ set nowrap set nowritebackup set shiftwidth=4 set showcmd +set splitright set smartcase set smartindent set softtabstop=4 @@ -273,7 +260,7 @@ set undofile " set formatoptions+=orw silent! set breakindent let &showbreak='--> ' -set clipboard=unnamedplus +set clipboard=unnamedplus,unnamed " set spellfile="$HOME/.vim/spell/en.utf-8.add" if !has("nvim") set encoding=utf-8 @@ -296,7 +283,6 @@ nnoremap w :update nnoremap q :q! nnoremap d :bd! - nnoremap tn :tabnew nnoremap te :tabedit nnoremap tl :+tabmove @@ -346,8 +332,8 @@ colo seoul256 "" Autocommands {{{ augroup vimrc autocmd! + au BufWritePost *vimrc,*exrc :source % au BufNewFile,Bufread /tmp/mutt-* setlocal tw=72 - au BufWritePost *vimrc :source % au BufWritePre * \ if !isdirectory(expand(':p:h')) | \ call mkdir(expand(':p:h'), 'p') | @@ -369,17 +355,18 @@ augroup END " }}} "" My search {{{ if executable("ag") - set grepprg=ag\ --vimgrep + set grepprg=ag\ -uu\ --vimgrep set grepformat=%f:%l:%c:%m endif if executable("rg") - set grepprg=rg\ --vimgrep + set grepprg=rg\ -uu\ --vimgrep set grepformat=%f:%l:%c:%m endif command! -nargs=+ -complete=file_in_path Grep execute 'silent grep!' | cw | redraw! command! -nargs=+ -complete=file_in_path GitGrep execute 'silent Ggrep!' | cw | redraw! +command! -nargs=+ -complete=file_in_path VimGrep execute 'silent vimgrep!' | cw | redraw! function! My_search(vm) let is_visual=(a:vm == "v") @@ -394,6 +381,8 @@ function! Cycle_searchprg() if g:my_searchprg == "Grep" let g:my_searchprg = "GitGrep" elseif g:my_searchprg == "GitGrep" + let g:my_searchprg = "VimGrep" + elseif g:my_searchprg == "VimGrep" let g:my_searchprg = "Grep" endif echom g:my_searchprg @@ -401,5 +390,5 @@ endfunction nmap co/ :call Cycle_searchprg() nmap g/ :set opfunc=My_searchg@ -xmap g/ :call Search(visualmode()) +xmap g/ :call My_search(visualmode()) "}}} -- cgit v1.2.3