From 5b2844a2f066928bead389add1e354ef9fa05f54 Mon Sep 17 00:00:00 2001 From: Sergey Besedin Date: Tue, 15 Jan 2019 11:34:48 +0400 Subject: [PATCH] Fix and improve dotfiles --- .agignore | 12 ++++++--- .notion/cfg_statusbar.lua | 2 +- .notion/statusd_taskwarrior.lua | 2 +- .nvimrc | 46 +++++++++++++++++++-------------- .psqlrc | 3 --- .zshrc | 13 ++++++---- .zshrc.d/aliases.zsh | 24 ++++++++++------- .zshrc.d/env.zsh | 1 + .zshrc.d/rbenv.zsh | 13 +++++----- .zshrc.d/rust.zsh | 3 +++ 10 files changed, 69 insertions(+), 50 deletions(-) create mode 100644 .zshrc.d/env.zsh create mode 100644 .zshrc.d/rust.zsh diff --git a/.agignore b/.agignore index 3dc69da..5feca7b 100644 --- a/.agignore +++ b/.agignore @@ -1,5 +1,9 @@ **min.js -**/public/** -**/log/** -**/tmp/** -**/vendor/bundle/** +*.lock +*.locked +*.log +public/** +log/** +tmp/** +vendor/** +node_modules/** diff --git a/.notion/cfg_statusbar.lua b/.notion/cfg_statusbar.lua index 1432407..32ad87e 100644 --- a/.notion/cfg_statusbar.lua +++ b/.notion/cfg_statusbar.lua @@ -37,7 +37,7 @@ mod_statusbar.create{ -- right, respectively, and %systray is a placeholder for system tray -- windows and icons. -- - template=" %battery %battery_remaining | %load | %mem_available | %cpufreq_M %filler %pomodoro [ %timelogger ] %systray | %date ", + template=" %battery %battery_remaining | %load | %mem_available | %filler | %taskwarrior | %pomodoro [ %timelogger ] %systray | %date ", --template="[ %date || load:% %>load || mail:% %>mail_new/%>mail_total ] %filler%systray", --template="[ %date || load: %05load_1min || mail: %02mail_new/%02mail_total ] %filler%systray", } diff --git a/.notion/statusd_taskwarrior.lua b/.notion/statusd_taskwarrior.lua index 4f19c76..8501771 100644 --- a/.notion/statusd_taskwarrior.lua +++ b/.notion/statusd_taskwarrior.lua @@ -8,7 +8,7 @@ local task_timer -- Read the active task local function read_task_data () - local f = assert(io.popen("/usr/bin/task statusd limit:1 | head -n 4 | tail -n 1")) + local f = assert(io.popen("/usr/bin/task statusd limit:1 | head -n 4 | tail -n 1 | sed 's/\s\+/ /g'")) local data = f:read("*all") f:close() return data diff --git a/.nvimrc b/.nvimrc index 9024cae..4ec9102 100644 --- a/.nvimrc +++ b/.nvimrc @@ -11,27 +11,30 @@ Plugin 'gmarik/Vundle.vim' Plugin 'tpope/vim-fugitive' " Autocomplete -Plugin 'Shougo/deoplete.nvim' -Plugin 'jiangmiao/auto-pairs' -" Plugin 'Valloric/YouCompleteMe' -" Plugin 'Shougo/unite.vim' +Plugin 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Plugin 'ervandew/supertab' " Plugin 'terryma/vim-multiple-cursors' Plugin 'Lokaltog/vim-easymotion' -" Ruby/Rails +" Languages +Plugin 'rust-lang/rust.vim' Plugin 'tpope/vim-rails' Plugin 'tpope/vim-rake' Plugin 'tpope/vim-bundler' +Plugin 'ledger/vim-ledger' +Plugin 'kchmck/vim-coffee-script' +Plugin 'slim-template/vim-slim' +Plugin 'fatih/vim-go' +Plugin 'wavded/vim-stylus' +Plugin 'tpope/vim-haml' +Plugin 'digitaltoad/vim-jade' +Plugin 'Glench/Vim-Jinja2-Syntax' " Productivity Plugin 'farseer90718/vim-taskwarrior' -" Money -Plugin 'ledger/vim-ledger' - Plugin 'majutsushi/tagbar' Plugin 'L9' @@ -48,9 +51,9 @@ Plugin 'vim-scripts/tlib' " Snippets " Plugin 'garbas/vim-snipmate' -" Plugin 'honza/vim-snippets' Plugin 'Shougo/neosnippet' Plugin 'Shougo/neosnippet-snippets' +Plugin 'honza/vim-snippets' Plugin 'vim-scripts/taglist.vim' @@ -58,15 +61,6 @@ Plugin 'vim-scripts/taglist.vim' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' -" Langs -Plugin 'kchmck/vim-coffee-script' -Plugin 'slim-template/vim-slim' -Plugin 'fatih/vim-go' -Plugin 'wavded/vim-stylus' -Plugin 'tpope/vim-haml' -Plugin 'digitaltoad/vim-jade' -Plugin 'Glench/Vim-Jinja2-Syntax' - " CVS Plugin 'phleet/vim-mercenary' @@ -91,6 +85,7 @@ Plugin 'neomake/neomake' Plugin 'altercation/vim-colors-solarized' Plugin 'airblade/vim-gitgutter' Plugin 'szw/vim-maximizer' +Plugin 'kassio/neoterm' call vundle#end() @@ -186,6 +181,8 @@ let g:neosnippet#snippets_directory='~/.config/nvim/bundle/vim-snippets/snippets autocmd! BufWritePost * Neomake autocmd BufUnload,BufWinLeave * lclose +let g:AutoPairsMultilineClose = 0 + let g:neomake_ruby_enabled_makers = ['rubocop', 'reek'] let g:neomake_open_list = 2 let g:neomake_list_height = 4 @@ -252,6 +249,9 @@ let g:calendar_keys = {'goto_next_month': '', let g:calendar_monday = 1 let g:calendar_focus_today = 1 +" RustFmt rust +let g:rustfmt_autosave = 1 + au BufRead,BufNewFile *.jbuilder setf ruby au BufRead,BufNewFile *.rabl setf ruby au BufRead,BufNewFile *.arb setf ruby @@ -279,6 +279,12 @@ nnoremap n :bn nnoremap l :bn nnoremap d :bd +" Terminal +tnoremap +command Term split term://$SHELL +let g:neoterm_autoinsert = 1 +let g:neoterm_default_mod = 'rightbelow' + " Vim gitgutter let g:gitgutter_sign_added = '█' let g:gitgutter_sign_modified = '█' @@ -364,8 +370,8 @@ set colorcolumn=80,120 set nostartofline " Don’t reset cursor to start of line when moving around. set noeol " Don’t add empty newlines at the end of files -:autocmd InsertEnter * set cul " Show cursor line in insert mode -:autocmd InsertLeave * set nocul " Hide cursor line in insert mode +autocmd InsertEnter * set cul " Show cursor line in insert mode +autocmd InsertLeave * set nocul " Hide cursor line in insert mode " Visual set showmatch " Show matching brackets. diff --git a/.psqlrc b/.psqlrc index 069a763..c8e5bbd 100644 --- a/.psqlrc +++ b/.psqlrc @@ -35,9 +35,6 @@ -- typing them in lower case. \set COMP_KEYWORD_CASE upper --- greeting -\echo '\nWelcome, my magistrate\n' - \set clear '\\! clear;' --helpful queries diff --git a/.zshrc b/.zshrc index bac443b..f2450df 100644 --- a/.zshrc +++ b/.zshrc @@ -28,10 +28,11 @@ setopt AUTO_CD # Вопрос на автокоррекцию # SPROMPT='zsh: Исправить '\''%R'\'' на '\''%r'\'' ? [Yes/No/Abort/Edit] ' -setopt notify globdots pushdtohome cdablevars autolist # correct +setopt notify pushdtohome cdablevars autolist # correct globdots setopt recexact longlistjobs setopt autoresume histignoredups pushdsilent noclobber -setopt autopushd pushdminus rcquotes mailwarning extendedglob +setopt autopushd pushdminus rcquotes mailwarning +setopt no_bare_glob_qual no_extended_glob # End of lines configured by zsh-newuser-install # The following lines were added by compinstall @@ -83,6 +84,7 @@ autoload -U pick-web-browser alias -s {html,htm,mht}=pick-web-browser export LESS="-R" +export PAGER="less" unsetopt nomatch @@ -130,9 +132,10 @@ esac # shopt -s extglob; if [[ -z $DISPLAY ]] && ! pgrep X &>/dev/null; then tput setaf 3; tput bold; read -t 5 -p 'Start X? [Y/n] '; tput sgr0; [[ -z $REPLY || $REPLY = [Yy]?([Ee][Ss]) ]] && startx; fi -export LANGUAGE="en_US:en_GB:en" -export PATH="$HOME/.dynamic-colors/bin:$PATH" -source $HOME/.dynamic-colors/completions/dynamic-colors.zsh +if [ -d $HOME/.dynamic-colors ]; then + export PATH="$HOME/.dynamic-colors/bin:$PATH" + source $HOME/.dynamic-colors/completions/dynamic-colors.zsh +fi # Load all files from .shell/zshrc.d directory if [ -d $HOME/.zshrc.d ]; then diff --git a/.zshrc.d/aliases.zsh b/.zshrc.d/aliases.zsh index 9b13cf5..7e2068a 100644 --- a/.zshrc.d/aliases.zsh +++ b/.zshrc.d/aliases.zsh @@ -2,11 +2,10 @@ alias sdr="screen -aAdr" alias la="ls -A" alias ll="ls -lAF" -alias grep='grep --exclude="*.svn*" --exclude="*.git*"' alias mkpasswd="head -c16 /dev/urandom | xxd -ps" alias mc="mc -b" alias ls='ls --color=auto' -alias less='vimpager' +# alias less='vimpager' if [ -f /usr/bin/grc ]; then alias ping="grc --colour=auto ping" @@ -30,15 +29,22 @@ alias foreman="bundle exec foreman" alias sidekiq="bundle exec sidekiq" alias cap="bundle exec cap" alias mina="bundle exec mina" -alias heroku="$HOME/Soft/heroku-client/bin/heroku" -alias rgrep="grep --exclude-dir=Godeps --exclude-dir=node_modules --exclude-dir=log --exclude-dir=vendor --exclude-dir=tmp --exclude-dir=public --exclude-dir=.git --exclude=.swp -rn" -alias grep="grep --color=auto" -alias wiki="cd ~/wiki && vim index.md" -alias xwiki="cd ~/wiki && xvim index.md" -alias gulp-watch="./node_modules/.bin/gulp watch; notify-send -i error 'Gulp has crashed'" +alias rgrep="grep --exclude-dir=Godeps --exclude-dir=node_modules --exclude-dir=log --exclude-dir=vendor --exclude-dir=tmp --exclude-dir=public --exclude-dir=.git --exclude=.swp -rn" +alias grep="grep --exclude-dir=.git --color=auto" + +alias wiki="cd $HOME/wiki && vim index.md" +alias xwiki="cd $HOME/wiki && xvim index.md" + alias weather="curl wttr.in/Moscow" -alias ag="ag --path-to-ignore ~/.agignore --nogroup" +alias ag="ag --path-to-ignore $HOME/.agignore --nogroup" alias vim="nvim" + +# Typos alias igt="git" alias gti="git" +alias gitst="git st" + +# Ledger +alias ledger="noglob ledger" +alias "bin/ledger"="noglob bin/ledger" diff --git a/.zshrc.d/env.zsh b/.zshrc.d/env.zsh new file mode 100644 index 0000000..5647c3b --- /dev/null +++ b/.zshrc.d/env.zsh @@ -0,0 +1 @@ +export TIMELOG=$HOME/.work-ledger/ledger/timelogger.ldg diff --git a/.zshrc.d/rbenv.zsh b/.zshrc.d/rbenv.zsh index 942b2c2..9d33683 100644 --- a/.zshrc.d/rbenv.zsh +++ b/.zshrc.d/rbenv.zsh @@ -1,7 +1,6 @@ -# rbenv stuff -unset RUBYOPT - -PATH="$HOME/.rbenv/bin:$PATH" -eval "$(rbenv init -)" - -source $HOME/.rbenv/completions/rbenv.zsh +if [ -d $HOME/.rbenv/bin ] ; then + unset RUBYOPT + PATH=$HOME/.rbenv/bin:$PATH + eval "$(rbenv init -)" + source $HOME/.rbenv/completions/rbenv.zsh +fi diff --git a/.zshrc.d/rust.zsh b/.zshrc.d/rust.zsh new file mode 100644 index 0000000..2bdc278 --- /dev/null +++ b/.zshrc.d/rust.zsh @@ -0,0 +1,3 @@ +if [ -d $HOME/.cargo/bin ] ; then + PATH=$HOME/.cargo/bin:$PATH +fi