dot

packages and services management
Log | Files | Refs | README

commit c3df2a73e92ddc77ae62ecf8d4a206ecf6991a02
parent 9eebe1a38e42bb4fd6226977ffdf096dd35c77b3
Author: josuah <mail@josuah.net>
Date:   Mon, 19 Sep 2016 20:52:11 -0400

Updated specs and simplified vim's ruler

Diffstat:
MREADME | 1+
Mbin/filter | 27++++++++++++++++++---------
Mbin/version | 79+++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
Mvim/.vimrc | 3+--
4 files changed, 71 insertions(+), 39 deletions(-)

diff --git a/README b/README @@ -66,3 +66,4 @@ PROJECTS www Website build http://github.com/josuah/josuah.github.io barkdown Not a text markup http://github.com/josuah/barkdown vir WIP editor http://github.com/josuah/vir + complete Completion engine http://github.com/josuah/complete diff --git a/bin/filter b/bin/filter @@ -2,7 +2,7 @@ .' ___\ \/ / // /_ ___ _____ / .'_ /\ / // ___\.'__ \ / ____\ / ___/ / // // / / ____// / - \/ \/ \/ \/ \___\ \/ 2016-09-15 + \/ \/ \/ \/ \___\ \/ 2016-09-19 ================================================================================ Filter lines form stdin to print to stdout using user keyboard input @@ -12,19 +12,14 @@ Filter lines form stdin to print to stdout using user keyboard input The goal is to learn (ANSI) C, and mostly to be able to do interfaces like those of vimperator. - Spaces are considered as a '*' wildchar or '.*' regular - expression. All other characters are interpreted. - The order should be preserved, so that filter to +OPTIONS / FEATURES 2016-09-19 +-------------------------------------------------------------------------------- +Description of the features I will possibly implement. Lower case switches for interface, uppercase switches for input/output. - -OPTIONS / FEATURES 2016-09-18 --------------------------------------------------------------------------------- -Description of the features I will possibly implement. - -p PROMPT Aditionnal part of the prompt to add before the '> '. @@ -100,6 +95,20 @@ KEYBINDINGS 2016-09-18 Ctrl + U Deletes the entire input. +MATCHING 2016-09-19 +-------------------------------------------------------------------------------- + + I like the lines order to be preserved while matching. This can + be convenient to pipe a file through filter, moreover. + + Spaces are considered as a '*' wildchar or '.*' regular + expression. All other characters are consecutive characters + to match. This is hence not a fuzzy matching. There are fzf + and the very good fzy for that + + While numbers are displayed (-n option), the number typed at + the beginning of input match in priority these displayed numbers. + INTERFACE 2016-09-18 -------------------------------------------------------------------------------- diff --git a/bin/version b/bin/version @@ -6,34 +6,57 @@ # \_,' \___\ \/ \___/ \/ \____/ \/ \/ #=============================================================================== # A very very simple version control system tool, made +# +# / The top directory of the project. +# | +# |_ .version Version information. +# | | +# | |_ 2016-01-30-18-20-18 Result of mktemp [1]. +# | |_ 2016-01-30-18-23-39 +# | |_ 2016-01-31-05-25-01 +# | |_ ... +# | | +# | |_ .version Result of find [2]. Use the +# | | same name as the top level to +# | | prevent name clash. +# | | +# | |_ file1.txt Files that changed since previous state. +# | +# |_ README Content of the project at current state. +# |_ src +# | |_ Makefile +# | |_ main.c +# |_ file1.txt +# |_ file2.txt +# |_ ... +# +# commit, c +# Get the previous version of the project, compare all files (cmp) +# and if one differ, copy it to its 'history' dir with current +# date and a hash. +# +# status, s +# Get the files that differ -/ The top directory of the project. -| -|_ .version Version information. -| | -| |_ history History of all changes. -| | -| |_ 2016-01-30-18-20-18-5eOLF Result of mktemp [1]. -| |_ 2016-01-30-18-23-39-j3iuw -| |_ 2016-01-31-05-25-01-lT8xh -| |_ ... -| | -| |_ .version Result of find [2]. -| | -| |_ file1.txt Files that changed since previous state. -| -|_ README Content of the project at current state. -|_ src -| |_ Makefile -| |_ main.c -|_ file1.txt -|_ file2.txt -|_ ... +dir="$(pwd)" +IFS='/' +for directory in $dir +do [ -d "$dir/.version" ] && break || dir="${dir%/*}" + printf '%s\n' "$dir" +done +unset IFS -version commit +if [ -z "$dir" ] +then + printf 'Not in a version directory, no .version directory found.\n' + exit 0 +fi ---- - -[1] mktemp -u "$(date +'%0Y-%0m-%0d-%0H:%0M:%0S')XXXXX" - -[2] . ! -path '*.version/*' +case "$1" in +commit | c) + date="$(date +'%0Y-%0m-%0d-%0H-%0M-%0S-%N')" + mkdir -p ".version/$date" + find . -mindepth 1 ! -path '*/.version/*' ! -name '.version' \ + > $dir/.version/date/.version + ;; +esac diff --git a/vim/.vimrc b/vim/.vimrc @@ -15,7 +15,7 @@ set laststatus=0 " Status set smartcase ignorecase " Case set showmatch " Highlight set list listchars=tab::\ ,trail:.,nbsp:.,extends:>,precedes:< " Listchars -set ruler rulerformat=%40(%#Ruler#\ %t%4m%=%l,%-7(%c%V%)%4P\ %*%) +set ruler rulerformat=%40(%t%4m%=%l,%-7(%c%V%)%4P%) set number numberwidth=5 cursorline nowrap " Interface set scrolloff=3 " Scroll set backupdir=~/.cache/vim// directory=~/.cache/vim// " Backup, cache @@ -60,7 +60,6 @@ iabbrev =_ <Esc>a=<Esc>:set ve=all<CR>v080lhr=:set ve=block<CR>A highlight NonText cterm=bold ctermfg=0 highlight SpecialKey cterm=bold ctermfg=0 highlight Cursorline cterm=bold -highlight Ruler cterm=reverse ctermfg=3 highlight StatusLine cterm=bold ctermfg=3 highlight StatusLineNC cterm=bold ctermfg=7 highlight VertSplit cterm=none ctermfg=7 ctermbg=7