rm trailing newline and optimize script
This commit is contained in:
parent
33f4648c23
commit
b4a7f847fc
3 changed files with 13 additions and 8 deletions
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Open URLs from bookmarks file
|
# Open URLs from bookmarks file
|
||||||
|
BOOKMARKS="$HOME/Documents/bookmarks"
|
||||||
|
|
||||||
# Print site names, then get URL based on the name. Exit if empty
|
# Print site names, then get URL based on the name. Exit if empty
|
||||||
name=$(cut -d '-' -f 1 $HOME/Documents/bookmarks | grep -v '^#' | sed '/^\s*$/d' | menu "Site:")
|
name="$(grep -v '^Watch\slater:\s.*' "$BOOKMARKS" | sed '/^\s*$/d;/^#.*$/d;s/-.*$//g' | menu "Site:")"
|
||||||
[ -z "$name" ] && exit
|
[ -z "$name" ] && exit
|
||||||
|
|
||||||
grep "$name" $HOME/Documents/bookmarks | cut -d '-' -f 2- | tr -d '\n' |
|
grep "$name" $BOOKMARKS | sed -z 's/^.*-//g;s/\n//g' |
|
||||||
xsel -ib && notify-send " Bookmarks" "'$name' copied to clipboard"
|
xsel -ib && notify-send " Bookmarks" "'$name' copied to clipboard"
|
||||||
|
|
|
@ -28,6 +28,6 @@ HISTTIMEFORMAT="%F %T "
|
||||||
history |
|
history |
|
||||||
head -n -1 |
|
head -n -1 |
|
||||||
fzf --cycle --height=50% --border top --tac --prompt='⯈ ' |
|
fzf --cycle --height=50% --border top --tac --prompt='⯈ ' |
|
||||||
sed -z 's/^.*:[0-9]*\s*//g;s/\s*$//g' |
|
sed -z 's/^.*:[0-9]*\s*//g;s/\s*$//g;s/\n//g' |
|
||||||
xsel -ib
|
xsel -ib
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,17 +14,21 @@ silent! normal! zE
|
||||||
22,37fold
|
22,37fold
|
||||||
38,43fold
|
38,43fold
|
||||||
44,46fold
|
44,46fold
|
||||||
55,60fold
|
55,63fold
|
||||||
70,73fold
|
73,76fold
|
||||||
82,94fold
|
85,87fold
|
||||||
|
88,90fold
|
||||||
|
91,97fold
|
||||||
|
106,111fold
|
||||||
let &fdl = &fdl
|
let &fdl = &fdl
|
||||||
let s:l = 5 - ((4 * winheight(0) + 23) / 47)
|
let s:l = 116 - ((68 * winheight(0) + 23) / 47)
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
if s:l < 1 | let s:l = 1 | endif
|
||||||
keepjumps exe s:l
|
keepjumps exe s:l
|
||||||
normal! zt
|
normal! zt
|
||||||
keepjumps 5
|
keepjumps 116
|
||||||
normal! 0
|
normal! 0
|
||||||
let &g:so = s:so_save | let &g:siso = s:siso_save
|
let &g:so = s:so_save | let &g:siso = s:siso_save
|
||||||
set hlsearch
|
set hlsearch
|
||||||
|
nohlsearch
|
||||||
doautoall SessionLoadPost
|
doautoall SessionLoadPost
|
||||||
" vim: set ft=vim :
|
" vim: set ft=vim :
|
||||||
|
|
Loading…
Reference in a new issue