From 901207d1651a555cfd45828abd2f441a44be5a7c Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 27 Sep 2020 15:16:30 +0200 Subject: Added dual resolution, minishell_test flags --- .xinitrc | 5 ++++- .zsh_aliases | 4 +++- .zshrc | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.xinitrc b/.xinitrc index fd3a72a..0be482b 100755 --- a/.xinitrc +++ b/.xinitrc @@ -1,4 +1,7 @@ # xinput disable 'ETPS/2 Elantech Touchpad' & +echo 'Starting redshift' redshift -c /home/charles/.config/redshift.conf & +echo 'Starting dunst' dunst & -exec xmonad +echo 'Starting XMonad' +exec xmonad 2>&1 > /dev/null diff --git a/.zsh_aliases b/.zsh_aliases index 5627844..1115abc 100644 --- a/.zsh_aliases +++ b/.zsh_aliases @@ -79,7 +79,7 @@ gpa() { alias lpassp='lpass show --password --clip' # put password in clipboard # helper to switch between dual and single monitor setup -alias dual='xrandr --output LVDS1 --primary --left-of VGA1 --output VGA1 --auto' +alias dual='xrandr --output LVDS1 --primary --left-of VGA1 --output VGA1 --mode 1280x1024' alias single='xrandr --output VGA1 --off' # edit config files @@ -137,3 +137,5 @@ pacman-url() { grep-kill() { ps aux | grep "$1" | tr -s ' ' | cut -d ' ' -f 2 | xargs kill } + +alias filter-valgrind="sed -e 's/==[0-9]*==/==/' -e 's/0x[0-9A-F]*//'" diff --git a/.zshrc b/.zshrc index cc6bd78..f04acbe 100644 --- a/.zshrc +++ b/.zshrc @@ -109,3 +109,4 @@ export GPG_TTY=$(tty) # fixing gpg fatal error about tty export MINISHELL_TEST_BONUS=yes export MINISHELL_TEST_PAGER=vim +export MINISHELL_TEST_FLAGS=-DMINISHELL_TEST -- cgit From cf6bd83b9bc3f739c755516706d6702dc2567550 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 2 Oct 2020 18:55:35 +0200 Subject: Added keyrepeat, ti ignore node_modules --- .vimrc | 20 +++++++++----------- .xinitrc | 4 ++++ .zsh_aliases | 2 +- bin/tag-music | 38 +++++++++++--------------------------- 4 files changed, 25 insertions(+), 39 deletions(-) diff --git a/.vimrc b/.vimrc index 76dd3e9..fc58ac5 100644 --- a/.vimrc +++ b/.vimrc @@ -207,17 +207,15 @@ nnoremap q :call QuickfixToggle() nnoremap n :cnext nnoremap p :cprevious let g:quickfix_is_open = 0 -if !exists('*QuickfixToggle') - function QuickfixToggle() - if g:quickfix_is_open - cclose - let g:quickfix_is_open = 0 - else - copen - let g:quickfix_is_open = 1 - endif - endfunction -endif +function! QuickfixToggle() + if g:quickfix_is_open + cclose + let g:quickfix_is_open = 0 + else + copen + let g:quickfix_is_open = 1 + endif +endfunction " }}} " make {{{ diff --git a/.xinitrc b/.xinitrc index 0be482b..100efcf 100755 --- a/.xinitrc +++ b/.xinitrc @@ -1,7 +1,11 @@ # xinput disable 'ETPS/2 Elantech Touchpad' & + echo 'Starting redshift' redshift -c /home/charles/.config/redshift.conf & echo 'Starting dunst' dunst & + +xset r rate 300 40 + echo 'Starting XMonad' exec xmonad 2>&1 > /dev/null diff --git a/.zsh_aliases b/.zsh_aliases index 1115abc..8535ce5 100644 --- a/.zsh_aliases +++ b/.zsh_aliases @@ -32,7 +32,7 @@ alias ta='tree -a' alias t1='tree -L 1' alias t2='tree -L 2' alias t3='tree -L 3' -# alias ti="tree | grep -v -E '*.pyc'" +alias ti="tree --matchdirs -I __pycache__ -I node_modules -I '*.o'" # man alias ma="man" diff --git a/bin/tag-music b/bin/tag-music index 17d6aac..e801132 100755 --- a/bin/tag-music +++ b/bin/tag-music @@ -16,33 +16,17 @@ do for song_file in "$album_dir"/* do [ ! -f "$song_file" ] && continue - song="$(basename "$song_file" | cut -d '.' -f 1)" - # echo "$artist" - # echo "$album" - # echo "$song" - case "$song_file" in - *.ogg) - ;; - *.opus) - echo "OPUS: $song_file" - echo "Title=$song -Artist=$artist -Album=$album -Track= -Total= -Date= -Genre= -Comment=" | opustags -i -S "$song_file" - ;; - *.mp3) - id3tag --artist "$artist" --album "$album" --song "$song" "$songfile" - ;; - *.m4a) - id3tag --artist "$artist" --album "$album" --song "$song" "$songfile" - ;; - *) - ;; - esac + song="$(basename "$song_file" | rev | cut -d '.' -f 2- | rev)" + # echo $song_file + track=0 + if expr "$song" : "[0-9][0-9]*\-.*" > /dev/null + then + track="$(echo "$song" | cut -d '-' -f 1)" + song="$(echo "$song" | cut -d '-' -f 2-)" + fi + # echo $track $song + echo $song_file + taffy --artist "$artist" --album "$album" --title "$song" --track "$track" "$song_file" done done done -- cgit From 2d9e9f6dbc3bd820d314f5b8b0742ecfb512de7a Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 29 Nov 2020 00:06:11 +0100 Subject: Added newsboat max-items, vim ejs syntax --- .bashrc | 3 +++ .newsboat/config | 2 ++ .pluggins.vim | 3 +++ .vimrc | 10 ++++++---- .zsh_aliases | 11 ++++++++--- .zshrc | 5 +++++ 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.bashrc b/.bashrc index 1cdb55a..bc5b9ab 100644 --- a/.bashrc +++ b/.bashrc @@ -28,3 +28,6 @@ export XDG_DATA_HOME="$HOME/.data/" # vim key bindings set -o vi + +# Added by c_formatter_42 +export PATH="$PATH:/home/charles/git/c_formatter_42" diff --git a/.newsboat/config b/.newsboat/config index 1af63b7..39f7bfe 100644 --- a/.newsboat/config +++ b/.newsboat/config @@ -15,3 +15,5 @@ color listfocus black cyan color listfocus_unread black cyan color info default black color article default default + +max-items 100 diff --git a/.pluggins.vim b/.pluggins.vim index 0db0a3b..ed675c5 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -20,6 +20,7 @@ call plug#begin() Plug 'tikhomirov/vim-glsl' " glsl Plug 'cespare/vim-toml' " toml Plug 'ziglang/zig.vim' " zig + Plug 'nikvdp/ejs-syntax' " ejs " s19 at home Plug 'HappyTramp/vim-42header' " 42 header @@ -35,4 +36,6 @@ call plug#begin() " Plug 'jez/vim-superman' " man pages in vim (too slow) " Plug 'vim-scripts/rfc-syntax' " rfc " Plug 'tacahiroy/ctrlp-funky' " extension to search function + Plug '/home/charles/git/c_formatter_42.vim' + Plug 'cacharle/doxy42.vim' call plug#end() diff --git a/.vimrc b/.vimrc index fc58ac5..804a4f7 100644 --- a/.vimrc +++ b/.vimrc @@ -190,9 +190,9 @@ autocmd Filetype cpp setlocal comments=s:/**,m:**,e:*/,s:/*,m:**,e:*/ " Put Coplien Form boilerplate class function PutCoplienFormFunc(name) let l:default_constructor = a:name . "();\n" - let l:copy_constructor = a:name . "(const " . a:name . "& other);\n" - let l:copy_operator = a:name . "& operator=(const " . a:name . "& other);\n" - let l:destructor = "~" . a:name . "();\n" + let l:copy_constructor = a:name . "(const " . a:name . "& other);\n" + let l:copy_operator = a:name . "& operator=(const " . a:name . "& other);\n" + let l:destructor = "~" . a:name . "();\n" execute "normal iclass " . a:name . "\n{\npublic:\n" . l:default_constructor . l:copy_constructor . l:copy_operator . l:destructor . "\nprivate:\n};\n" execute "normal <2{" @@ -249,7 +249,7 @@ autocmd FileType lisp set shiftwidth=2 " ctrlp {{{ " directory to ignore when searching in file tree -set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/* +set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*,*.pyc " ctrlp ignore all stuff in the .gitignore let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] let g:ctrlp_working_path_mode = 'rw' @@ -276,3 +276,5 @@ let g:ctrlp_mruf_case_sensitive = 0 xmap ga (EasyAlign) nmap ga (EasyAlign) " }}} + +let g:c_formatter_42_format_on_save=0 diff --git a/.zsh_aliases b/.zsh_aliases index 8535ce5..f9b32d0 100644 --- a/.zsh_aliases +++ b/.zsh_aliases @@ -26,7 +26,7 @@ alias lla="ls -alh" alias lss="ls -Ssh" # tree -alias tree='tree -FC' +alias tree='tree -FCA' alias t='tree' alias ta='tree -a' alias t1='tree -L 1' @@ -74,6 +74,11 @@ gpa() { [ -z "$1" ] && branch=master git remote | xargs -I{} git push {} "$branch" } +gpaf() { + branch="$1" + [ -z "$1" ] && branch=master + git remote | xargs -I{} git push -f {} "$branch" +} # lpass (lastpass-cli) alias lpassp='lpass show --password --clip' # put password in clipboard @@ -123,8 +128,8 @@ wificonnect() { # alias mutt='neomutt' alias ytdl='youtube-dl --output "%(title)s.%(ext)s"' -alias ytdlp='youtube-dl -i --output "%(playlist_index)s-%(title)s.%(ext)s"' -alias ytdla='youtube-dl -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"' +alias ytdlp='youtube-dl --audio-format mp3 -i --output "%(playlist_index)s-%(title)s.%(ext)s"' +alias ytdla='youtube-dl --audio-format mp3 -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 f04acbe..5ac0ce1 100644 --- a/.zshrc +++ b/.zshrc @@ -110,3 +110,8 @@ export GPG_TTY=$(tty) # fixing gpg fatal error about tty export MINISHELL_TEST_BONUS=yes export MINISHELL_TEST_PAGER=vim export MINISHELL_TEST_FLAGS=-DMINISHELL_TEST + +# Added by c_formatter_42 +export PATH="$PATH:/home/charles/git/c_formatter_42" + +export MINIKUBE_IN_STYLE=false -- cgit From e43007e0e1b29cc94afc19fcbff0fd473bef63ba Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 6 Dec 2020 11:22:13 +0100 Subject: Added clipboard copy/paste in vim --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 804a4f7..c269fa6 100644 --- a/.vimrc +++ b/.vimrc @@ -277,4 +277,7 @@ xmap ga (EasyAlign) nmap ga (EasyAlign) " }}} +vnoremap c y:call system("xclip -selection clipboard", getreg("\"")) +nnoremap v :call setreg("\"", system("xclip -selection clipboard -o"))p + let g:c_formatter_42_format_on_save=0 -- cgit From 6443f57583e2eafaafeb934479c650036acc85b0 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 6 Dec 2020 14:25:06 +0100 Subject: Added newsboat streaming video macro, more reload threads --- .newsboat/config | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.newsboat/config b/.newsboat/config index 39f7bfe..5361216 100644 --- a/.newsboat/config +++ b/.newsboat/config @@ -1,12 +1,13 @@ -auto-reload yes # reload feeds at startup +# auto-reload yes # reload feeds at startup +reload-threads 8 +max-items 100 +# pager less bind-key j down bind-key k up bind-key g home bind-key G end -# pager less - # solarized color-scheme color background default default color listnormal default default @@ -16,4 +17,4 @@ color listfocus_unread black cyan color info default black color article default default -max-items 100 +macro v set browser "youtube-dl -o - %u | mpv -"; open-in-browser; set browser chromium -- cgit From c2f54cbb339434ac292d6422c94c8697c62cfcd2 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 6 Dec 2020 22:04:04 +0100 Subject: Added xdg applications --- .newsboat/config | 6 +++++- applications/mutt.desktop | 4 ++++ applications/newsboat.desktop | 4 ++++ applications/sxiv.desktop | 4 ++++ applications/zathura.desktop | 4 ++++ bin/bin | 1 + install | 6 ++++++ mimeapps.list | 25 +++++++++++++++++++++++++ 8 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 applications/mutt.desktop create mode 100644 applications/newsboat.desktop create mode 100644 applications/sxiv.desktop create mode 100644 applications/zathura.desktop create mode 120000 bin/bin create mode 100644 mimeapps.list diff --git a/.newsboat/config b/.newsboat/config index 5361216..2818ca4 100644 --- a/.newsboat/config +++ b/.newsboat/config @@ -17,4 +17,8 @@ color listfocus_unread black cyan color info default black color article default default -macro v set browser "youtube-dl -o - %u | mpv -"; open-in-browser; set browser chromium +highlight article "^(Title):.*$" blue default +highlight article "https?://[^ ]+" red default +highlight article "\\[image\\ [0-9]+\\]" green default + +macro v set browser "youtube-dl --cookies /home/charles/youtube.com_cookies.txt -o - %u | mpv -"; open-in-browser; set browser chromium diff --git a/applications/mutt.desktop b/applications/mutt.desktop new file mode 100644 index 0000000..24d0a48 --- /dev/null +++ b/applications/mutt.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Mail client +Exec=/usr/bin/mutt %u diff --git a/applications/newsboat.desktop b/applications/newsboat.desktop new file mode 100644 index 0000000..609bb5a --- /dev/null +++ b/applications/newsboat.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=RSS client +Exec=/usr/bin/newsboat %u diff --git a/applications/sxiv.desktop b/applications/sxiv.desktop new file mode 100644 index 0000000..0db2053 --- /dev/null +++ b/applications/sxiv.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Image viewer +Exec=/usr/local/bin/sxiv %u diff --git a/applications/zathura.desktop b/applications/zathura.desktop new file mode 100644 index 0000000..8c38677 --- /dev/null +++ b/applications/zathura.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=PDF reader +Exec=/usr/bin/zathura %u diff --git a/bin/bin b/bin/bin new file mode 120000 index 0000000..4f8476b --- /dev/null +++ b/bin/bin @@ -0,0 +1 @@ +/home/charles/git/dotfiles/bin \ No newline at end of file diff --git a/install b/install index 013b9bb..ed98aed 100755 --- a/install +++ b/install @@ -38,6 +38,12 @@ create_dotfile_link_same .zprofile mkdir -p "$HOME/.config" create_dotfile_link redshift.conf .config/redshift.conf +create_dotfile_link mimeapps.list .config/mimeapps.list +mkdir -p "$HOME/.local/share/applications" +create_dotfile_link applications/sxiv.desktop .data/applications/sxiv.desktop +create_dotfile_link applications/mutt.desktop .data/applications/mutt.desktop +create_dotfile_link applications/zathura.desktop .data/applications/zathura.desktop +create_dotfile_link applications/newsboat.desktop .data/applications/newsboat.desktop mkdir -p "$HOME/.config/dunst" create_dotfile_link dunst/dunstrc .config/dunst/dunstrc diff --git a/mimeapps.list b/mimeapps.list new file mode 100644 index 0000000..49a184b --- /dev/null +++ b/mimeapps.list @@ -0,0 +1,25 @@ +[Default Applications] + +# from: https://git.lukesmith.xyz/dotfiles/file/.config/mimeapps.list + +# xdg-open will use these settings to determine how to open filetypes. +# These .desktop entries can also be seen and changed in ~/.local/share/applications/ + +# text/x-shellscript=text.desktop; +# x-scheme-handler/magnet=torrent.desktop; +# application/x-bittorrent=torrent.desktop; +x-scheme-handler/mailto=mail.desktop; +# text/plain=text.desktop; +application/postscript=zathura.desktop; +application/pdf=zathura.desktop; + +image/png=sxiv.desktop; +image/jpeg=sxiv.desktop; +image/gif=sxiv.desktop; +image/svg+xml=sxiv.desktop; + +application/rss+xml=newsboat.desktop + +video/x-matroska=mpv.desktop +# x-scheme-handler/lbry=lbry.desktop +# inode/directory=file.desktop -- cgit From ef554a4c34fde7b66c13bc97f8168e432353ed7c Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 7 Dec 2020 15:34:19 +0100 Subject: Added shiftwidth of 2 for html and css files --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index c269fa6..37681a0 100644 --- a/.vimrc +++ b/.vimrc @@ -240,7 +240,7 @@ autocmd Filetype vim setlocal foldmethod=marker autocmd FileType haskell set formatprg=stylish-haskell -autocmd FileType lisp set shiftwidth=2 +autocmd FileType lisp,html,css set shiftwidth=2 " }}} """""""""""" -- cgit From a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 13 Dec 2020 11:16:29 +0100 Subject: Improving feedback on clone with project-open, Updated shiftwidth=2 widht setlocal instead of set to avoid poluting the other buffers, Updated newsboat video stream with mpv to enable going forward/backward --- .newsboat/config | 5 ++++- .vimrc | 2 +- bin/project-open | 24 +++++++++++++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.newsboat/config b/.newsboat/config index 2818ca4..c8238c8 100644 --- a/.newsboat/config +++ b/.newsboat/config @@ -17,8 +17,11 @@ color listfocus_unread black cyan color info default black color article default default + highlight article "^(Title):.*$" blue default highlight article "https?://[^ ]+" red default highlight article "\\[image\\ [0-9]+\\]" green default -macro v set browser "youtube-dl --cookies /home/charles/youtube.com_cookies.txt -o - %u | mpv -"; open-in-browser; set browser chromium +# browser vimb + +macro v set browser "mpv %u"; open-in-browser; set browser chromium diff --git a/.vimrc b/.vimrc index 37681a0..89fb3e5 100644 --- a/.vimrc +++ b/.vimrc @@ -240,7 +240,7 @@ autocmd Filetype vim setlocal foldmethod=marker autocmd FileType haskell set formatprg=stylish-haskell -autocmd FileType lisp,html,css set shiftwidth=2 +autocmd FileType lisp,html,css setlocal shiftwidth=2 " }}} """""""""""" diff --git a/bin/project-open b/bin/project-open index 0dd5d31..955d31d 100755 --- a/bin/project-open +++ b/bin/project-open @@ -1,6 +1,7 @@ #!/bin/sh # shellcheck disable=SC2088 +# (tile does not expand in single quote) dest=$( find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' | sort -r | @@ -15,7 +16,7 @@ dest_path="$HOME/git/$dest" if cd "$dest_path" 2> /dev/null then touch "$dest_path" - st + exec st else while [ -z "$choice" ] do @@ -27,16 +28,25 @@ else mkdir -p "$dest_path" cd "$dest_path" || exit 1 git init + exec st ;; + "clone") - url="$(echo '' | dmenu -p "Entry repository url: ")" - notify-send "Cloning $url to $dest_path" - git clone --recursive "$url" "$dest_path" || - (notify-send -u critical "Clone failed"; exit 1) - cd "$dest_path" || exit 1 + while [ -z "$remote_choice" ] + do + remote_choice=$(printf 'github.com\ncacharle.xyz\nother' | dmenu -p "Remote location") + done + case "$remote_choice" in + "github.com") prefix='git@github.com:cacharle/' ;; + "cacharle.xyz") prefix='git@cacharle.xyz:/srv/git/' ;; + "other") ;; + esac + url="$prefix$(echo "$dest" | dmenu -p "Enter repository url: $prefix")" + st -e /bin/sh -c "git clone --recursive '$url' '$dest_path' && cd '$dest_path' && exec $SHELL" || + notify-send -u critical "Could not clone $url in $dest_path" && exit 1 ;; + "cancel") exit ;; *) exit 1 ;; esac - st fi -- cgit From 3f43577b18d310e182b7d212fe1cfedc99dd9d28 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 30 Dec 2020 12:46:42 +0100 Subject: Added CountScopeLines in vimrc --- .vimrc | 14 ++++++++++++++ .xinitrc | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 89fb3e5..a3a61a0 100644 --- a/.vimrc +++ b/.vimrc @@ -218,6 +218,20 @@ function! QuickfixToggle() endfunction " }}} +function! CountScopeLines() + normal! mq + execute '/^}' + let l:end_brace = line('.') + execute '?^{' + let l:start_brace = line('.') + normal! k + let l:scope_len = l:end_brace - l:start_brace - 1 + let l:scope_name = substitute(getline('.'), '\t', ' ', 'g') + echom l:scope_len . ' lines in |' . l:scope_name . '|' + normal! `q +endfunction +command! CountScopeLines call CountScopeLines() + " make {{{ nnoremap m :make all " }}} diff --git a/.xinitrc b/.xinitrc index 100efcf..d1a873d 100755 --- a/.xinitrc +++ b/.xinitrc @@ -8,4 +8,4 @@ dunst & xset r rate 300 40 echo 'Starting XMonad' -exec xmonad 2>&1 > /dev/null +exec xmonad -- cgit From 5454deef3a0b00f55201135ce5a56112eb410ace Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 6 Jan 2021 10:42:03 +0100 Subject: Added tag search/generate in vim --- .gitignore | 1 + .pluggins.vim | 1 + .vimrc | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e92f57 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tags diff --git a/.pluggins.vim b/.pluggins.vim index ed675c5..6a58b7e 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -12,6 +12,7 @@ call plug#begin() Plug 'tpope/vim-fugitive' " git wrapper Plug 'junegunn/vim-easy-align' " align " Plug 'easymotion/vim-easymotion' " TODO very intresting + Plug 'ludovicchabant/vim-gutentags' " generate tags in project root " markdown preview in browser " Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} diff --git a/.vimrc b/.vimrc index a3a61a0..bb747ff 100644 --- a/.vimrc +++ b/.vimrc @@ -263,11 +263,13 @@ autocmd FileType lisp,html,css setlocal shiftwidth=2 " ctrlp {{{ " directory to ignore when searching in file tree -set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*,*.pyc +set wildignore=*/doc/*,*/tmp/*,*.o,*.so,*.a,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*,*.pyc " ctrlp ignore all stuff in the .gitignore let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] let g:ctrlp_working_path_mode = 'rw' let g:ctrlp_mruf_case_sensitive = 0 + +nnoremap p :CtrlPTag " }}} " quick-scope {{{ @@ -294,4 +296,7 @@ nmap ga (EasyAlign) vnoremap c y:call system("xclip -selection clipboard", getreg("\"")) nnoremap v :call setreg("\"", system("xclip -selection clipboard -o"))p -let g:c_formatter_42_format_on_save=0 +let g:c_formatter_42_format_on_save = 0 + +let g:gutentags_ctags_exclude = ['doc/*', 'Makefile'] +" let g:gutentags_ctags_exclude_wildignore = 1 -- cgit From 167ba112c710b9b1bc0a698dfdf50c874702ce29 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 6 Jan 2021 17:26:57 +0100 Subject: Added $DOTDIR variable check with default value --- .vimrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index bb747ff..75c00f2 100644 --- a/.vimrc +++ b/.vimrc @@ -3,7 +3,11 @@ """""""""" " load pluggins {{{ -source $DOTDIR/.pluggins.vim +if exists("$DOTDIR") + source $DOTDIR/.pluggins.vim +else + source .pluggins.vim +endif " }}} """"""""""" -- cgit From 7dd1593c23ac862be1b8a79bf5534ab3842f9449 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 6 Jan 2021 17:27:18 +0100 Subject: Refactoring install script --- install | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/install b/install index ed98aed..79f9011 100755 --- a/install +++ b/install @@ -2,7 +2,9 @@ create_dotfile_link() { - ln -svf "$DOTDIR/$1" "$HOME/$2" + target="$HOME/$2" + mkdir -vp "$(dirname "$target")" + ln -svf "$DOTDIR/$1" "$target" } create_dotfile_link_same() @@ -22,10 +24,8 @@ create_dotfile_link_same .zshrc create_dotfile_link_same .bashrc create_dotfile_link_same .vimrc create_dotfile_link_same .pluggins.vim -mkdir -p "$HOME/.vim/plugin" create_dotfile_link grep.vim .vim/plugin/grep.vim -mkdir -p "$HOME/.xmonad" create_dotfile_link xmonad.hs .xmonad/xmonad.hs create_dotfile_link_same .gdbinit @@ -36,24 +36,22 @@ create_dotfile_link_same .mailcap create_dotfile_link_same .xinitrc create_dotfile_link_same .zprofile -mkdir -p "$HOME/.config" create_dotfile_link redshift.conf .config/redshift.conf create_dotfile_link mimeapps.list .config/mimeapps.list -mkdir -p "$HOME/.local/share/applications" create_dotfile_link applications/sxiv.desktop .data/applications/sxiv.desktop create_dotfile_link applications/mutt.desktop .data/applications/mutt.desktop create_dotfile_link applications/zathura.desktop .data/applications/zathura.desktop create_dotfile_link applications/newsboat.desktop .data/applications/newsboat.desktop -mkdir -p "$HOME/.config/dunst" create_dotfile_link dunst/dunstrc .config/dunst/dunstrc -mkdir -p "$HOME/.newsboat" create_dotfile_link_same .newsboat/config #create_dotfile_link_same .newsboat/urls # create_dotfile_link_same slock/config.def.h +create_dotfile_link qutebrowser/config.py .config/qutebrowser/config.py + ln -sv "$DOTDIR/bin" "$HOME/bin" ############################################################################### -- cgit From fe6427c21f74b2dab0a5c73dc1ac029d80f4cdff Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 6 Jan 2021 17:27:32 +0100 Subject: Added qutebrowser config --- qutebrowser/config.py | 249 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 qutebrowser/config.py diff --git a/qutebrowser/config.py b/qutebrowser/config.py new file mode 100644 index 0000000..ce83c37 --- /dev/null +++ b/qutebrowser/config.py @@ -0,0 +1,249 @@ +from qutebrowser.api import interceptor + +# Youtueb ad blocking +def filter_yt(info: interceptor.Request): + url = info.request_url + if ( + url.host() == 'www.youtube.com' + and url.path() == '/get_video_info' + and '&adformat=' in url.query() + ): + info.block() + +interceptor.register(filter_yt) + +c.aliases = { + 'q': 'close', + 'sc': 'config-source' +} + +c.url.start_pages = ['https://searx.cacharle.xyz'] +c.url.searchengines = { + 'DEFAULT': 'https://searx.cacharle.xyz?q={}', + 'd': 'https://duckduckgo.com/?q={}', + 'g': 'https://google.com/?q={}', + 'y': 'https://www.youtube.com/results?search_query={}' +} + +c.fonts.default_family = 'Fira Mono' +c.fonts.hints = 'bold 11pt default_family' + +c.hints.chars = 'asdfghjkl;' + +c.statusbar.show = 'in-mode' + +c.editor.command = [ + '/usr/local/bin/st', '-e', + '/usr/bin/vim', '{file}', '+{line}', '-c', 'startinsert!' +] + +c.messages.timeout = 4000 + +config.bind('v', 'hint links spawn /usr/bin/mpv {hint-url}') + + +# base16-qutebrowser (https://github.com/theova/base16-qutebrowser) +# Base16 qutebrowser template by theova +# Solarized Dark scheme by Ethan Schoonover (modified by aramisgithub) +base00 = "#002b36" +base01 = "#073642" +base02 = "#586e75" +base03 = "#657b83" +base04 = "#839496" +base05 = "#93a1a1" +base06 = "#eee8d5" +base07 = "#fdf6e3" +base08 = "#dc322f" +base09 = "#cb4b16" +base0A = "#b58900" +base0B = "#859900" +base0C = "#2aa198" +base0D = "#268bd2" +base0E = "#6c71c4" +base0F = "#d33682" +# set qutebrowser colors +# Text color of the completion widget. May be a single color to use for +# all columns or a list of three colors, one for each column. +c.colors.completion.fg = base05 +# Background color of the completion widget for odd rows. +c.colors.completion.odd.bg = base01 +# Background color of the completion widget for even rows. +c.colors.completion.even.bg = base00 +# Foreground color of completion widget category headers. +c.colors.completion.category.fg = base0A +# Background color of the completion widget category headers. +c.colors.completion.category.bg = base00 +# Top border color of the completion widget category headers. +c.colors.completion.category.border.top = base00 +# Bottom border color of the completion widget category headers. +c.colors.completion.category.border.bottom = base00 +# Foreground color of the selected completion item. +c.colors.completion.item.selected.fg = base05 +# Background color of the selected completion item. +c.colors.completion.item.selected.bg = base02 +# Top border color of the selected completion item. +c.colors.completion.item.selected.border.top = base02 +# Bottom border color of the selected completion item. +c.colors.completion.item.selected.border.bottom = base02 +# Foreground color of the matched text in the selected completion item. +c.colors.completion.item.selected.match.fg = base0B +# Foreground color of the matched text in the completion. +c.colors.completion.match.fg = base0B +# Color of the scrollbar handle in the completion view. +c.colors.completion.scrollbar.fg = base05 +# Color of the scrollbar in the completion view. +c.colors.completion.scrollbar.bg = base00 +# Background color of disabled items in the context menu. +c.colors.contextmenu.disabled.bg = base01 +# Foreground color of disabled items in the context menu. +c.colors.contextmenu.disabled.fg = base04 +# Background color of the context menu. If set to null, the Qt default is used. +c.colors.contextmenu.menu.bg = base00 +# Foreground color of the context menu. If set to null, the Qt default is used. +c.colors.contextmenu.menu.fg = base05 +# Background color of the context menu’s selected item. If set to null, the Qt default is used. +c.colors.contextmenu.selected.bg = base02 +#Foreground color of the context menu’s selected item. If set to null, the Qt default is used. +c.colors.contextmenu.selected.fg = base05 +# Background color for the download bar. +c.colors.downloads.bar.bg = base00 +# Color gradient start for download text. +c.colors.downloads.start.fg = base00 +# Color gradient start for download backgrounds. +c.colors.downloads.start.bg = base0D +# Color gradient end for download text. +c.colors.downloads.stop.fg = base00 +# Color gradient stop for download backgrounds. +c.colors.downloads.stop.bg = base0C +# Foreground color for downloads with errors. +c.colors.downloads.error.fg = base08 +# Font color for hints. +c.colors.hints.fg = base00 +# Background color for hints. Note that you can use a `rgba(...)` value +# for transparency. +c.colors.hints.bg = base0A +# Font color for the matched part of hints. +c.colors.hints.match.fg = base05 +# Text color for the keyhint widget. +c.colors.keyhint.fg = base05 +# Highlight color for keys to complete the current keychain. +c.colors.keyhint.suffix.fg = base05 +# Background color of the keyhint widget. +c.colors.keyhint.bg = base00 +# Foreground color of an error message. +c.colors.messages.error.fg = base00 +# Background color of an error message. +c.colors.messages.error.bg = base08 +# Border color of an error message. +c.colors.messages.error.border = base08 +# Foreground color of a warning message. +c.colors.messages.warning.fg = base00 +# Background color of a warning message. +c.colors.messages.warning.bg = base0E +# Border color of a warning message. +c.colors.messages.warning.border = base0E +# Foreground color of an info message. +c.colors.messages.info.fg = base05 +# Background color of an info message. +c.colors.messages.info.bg = base00 +# Border color of an info message. +c.colors.messages.info.border = base00 +# Foreground color for prompts. +c.colors.prompts.fg = base05 +# Border used around UI elements in prompts. +c.colors.prompts.border = base00 +# Background color for prompts. +c.colors.prompts.bg = base00 +# Background color for the selected item in filename prompts. +c.colors.prompts.selected.bg = base02 +# Foreground color of the statusbar. +c.colors.statusbar.normal.fg = base0B +# Background color of the statusbar. +c.colors.statusbar.normal.bg = base00 +# Foreground color of the statusbar in insert mode. +c.colors.statusbar.insert.fg = base00 +# Background color of the statusbar in insert mode. +c.colors.statusbar.insert.bg = base0D +# Foreground color of the statusbar in passthrough mode. +c.colors.statusbar.passthrough.fg = base00 +# Background color of the statusbar in passthrough mode. +c.colors.statusbar.passthrough.bg = base0C +# Foreground color of the statusbar in private browsing mode. +c.colors.statusbar.private.fg = base00 +# Background color of the statusbar in private browsing mode. +c.colors.statusbar.private.bg = base01 +# Foreground color of the statusbar in command mode. +c.colors.statusbar.command.fg = base05 +# Background color of the statusbar in command mode. +c.colors.statusbar.command.bg = base00 +# Foreground color of the statusbar in private browsing + command mode. +c.colors.statusbar.command.private.fg = base05 +# Background color of the statusbar in private browsing + command mode. +c.colors.statusbar.command.private.bg = base00 +# Foreground color of the statusbar in caret mode. +c.colors.statusbar.caret.fg = base00 +# Background color of the statusbar in caret mode. +c.colors.statusbar.caret.bg = base0E +# Foreground color of the statusbar in caret mode with a selection. +c.colors.statusbar.caret.selection.fg = base00 +# Background color of the statusbar in caret mode with a selection. +c.colors.statusbar.caret.selection.bg = base0D +# Background color of the progress bar. +c.colors.statusbar.progress.bg = base0D +# Default foreground color of the URL in the statusbar. +c.colors.statusbar.url.fg = base05 +# Foreground color of the URL in the statusbar on error. +c.colors.statusbar.url.error.fg = base08 +# Foreground color of the URL in the statusbar for hovered links. +c.colors.statusbar.url.hover.fg = base05 +# Foreground color of the URL in the statusbar on successful load +# (http). +c.colors.statusbar.url.success.http.fg = base0C +# Foreground color of the URL in the statusbar on successful load +# (https). +c.colors.statusbar.url.success.https.fg = base0B +# Foreground color of the URL in the statusbar when there's a warning. +c.colors.statusbar.url.warn.fg = base0E +# Background color of the tab bar. +c.colors.tabs.bar.bg = base00 +# Color gradient start for the tab indicator. +c.colors.tabs.indicator.start = base0D +# Color gradient end for the tab indicator. +c.colors.tabs.indicator.stop = base0C +# Color for the tab indicator on errors. +c.colors.tabs.indicator.error = base08 +# Foreground color of unselected odd tabs. +c.colors.tabs.odd.fg = base05 +# Background color of unselected odd tabs. +c.colors.tabs.odd.bg = base01 +# Foreground color of unselected even tabs. +c.colors.tabs.even.fg = base05 +# Background color of unselected even tabs. +c.colors.tabs.even.bg = base00 +# Background color of pinned unselected even tabs. +c.colors.tabs.pinned.even.bg = base0C +# Foreground color of pinned unselected even tabs. +c.colors.tabs.pinned.even.fg = base07 +# Background color of pinned unselected odd tabs. +c.colors.tabs.pinned.odd.bg = base0B +# Foreground color of pinned unselected odd tabs. +c.colors.tabs.pinned.odd.fg = base07 +# Background color of pinned selected even tabs. +c.colors.tabs.pinned.selected.even.bg = base02 +# Foreground color of pinned selected even tabs. +c.colors.tabs.pinned.selected.even.fg = base05 +# Background color of pinned selected odd tabs. +c.colors.tabs.pinned.selected.odd.bg = base02 +# Foreground color of pinned selected odd tabs. +c.colors.tabs.pinned.selected.odd.fg = base05 +# Foreground color of selected odd tabs. +c.colors.tabs.selected.odd.fg = base05 +# Background color of selected odd tabs. +c.colors.tabs.selected.odd.bg = base02 +# Foreground color of selected even tabs. +c.colors.tabs.selected.even.fg = base05 +# Background color of selected even tabs. +c.colors.tabs.selected.even.bg = base02 +# Background color for webpages if unset (or empty to use the theme's +# color). +# c.colors.webpage.bg = base00 -- cgit From 3ce48c4323f38d3b61a08e7e2add5543adabe5d7 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 7 Jan 2021 21:10:43 +0100 Subject: Added vim Goyo plugin, changed default browser to qutebrowser, Added keybinding to go to next/prev element of command completion in qutebrowser --- .pluggins.vim | 21 ++++++++++++--------- .vimrc | 2 +- .zshrc | 2 +- qutebrowser/config.py | 9 +++++++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.pluggins.vim b/.pluggins.vim index 6a58b7e..49c501d 100644 --- a/.pluggins.vim +++ b/.pluggins.vim @@ -3,16 +3,19 @@ """""""""""""""" call plug#begin() - Plug 'ctrlpvim/ctrlp.vim' " Ctrl-P similar to vsc - Plug 'tpope/vim-eunuch' " basic unix command in vim - Plug 'tomtom/tcomment_vim' " mininal commenter - 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 'tpope/vim-fugitive' " git wrapper - Plug 'junegunn/vim-easy-align' " align + Plug 'ctrlpvim/ctrlp.vim' " Ctrl-P similar to vsc + Plug 'tpope/vim-eunuch' " basic unix command in vim + Plug 'tomtom/tcomment_vim' " mininal commenter + 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 'tpope/vim-fugitive' " git wrapper + Plug 'junegunn/vim-easy-align' " align + Plug 'ludovicchabant/vim-gutentags' " generate tags in project root + Plug 'junegunn/goyo.vim' " generate tags in project root + " " Plug 'easymotion/vim-easymotion' " TODO very intresting - Plug 'ludovicchabant/vim-gutentags' " generate tags in project root + " markdown preview in browser " Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} diff --git a/.vimrc b/.vimrc index 75c00f2..7f59de6 100644 --- a/.vimrc +++ b/.vimrc @@ -166,7 +166,7 @@ nnoremap bl :ls " vimrc {{{ nnoremap rc :vsplit $DOTDIR/.vimrc -nnoremap src :source $MYVIMRC +nnoremap sc :source $MYVIMRC " }}} " c {{{ diff --git a/.zshrc b/.zshrc index 5ac0ce1..50e737f 100644 --- a/.zshrc +++ b/.zshrc @@ -85,7 +85,7 @@ export XDG_DATA_HOME="/home/charles/.data/" export EDITOR="vim" export TERM="st-256color" export MAIL='me@cacharle.xyz' -export BROWSER='chromium' +export BROWSER='qutebrowser' export BROWSERCLI='w3m' # ignore filetypes in autocomplete diff --git a/qutebrowser/config.py b/qutebrowser/config.py index ce83c37..6ab0895 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -30,7 +30,7 @@ c.fonts.hints = 'bold 11pt default_family' c.hints.chars = 'asdfghjkl;' -c.statusbar.show = 'in-mode' +# c.statusbar.show = 'in-mode' c.editor.command = [ '/usr/local/bin/st', '-e', @@ -39,8 +39,13 @@ c.editor.command = [ c.messages.timeout = 4000 -config.bind('v', 'hint links spawn /usr/bin/mpv {hint-url}') +config.bind(';v', 'hint links spawn /usr/bin/mpv {hint-url} ;;' + 'message-info "opening in video player"') +config.bind('', 'completion-item-focus next', 'command') +config.bind('', 'completion-item-focus prev', 'command') + +# c.content.proxy = 'socks://localhost:9050/' # base16-qutebrowser (https://github.com/theova/base16-qutebrowser) # Base16 qutebrowser template by theova -- cgit