From 77be9de6b82ee30fe1a6a3724952dac13a63a495 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 8 Aug 2020 05:44:54 +0200 Subject: Added scripts, vim fugitive/markdown-preview --- .muttrc | 16 +++++++--------- .newsboat/config | 2 +- .pluggins.vim | 5 ++++- .urlview | 1 + .vimrc | 25 ++++++++++++++++++------- .zsh_aliases | 11 ++++++++--- .zshrc | 6 ++++-- README.md | 4 +++- bin/project-open | 31 +++++++++++++++++++++++++++++++ bin/repo-client | 3 +++ xmonad.hs | 4 +++- 11 files changed, 83 insertions(+), 25 deletions(-) create mode 100644 .urlview create mode 100755 bin/project-open create mode 100755 bin/repo-client diff --git a/.muttrc b/.muttrc index f99d798..9393baf 100644 --- a/.muttrc +++ b/.muttrc @@ -36,22 +36,20 @@ set wait_key = no # no press to continue... set forward_format = "Fwd: %s" # forward subject set forward_quote # include previous message in forward -set sidebar_visible = yes -set sidebar_width = 20 -set sidebar_short_path = yes +set sidebar_visible = yes +set sidebar_width = 20 +set sidebar_short_path = yes set sidebar_next_new_wrap = yes -set mail_check_stats -set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?' +set mail_check_stats +set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?' +set ssl_force_tls = yes +set send_charset = 'utf-8' set header_cache = "~/.mutt/cache/headers" set message_cachedir = "~/.mutt/cache/bodies" set certificate_file = "~/.mutt/certificates" -set ssl_force_tls = yes - -set send_charset = 'utf-8' - # solarized color scheme source "$DOTDIR/mutt-colors-solarized/mutt-colors-solarized-dark-16.muttrc" diff --git a/.newsboat/config b/.newsboat/config index 78d0e1d..1af63b7 100644 --- a/.newsboat/config +++ b/.newsboat/config @@ -5,7 +5,7 @@ bind-key k up bind-key g home bind-key G end -pager vim +# pager less # solarized color-scheme color background default default diff --git a/.pluggins.vim b/.pluggins.vim index 78de3f7..f178860 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -9,7 +9,10 @@ call plug#begin() Plug 'itchyny/lightline.vim' " minimal status bar Plug 'HappyTramp/vim-syntax-extra' " syntax highlight of C operators Plug 'romainl/vim-cool' " disable highlight after search - Plug 'iamcco/markdown-preview.vim' " markdown preview in browser + Plug 'tpope/vim-fugitive' " git wrapper + + " markdown preview in browser + Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} " syntax highlight for languages that aren't supported by default Plug 'tikhomirov/vim-glsl' " glsl diff --git a/.urlview b/.urlview new file mode 100644 index 0000000..f69970a --- /dev/null +++ b/.urlview @@ -0,0 +1 @@ +COMMAND $BROWSER %s diff --git a/.vimrc b/.vimrc index b867ed2..ac764ef 100644 --- a/.vimrc +++ b/.vimrc @@ -29,6 +29,7 @@ set wrapmargin=0 " disable auto line wrapping set encoding=utf-8 " utf-8 encoding set formatoptions-=t " do not auto break line > 89 character filetype plugin indent on " allow to add specific rules for certain type of file +set mouse=a " mouse scrolling (heretic) " }}} " browse list with tab {{{ @@ -93,8 +94,18 @@ colorscheme solarized " }}} " lightline {{{ let g:lightline = {} -let g:lightline.colorscheme = 'solarized' " lightline theme to solarized +" let g:lightline.colorscheme = 'solarized' " lightline theme to solarized " let g:lightline.colorscheme = 'jellybeans' " lightline theme to onedark +let g:lightline = { + \ 'colorscheme': 'solarized', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'FugitiveHead' + \ }, + \ } " }}} """""""""""" @@ -143,10 +154,10 @@ nnoremap c, ct, " }}} " buffer navigation {{{ -nnoremap n :bn -nnoremap p :bp +nnoremap bn :bn +nnoremap bp :bp nnoremap :b# -nnoremap l :ls +nnoremap bl :ls " }}} " vimrc {{{ @@ -192,9 +203,9 @@ command! -nargs=1 PutCoplienForm call PutCoplienFormFunc("") " }}} " quickfix window toggle {{{ -nnoremap qt :call QuickfixToggle() -nnoremap qn :cnext -nnoremap qp :cprevious +nnoremap t :call QuickfixToggle() +nnoremap n :cnext +nnoremap p :cprevious let g:quickfix_is_open = 0 if !exists('*QuickfixToggle') function QuickfixToggle() diff --git a/.zsh_aliases b/.zsh_aliases index b77ab60..aec94e1 100644 --- a/.zsh_aliases +++ b/.zsh_aliases @@ -12,7 +12,7 @@ alias valgrindc='colour-valgrind' alias less='less -N' # enable line number alias v='nvim' alias vim='nvim' -alias mkdir='mkdir -p' +# alias mkdir='mkdir -p' alias gdb='gdb -q' # disable long intro message alias sudo='sudo ' # enable color (the search for aliases continues) alias doas='doas ' # same for doas @@ -87,14 +87,14 @@ alias xmonadrc="vim $DOTDIR/xmonad.hs" alias muttrc="vim $DOTDIR/.muttrc" # other -alias date="date -R" +#alias date="date -R" # parent directory jump alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' -alias norm='ruby -I/home/charles/norminette/vendor/bundle/ruby/2.7.0/gems/parseconfig-1.0.8/lib/ ~/norminette/norminette.rb' +alias norm='ruby -I/home/charles/git/norminette/vendor/bundle/ruby/2.7.0/gems/parseconfig-1.0.8/lib/ ~/git/norminette/norminette.rb' getrfc() { curl "https://ietf.org/rfc/rfc$1.txt" > "$HOME/rfc/rfc$1.txt" @@ -112,3 +112,8 @@ alias cagob='RUSTFLAGS="$RUSTFLAGS -A dead_code" cargo build' alias cagor='RUSTFLAGS="$RUSTFLAGS -A dead_code" cargo run' # alias mutt='neomutt' + +alias ytdl='youtube-dl' +alias ytdla='youtube-dl -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"' + +alias qmvdest='qmv --format=do' diff --git a/.zshrc b/.zshrc index d21278f..8cf539c 100644 --- a/.zshrc +++ b/.zshrc @@ -102,5 +102,7 @@ tabs 4 export LFS=/mnt -export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:$HOME/bin" -export PATH="$PATH:$HOME/.vim/plugged/vim-superman/bin" +export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:$DOTDIR/bin" +# export PATH="$PATH:$HOME/.vim/plugged/vim-superman/bin" + +export GPG_TTY=$(tty) # fixing gpg fatal error about tty diff --git a/README.md b/README.md index a8a1825..8daca94 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,10 @@ * [vim](https://github.com/vim/vim) - terminal text editor * [zsh](https://www.zsh.org/) - interactive shell * [xmonad](https://xmonad.org) - window manager -* [redshift](https://github.com/jonls/redshift) - change screen color temperature +* [redshift](http://jonls.dk/redshift/) - change screen color temperature * [mutt](http://www.mutt.org/) - email client +* [newsboat](https://newsboat.org/) - RSS feed reader +* [moc](https://moc.daper.net/) - music player ## School 19 Config diff --git a/bin/project-open b/bin/project-open new file mode 100755 index 0000000..a4bf523 --- /dev/null +++ b/bin/project-open @@ -0,0 +1,31 @@ +#!/bin/sh + +# shellcheck disable=SC2088 +dest=$( + find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' | + sort -r | + cut -f 2 | + dmenu -l 10 -p '~/git/' +) + +[ -z "$dest" ] && exit 1 + +if cd "$HOME/git/$dest" 2> /dev/null +then + touch "$HOME/git/$dest" + st +else + while [ -z "$choice" ] + do + choice=$(printf 'yes\nno\n' | dmenu -p "Create a repository at ~/git/$dest?") + done + + case "$choice" in + "no") exit ;; + "yes") mkdir -p "$HOME/git/$dest" ;; + *) exit 1 ;; + esac + cd "$HOME/git/$dest" || exit 1 + git init + st +fi diff --git a/bin/repo-client b/bin/repo-client new file mode 100755 index 0000000..49049d8 --- /dev/null +++ b/bin/repo-client @@ -0,0 +1,3 @@ +#!/bin/sh + +ssh git@cacharle.xyz repo $* diff --git a/xmonad.hs b/xmonad.hs index 2d2c630..188a458 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -40,7 +40,9 @@ myKeys = [ ("", spawn "pulseaudio-ctl up") -- volume u , ("", spawn "light -U 5") -- backlight down , ("", spawn "slock") -- lock screen - , ("M-o", spawn "/home/charles/bin/project-open") -- TODO could could be generalized + , ("M-o", spawn "~/git/dotfiles/bin/project-open") -- TODO could could be generalized , ("M-S-o", spawn "cd ~/test && st") , ("M-d", spawn "cd ~/Downloads && st") + , ("M-m", spawn "st -e mocp") + , ("M-S-d", spawn "notify-send \"$(date +\"%H:%M %A %d/%m/%Y %B\")\"") ] -- cgit