From 444e6e1ce8e8bd01aca566c1f4bb8a3f870586c5 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 6 Oct 2017 14:28:47 +0200 Subject: [PATCH 01/11] Added 'z' fish shell plugin --- .config/fish/fishfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/fish/fishfile b/.config/fish/fishfile index 6c68a89..13c6386 100644 --- a/.config/fish/fishfile +++ b/.config/fish/fishfile @@ -4,3 +4,4 @@ fisherman/getopts oh-my-fish/plugin-grc fisherman/nvm fisherman/shark +fisherman/z From 8edad9d0abe3e864eda101fc7196c1ddcbb03068 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 13 Oct 2017 11:41:12 +0200 Subject: [PATCH 02/11] Fixed find crashing https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873032 --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index cee9edc..7657dba 100644 --- a/.bashrc +++ b/.bashrc @@ -171,7 +171,7 @@ if [ -e ~/.ssh/config.d ]; then #if find ~/.ssh/config.d -mindepth 1 -print -quit | grep -q .; then # Do we have config files in that directory? if find ~/.ssh/config.d -print -quit | grep -q .; then - newestconfig=$(find ~/.ssh/config.d/* -printf '%T+ %p\n' | sort -r | head -n1 | awk '{print $2}') + newestconfig=$(find ~/.ssh/config.d/* -printf '@T+ %p\n' | sort -r | head -n1 | awk '{print $2}') if [ "$newestconfig" -nt ~/.ssh/config ]; then # We found a config that's newer than the generated config file, re-generate [ -e ~/.ssh/config ] && mv ~/.ssh/config ~/.ssh/config.bak.$(date -Ins) From b3354f4d66f159c0d99e8ac55b541e261f887219 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 24 Oct 2017 06:48:27 +0200 Subject: [PATCH 03/11] Replacing syntastic with ALE --- .vimrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index e155441..a4b670a 100644 --- a/.vimrc +++ b/.vimrc @@ -156,7 +156,7 @@ Plugin 'Valloric/YouCompleteMe' " Code checker. For python, install flake8 or pylint, preferably in the " virtualenv. For Django support, install pylint-django -Plugin 'vim-syntastic/syntastic' +"Plugin 'vim-syntastic/syntastic' set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* @@ -187,6 +187,11 @@ let g:syntastic_python_pylint_post_args="--max-line-length=120 -d C0103,C0111" "let g:syntastic_python_pylint_exe = 'python $(which pylint)' +" Code checker. For python, install flake8 or pylint, preferably in the +" virtualenv. For Django support, install pylint-django +Plugin 'w0rp/ale' + + " Handy Markdown stuff "Plugin 'tpope/vim-markdown' Plugin 'godlygeek/tabular' From 25bf46c1a12d83c6ea0bc811a6a126271a0e611a Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 31 Oct 2017 06:34:25 +0100 Subject: [PATCH 04/11] Airline support for error checker --- .vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc b/.vimrc index a4b670a..5676bbb 100644 --- a/.vimrc +++ b/.vimrc @@ -190,6 +190,8 @@ let g:syntastic_python_pylint_post_args="--max-line-length=120 -d C0103,C0111" " Code checker. For python, install flake8 or pylint, preferably in the " virtualenv. For Django support, install pylint-django Plugin 'w0rp/ale' +" Show errors or warnings in the statusline +let g:airline#extensions#ale#enabled = 1 " Handy Markdown stuff From 4fa47ffea90baac407a88a4f1f59d509fd1fed50 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 31 Oct 2017 06:34:50 +0100 Subject: [PATCH 05/11] Support for both prefix and 'count from behind' --- bin/sorter | 77 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 12 deletions(-) diff --git a/bin/sorter b/bin/sorter index cbe6c71..0885f80 100755 --- a/bin/sorter +++ b/bin/sorter @@ -4,18 +4,71 @@ # E.g., log_1.txt log_2.txt have a common prefix 'log' with length 3, so # `sorter 3` will create dir 'log' and move both files there -LIMIT=6 -if [ ! -z "$1" ]; then - LIMIT=$1 +if [ ! -z "$2" ] && [ ! -z "$1" ]; then + LIMIT=$2 +elif [ -z "$2" ] && [ ! -z "$1" ]; then + echo "Provide a length for the prefix or strip-from-behind" + exit fi -for PATTERN in $(ls -1|cut -c 1-$LIMIT|sort|uniq); do - echo $PATTERN - mkdir -p "$PATTERN" - # mv does not work :) - #mv "${PATTERN}*.*" "$PATTERN/" - for FILE in $(find . -type f | grep "$PATTERN"); do - echo $FILE - mv "$FILE" "${PATTERN}/" +if [ "$1" == "f" ]; then + # From the front + for PATTERN in $(find . -maxdepth 1 -type f|cut -c 3-$((LIMIT + 2))|sort|uniq); do + # Offset LIMIT by two to skip the './' in front of every filename + echo $PATTERN + mkdir -p "$PATTERN" + # mv does not work :) + #mv "${PATTERN}*.*" "$PATTERN/" + for FILE in $(find . -maxdepth 1 -type f | grep "$PATTERN"); do + #echo $FILE + mv "$FILE" "${PATTERN}/" + done done -done +elif [ "$1" == "fe" ]; then + # From the front + for PATTERN in $(find . -maxdepth 1 -type f|cut -c 3-$((LIMIT + 2))|sort|uniq); do + echo $PATTERN + #for FILE in $(find . -maxdepth 1 -type f | grep "$PATTERN"); do + # echo $FILE + #done + done +elif [ "$1" == "b" ]; then + # From the back + for PATTERN in $(find . -maxdepth 1 -type f|rev|cut -c $LIMIT-|rev|sort|uniq); do + echo $PATTERN + mkdir -p "$PATTERN" + + for FILE in $(find . -maxdepth 1 -type f | grep "$PATTERN"); do + #echo $FILE + mv "$FILE" "${PATTERN}/" + done + done +elif [ "$1" == "be" ]; then + # From the back + for PATTERN in $(find . -maxdepth 1 -type f|rev|cut -c $LIMIT-|rev|sort|uniq); do + echo $PATTERN + #for FILE in $(find . -maxdepth 1 -type f | grep "$PATTERN"); do + # echo $FILE + #done + done +else + echo "sorter - Files-into-structured-directories sorter" + echo + echo "Sort files with a prefix of LIMIT length into dirs with the same name" + echo "as the prefix" + echo "E.g., log_1.txt log_2.txt have a common prefix 'log' with length 3," + echo "so 'sorter 3' will create dir 'log' and move both files there" + echo + echo "usage: sorter OPTION LIMIT" + echo + echo "OPTION:" + echo " f create directories based on the prefix from the front LIMIT" + echo " characters" + echo " fe emulate the above, print would-be results" + echo " b create directories based on the prefix that's left when stripping" + echo " LIMIT characters from the back" + echo " be emulate the above, print would-be results" + echo + echo "LIMIT: length of prefix or strip-from-behind" + echo +fi From 720686bd58ce9f8daad4749e546cd510cb7dc91b Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 3 Nov 2017 13:27:42 +0100 Subject: [PATCH 06/11] Some ALE configuration --- .vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.vimrc b/.vimrc index 5676bbb..78d3563 100644 --- a/.vimrc +++ b/.vimrc @@ -190,8 +190,13 @@ let g:syntastic_python_pylint_post_args="--max-line-length=120 -d C0103,C0111" " Code checker. For python, install flake8 or pylint, preferably in the " virtualenv. For Django support, install pylint-django Plugin 'w0rp/ale' +" Python specific setting +let g:ale_python_pylint_options="--max-line-length=120 -d C0103,C0111" " Show errors or warnings in the statusline let g:airline#extensions#ale#enabled = 1 +" UI +let g:ale_sign_error = '✗' +let g:ale_sign_warning = '⚠' " Handy Markdown stuff From 1bf763b971df9a307edd3ebfc79c1e0590b12dab Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 3 Nov 2017 13:33:23 +0100 Subject: [PATCH 07/11] Clarify what's going on here --- .vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 78d3563..ec3cc3b 100644 --- a/.vimrc +++ b/.vimrc @@ -190,7 +190,8 @@ let g:syntastic_python_pylint_post_args="--max-line-length=120 -d C0103,C0111" " Code checker. For python, install flake8 or pylint, preferably in the " virtualenv. For Django support, install pylint-django Plugin 'w0rp/ale' -" Python specific setting +" Python specific settings +" No silly 80-char line limit. Sorry pep-8. Also, Django support. Disable 'invalid name', 'missing docstring' let g:ale_python_pylint_options="--max-line-length=120 -d C0103,C0111" " Show errors or warnings in the statusline let g:airline#extensions#ale#enabled = 1 From aa1cefc78ed8186efb64038dbfb6246295ce9f57 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 3 Nov 2017 14:05:08 +0100 Subject: [PATCH 08/11] Python import fixer, quickly open info pane --- .vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.vimrc b/.vimrc index ec3cc3b..32c4d92 100644 --- a/.vimrc +++ b/.vimrc @@ -190,7 +190,12 @@ let g:syntastic_python_pylint_post_args="--max-line-length=120 -d C0103,C0111" " Code checker. For python, install flake8 or pylint, preferably in the " virtualenv. For Django support, install pylint-django Plugin 'w0rp/ale' +nmap = (ale_fix) +" Quickly open the loclist to see syntax errors +nmap ; :lopen +let g:ale_fixers = {} " Python specific settings +let g:ale_fixers.python = ['isort'] " No silly 80-char line limit. Sorry pep-8. Also, Django support. Disable 'invalid name', 'missing docstring' let g:ale_python_pylint_options="--max-line-length=120 -d C0103,C0111" " Show errors or warnings in the statusline From a829db3042c94e6539dca9e1175d4b6b356964b5 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 3 Nov 2017 14:05:34 +0100 Subject: [PATCH 09/11] Move Leader key config so it gets picked up correctly by plugins --- .vimrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 32c4d92..e5818ec 100644 --- a/.vimrc +++ b/.vimrc @@ -6,6 +6,9 @@ set shell=/bin/bash +" change the key from \ to , +let mapleader="," + " Vundle manages the plugins " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim @@ -280,8 +283,6 @@ set list set dictionary+=/usr/share/dict/words " use ctrl-n ctrl-n instead of ctrl-x ctrl-k set complete-=k complete+=k -" change the key from \ to , -let mapleader="," " Quickly edit/reload the vimrc file nmap ev :e $MYVIMRC nmap sv :so $MYVIMRC From c9a9bb7fabbc656739529c51baf885eb135c711b Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 3 Nov 2017 17:08:41 +0100 Subject: [PATCH 10/11] Set a filesize limit --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index e5818ec..14eb6f2 100644 --- a/.vimrc +++ b/.vimrc @@ -196,6 +196,7 @@ Plugin 'w0rp/ale' nmap = (ale_fix) " Quickly open the loclist to see syntax errors nmap ; :lopen +let g:ale_maximum_file_size = 500000 " Don't lint large files (> 500KB), it can slow things down let g:ale_fixers = {} " Python specific settings let g:ale_fixers.python = ['isort'] From fa7fb8cb20778668ff4f14456611b6c99b06be18 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 6 Nov 2017 11:42:36 +0100 Subject: [PATCH 11/11] Because reasons --- .gitconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitconfig b/.gitconfig index e371364..a7e8025 100644 --- a/.gitconfig +++ b/.gitconfig @@ -17,6 +17,7 @@ ci = commit br = branch c = commit -am + shame = blame [push] default = simple