diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2020-10-20 20:20:00 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2020-10-20 20:20:00 -0400 |
commit | 376d1b4a26da960f3fdec20a7c0b2b27c34738f7 (patch) | |
tree | 0adc7be5f398128c48f91588494e75382bf454c5 | |
parent | 6254a5d23acc96ef70d3a4427b435ed45d7975a2 (diff) |
Yank and move now integrated to vifm
-rw-r--r-- | .config/vifm/vifmrc | 2 | ||||
-rwxr-xr-x | .local/bin/shortcutgen | 23 |
2 files changed, 17 insertions, 8 deletions
diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index aefd97c..18e136e 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -237,6 +237,8 @@ nnoremap gg ggj " Quick shortcuts to some dirs source ~/.cache/vifm-shortcuts + +" Easily go back home nnoremap cd :cd<cr> diff --git a/.local/bin/shortcutgen b/.local/bin/shortcutgen index aa4a452..8f4cf6b 100755 --- a/.local/bin/shortcutgen +++ b/.local/bin/shortcutgen @@ -4,7 +4,7 @@ raw=$(cat $HOME/.config/shortcutrc | tail -n +19 "$HOME/.config/shortcutrc" | sed "s/^|\s*//g; s/\(.*\)|\(.*\)|\(.*\)|/\1|\2|\3/g; s/\s*$//g; - /^$/d") + /^$/d" | head -n -1) # #---NERDTREE---# # echo "$raw" | sed "s/\(.*\)\s*|.*|\s\(.*\)/\1\2/g; s/ \{1,\}/ /g; @@ -38,17 +38,24 @@ echo "$raw" | sed 's/[A-z,a-z,0-9]*\s*|\s*/g/; # #---Vifm---# # vifm=$(echo "$raw" | sed " s/^[A-Z,a-z,0-9]*\s*|//; - s/|/:cd/; s/\$HOME/~/; - s/^-.*//" + s/$/<cr>/" ) -vifmgo=$( echo "$vifm" | sed " - s/\s*/nnoremap\ g/; - s/$/<cr>/" +vifmcd=$( echo "$vifm" | sed " + s/^\s*/nnoremap\ g/; + s/|/:cd/;" ) -echo "$vifmgo" > ~/.cache/vifm-shortcuts +vifmv=$( echo "$vifm" | sed " + s/^\s*/nnoremap\ m/; + s/|/:move/") +vifmy=$( echo "$vifm" | sed " + s/^\s*/nnoremap\ y/; + s/|/:copy/") +echo "$vifmcd\n\n$vifmv\n\n$vifmy" > ~/.cache/vifm-shortcuts # #---Testing---# # # echo "$raw" | sed "s/[A-z,a-z,0-9]*\s*|//" -# echo "$raw" +clear +# echo "$vifmv" +cat ~/.cache/vifm-shortcuts |