Update 2023-04-06 17:48 OpenBSD/amd64

This commit is contained in:
c0dev0id 2023-04-06 17:48:14 +02:00
parent 1da923cf9d
commit 6dbb2076f6
4 changed files with 31 additions and 52 deletions

View File

@ -19,23 +19,10 @@ test -f ${HOME}/.bin/_config \
test -f "${HISTFILE}" \
|| touch "${HISTFILE}"
HISTDATA="$(while IFS= read -r l; do echo "${#l} $((++n)) $l"; done \
< "${HISTFILE}" \
| sed 's|/$||;s|http[s]\{0,1\}://||' \
| sort -t\| -k 2 -u \
| sort -n \
| cut -d" " -f3-)"
PICKLIST="paste_from_clipboard
pick_from_history
edit_history_file
-----------------
$(echo "${HISTDATA}" \
| cut -b 23- \
| egrep -v ' |^[^a-zA-Z0-9]' \
| grep '..\...'\
)
http://localhost"
PICKLIST="\
paste_from_clipboard
$(< "${HISTFILE}")
"
# show filtered history file
# EXPECTS: $PICKLIST $HISTFILE $DMENU_CMD
@ -43,21 +30,11 @@ http://localhost"
read_input() {
local S=$(printf '%s\n' "${PICKLIST}" \
| ${DMENU_CMD} -p "Bookmarks")
case "${S}" in
paste_from_clipboard)
S=$(xclip -o \
| head -n 1) ;;
pick_from_history)
S=$(sort -r "${HISTFILE}" \
| ${DMENU_CMD} -p "History:" \
|cut -b23-) ;;
edit_history_file)
texec "vim +\$ ${HISTFILE}"
dexec_browser
exit 0 ;;
esac
[ -z "${S}" ] && exit 0
INPUT="${S}"
}
@ -198,8 +175,7 @@ choose_browser() {
}
save_history() {
printf '%s %s\n' "$(date +"%Y-%m-%d %H:%M:%S |")" "${INPUT}" \
>> "${HISTFILE}"
printf '%s\n' "${INPUT}" >> "${HISTFILE}"
}
# main program starts here.

View File

@ -2,8 +2,6 @@
umask 022
JOBS="${JOBS:=$(sysctl -n hw.ncpuonline)}"
export MAKE_JOBS="$JOBS"
export GLOBAL_AUTOCONF_CACHE="/var/ccache/config.cache"
export CCACHE_DIR="/var/ccache"

1
.kshrc
View File

@ -6,6 +6,7 @@
### SEARCH PATHS
PATH=~/.bin\
:~/.local/bin\
:/bin\
:/sbin\
:/usr/bin\

46
.vimrc
View File

@ -6,36 +6,18 @@ set showcmd
set backspace=indent,eol,start
let g:is_posix=1
" file stuff
set undofile
set undodir=~/.local/vim/undo//
set backupdir=~/.local/vim/backup//
set directory=~/.local/vim/swapfiles//
set list
set listchars=tab:»·,trail:•
set fillchars=vert:\|,eob:\
set textwidth=72
set formatprg=par\ -w72q
hi LineNr ctermfg=15
hi EndOfBuffer ctermfg=15
match ErrorMsg '\(TODO\|FIXME\|XXX\|: error:.*\|\s\+$\| \+\ze\t\)'
hi DiffAdd ctermbg=22 ctermfg=NONE cterm=NONE
hi DiffDelete ctermbg=234 ctermfg=NONE cterm=NONE
hi DiffChange ctermbg=234 ctermfg=NONE cterm=NONE
hi DiffText ctermbg=NONE ctermfg=NONE cterm=NONE
hi VertSplit ctermbg=NONE ctermfg=246 cterm=NONE
hi FoldColumn ctermbg=NONE ctermfg=251 cterm=NONE
hi Folded ctermbg=233 ctermfg=251 cterm=NONE
silent execute '!mkdir -p
\ ~/.local/vim/backup
\ ~/.local/vim/undo
\ ~/.local/vim/swapfiles'
" code stuff
set tags="/home/sdk/.dev/tags"
silent execute 'cs add /home/sdk/.dev/cscope.out'
set csprg=cscope\ -C
@ -51,8 +33,12 @@ nnoremap ,i :cs find i <cword><CR>
nnoremap ,a :cs find a <cword><CR>
nnoremap ,b <c-o>
" show special characters
set list
set listchars=tab:»·,trail:•
set fillchars=vert:\|,eob:\
nnoremap # *``
nnoremap n *
augroup code
au!
@ -60,6 +46,24 @@ augroup code
au BufRead,BufNewFile Makefile,/usr/src/*.c,/usr/src/*.h,*.gmk setl sw=8 sts=8 noet
augroup end
" visual sugar
set textwidth=72
set formatprg=par\ -w72q
hi LineNr ctermfg=15
hi EndOfBuffer ctermfg=15
hi DiffAdd ctermbg=22 ctermfg=NONE cterm=NONE
hi DiffDelete ctermbg=234 ctermfg=NONE cterm=NONE
hi DiffChange ctermbg=234 ctermfg=NONE cterm=NONE
hi DiffText ctermbg=NONE ctermfg=NONE cterm=NONE
hi VertSplit ctermbg=NONE ctermfg=246 cterm=NONE
hi FoldColumn ctermbg=NONE ctermfg=251 cterm=NONE
hi Folded ctermbg=233 ctermfg=251 cterm=NONE
match ErrorMsg '\(TODO\|FIXME\|XXX\|: error:.*\|\s\+$\| \+\ze\t\)'
" vi compatible options (from .exrc)
set showmode
set showmatch