dot

packages and services management
Log | Files | Refs | README

commit 0ee544e90fb803e96da0bc63d063da8ed3b41ae4
parent c3df2a73e92ddc77ae62ecf8d4a206ecf6991a02
Author: josuah <mail@josuah.net>
Date:   Mon, 19 Sep 2016 21:32:45 -0400

Updated vim config

Diffstat:
Dbin/complete | 51---------------------------------------------------
Mbin/version | 43++++++++++++++++++++++++++++++-------------
Mvim/.vimrc | 8++++++--
3 files changed, 36 insertions(+), 66 deletions(-)

diff --git a/bin/complete b/bin/complete @@ -1,51 +0,0 @@ -#!/bin/sh -# /\ /\ -# ____ ____ ________ ____ / / ___ / /_ ___ -# / ___\ / __ \ / __ __ \ / __ \ / /.'__ \ / ___\.'__ \ -# / /__ / /_/ // / / / / // /_/ // // ____// / / ____/ -# \____\ \____/ \/ \/ \// ____/ \/ \___\ \/ \___\ -#=========================\/==================================================== -# Complete string with a word from a file. - -help=' -NAME - Complete - complete word or line from stdin with candidates from a file -USAGE - complete OPTION FILE - -DESCRIPTION - STDIN part to match from the words, and to remove from the candidates. - FILE file to search candidates from -OPTION - -w complete by word - -l complete by line -' NL=' -' - -[ "$#" = 0 ] && printf '%s\n' "$help" && exit 0 -while [ "$#" -gt 0 ] -do - case "$1" in - -w | -l ) ACTION="$1" ;; - -* ) printf '%s\n' "$help" && exit 0 ;; - * ) FILE="$1" ;; - esac - - shift -done - -PREFIX="$(tee)" - -case "$ACTION" in --w ) - sed 's/[[:space:]]/\n/g' "$FILE" | sort -u | while read word - do [ -z "${word##$PREFIX*}" ] && printf '%s\n' "$word" - done | fzy | { - IFS="$NL" read -r word - printf '%s\n' "$word" - } - ;; --l ) - fzy -q "$PREFIX" < "$FILE" - ;; -esac diff --git a/bin/version b/bin/version @@ -5,7 +5,7 @@ # \ \/ // ____// / __\ \ / // /_/ // / / / # \_,' \___\ \/ \___/ \/ \____/ \/ \/ #=============================================================================== -# A very very simple version control system tool, made +# A very very simple version control system and tool. # # / The top directory of the project. # | @@ -38,13 +38,35 @@ # status, s # Get the files that differ -dir="$(pwd)" -IFS='/' -for directory in $dir -do [ -d "$dir/.version" ] && break || dir="${dir%/*}" - printf '%s\n' "$dir" + +# FUNCTIONS +#------------------------------------------------------------------------------- + +changes() +{ + local from="$1" # History node from which to search difference +} + +commit() +{ + local date="$(date +'%0Y-%0m-%0d-%0H-%0M-%0S-%N')" + mkdir -p ".version/$date" + find . -mindepth 1 ! -path '*/.version/*' ! -name '.version' \ + > $dir/.version/date/.version +} + + +# ALGORYTHM +#------------------------------------------------------------------------------- + +# Check whether current or parent directory has a '.version' directory. + +DIR="$(pwd)" +while : +do + [ -z "$DIR" ] || [ -d "$DIR/.version" ] && break || DIR="${DIR%/*}" + printf '%s\n' "$DIR" done -unset IFS if [ -z "$dir" ] then @@ -53,10 +75,5 @@ then fi 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 - ;; +commit | c) commit ;; esac diff --git a/vim/.vimrc b/vim/.vimrc @@ -21,6 +21,7 @@ set scrolloff=3 " Scroll set backupdir=~/.cache/vim// directory=~/.cache/vim// " Backup, cache set virtualedit=block set formatprg=fmt +set wildmenu wildmode=longest:full " Completion " MAPPINGS 2016-09-18 @@ -29,8 +30,10 @@ set formatprg=fmt let mapleader = ' ' nmap <leader><leader> : -nmap <leader>s :set <c-d> -nmap <leader>w :w<cr> +nmap <leader>s :set <c-d> +nmap <leader>w :w<cr> +nmap <leader>b :pwd \| echo '' \| ls \| echo ''<cr>:b +nmap <leader>h :help nmap <leader>/ :exec ':'.system("swiper '".expand("%:p")."'") \| redraw!<cr> nmap col :set list !<cr> :set list ?<cr> @@ -38,6 +41,7 @@ nmap con :set number !<cr> :set number ?<cr> nmap cop :set paste !<cr> :set paste ?<cr> nmap coh :set hlsearch !<cr> :set hlsearch ?<cr> nmap cov :set ve=<c-r>=(&ve =~# "all") ? 'block' : 'all'<cr><cr>:set ve ?<cr> +nmap cos :if exists("g:syntax_on") \| sy off \| else \| sy enable \| end<cr> nmap cot :set tw=<c-r>=(&tw =~# "80" ) ? '0' : '80' <cr><cr>:set tw ?<cr> nmap [<leader> mzO<Esc>k`z<C-e>