aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRatakor <ratakor@disroot.org>2023-07-12 00:18:05 +0200
committerRatakor <ratakor@disroot.org>2023-07-12 00:18:05 +0200
commit6052679ba19c7da25321dc4687320729d3a7606a (patch)
treecb9405fd614b58b3b4f3a6b90c90d1e9bb2723ab
parentf9b1fb4a3f82525f964a3b3a5f904d193b2761a5 (diff)
* Replace man-db with mandoc
Remove anki from Makefile. Remove csharp from nvim, env and pkg. Add go config to nvim. Temporarly patch dmenusearch to work with mandoc.
-rw-r--r--.local/Makefile11
-rwxr-xr-x.local/bin/dmenusearch13
-rwxr-xr-x.local/bin/manpager2
-rwxr-xr-x.local/bin/music2
-rwxr-xr-x.local/bin/musiccmd7
-rw-r--r--.local/etc/nvim/appearance.vim8
-rw-r--r--.local/etc/nvim/basics.vim8
-rw-r--r--.local/etc/nvim/init.vim5
-rw-r--r--.local/etc/nvim/lsp.vim2
-rw-r--r--.local/etc/zsh/.zshenv6
-rw-r--r--.local/etc/zsh/.zshrc2
-rw-r--r--.local/etc/zsh/aliasrc2
-rw-r--r--.local/share/packages3
13 files changed, 38 insertions, 33 deletions
diff --git a/.local/Makefile b/.local/Makefile
index 3f17c30..0bc5e37 100644
--- a/.local/Makefile
+++ b/.local/Makefile
@@ -8,8 +8,6 @@ packages:
@curl -s https://raw.githubusercontent.com/Ratakor/ratakor-repo/master/setup | ${ROOTCMD} sh
@printf '\033[34;1mInstall all packages\033[m\n'
@yes | LC_ALL=C ${ROOTCMD} pacman -Syu --needed $(shell sed 's/#.*//' share/packages)
- @printf '\033[34;1mUpdate man database, it may take some time\033[m\n'
- @${ROOTCMD} mandb 2>/dev/null 1>&2
@printf '\033[34;1mChange %s shell to zsh\033[m\n' "$$USER"
@chsh -s /bin/zsh >/dev/null
@printf '\033[34;1mChange ZDOTDIR to not have a symlink in $$HOME\033[m\n'
@@ -34,11 +32,4 @@ wallpapers:
printf '\033[33;1mWallpaper folder already exists\033[m\n'||\
git clone https://github.com/ratakor/wallpapers ${PREFIX}/share/wallpapers
-anki:
- rm -rf anki-*
- curl -LO "https://github.com/ankitects/anki/releases/download/2.1.54/anki-2.1.54-linux-qt6.tar.zst"
- tar xf anki-*.tar.zst
- cd anki-*-linux-qt6 && sed -i 's/\/usr\//\$$HOME\/./' install.sh && ./install.sh
- rm -rf anki-*
-
-.PHONY: all packages config scripts wallpapers anki
+.PHONY: all packages config scripts wallpapers
diff --git a/.local/bin/dmenusearch b/.local/bin/dmenusearch
index d779198..acb88ae 100755
--- a/.local/bin/dmenusearch
+++ b/.local/bin/dmenusearch
@@ -4,7 +4,7 @@
# websearch dependencies : shuf, curl, /tmp needs to be temporary
# wiki dependency: parabola-wiki-docs (can be used with arch-wiki-docs)
# youtube dependency: ytfzf
-# man dependencies: man-db, zathura
+# man dependencies: mandoc/man-db, zathura
# emoji dependency: xclip
set -e
@@ -71,8 +71,15 @@ aur() {
}
manpdf() {
- INPUT=${1:-$(/usr/bin/man -k . | dmenu -i -l 20 | awk '{print $1}')}
- [ -n "$INPUT" ] && /usr/bin/man -Tpdf "$INPUT" | zathura -
+ INPUT=${1:-$(man -k . | cut -c 1-80 | dmenu -i -l 20 | awk '{print $1}')}
+ [ -z "$INPUT" ] && return 1
+ if command -v mandb; then
+ # This is man-db
+ man -Tpdf "$INPUT" | zathura -
+ else
+ # This is mandoc, TODO: parse INPUT to use pdf too
+ "$TERMINAL" -e man "${INPUT%'('*}"
+ fi
}
emoji() {
diff --git a/.local/bin/manpager b/.local/bin/manpager
new file mode 100755
index 0000000..e899598
--- /dev/null
+++ b/.local/bin/manpager
@@ -0,0 +1,2 @@
+#!/bin/sh
+col -bx < "$1" | bat -l man -p --paging=auto
diff --git a/.local/bin/music b/.local/bin/music
index 835d5b0..5456eaf 100755
--- a/.local/bin/music
+++ b/.local/bin/music
@@ -10,7 +10,7 @@ if [ "$1" = "--shuffle" ]; then
shift
fi
-MUSIC="${1:-$MUSICDIR/$(ls "$MUSICDIR" | dmenu -i -p "Play ")}"
+MUSIC="${1:-$MUSICDIR/$(ls "$MUSICDIR" | cut -c 1-80 | dmenu -i -p "Play ")}"
SCRIPT="${XDG_CONFIG_HOME:-$HOME/.config}/mpv/music/local.lua"
if [ "$MUSIC" = "$MUSICDIR/urls" ]; then
diff --git a/.local/bin/musiccmd b/.local/bin/musiccmd
index d47e772..6c6e0d4 100755
--- a/.local/bin/musiccmd
+++ b/.local/bin/musiccmd
@@ -2,6 +2,7 @@
# helper for the music script
# dependencies: music, mpv, socat, yt-dlp, ffmpeg, imagemagick
# optional dependencies: sb, libnotify, herbe
+# shellcheck disable=SC2046
FAVDIR="${XDG_MUSIC_DIR:-$HOME/Music}/favorite"
DLDIR="${XDG_MUSIC_DIR:-$HOME/Music}/download"
@@ -73,7 +74,7 @@ getthumbnail() {
main() {
if ! pgrep -x music >/dev/null; then
- kill -34 "$(pidof sb)"
+ kill -34 $(pidof sb)
herbe "Error: There is no music playing"\
"Do you want to play some ?" && music
return 1
@@ -85,7 +86,7 @@ main() {
case "$cmd" in
cycle|*pause|*play)
printf 'cycle pause\n' | socat - /tmp/mpvsocket
- kill -34 "$(pidof sb)" ;;
+ kill -34 $(pidof sb) ;;
*next)
printf 'playlist-next\n' | socat - /tmp/mpvsocket ;;
*prev)
@@ -96,7 +97,7 @@ main() {
| socat - /tmp/mpvsocket 1> /dev/null ;;
*stop)
printf 'stop\n' | socat - /tmp/mpvsocket
- kill -34 "$(pidof sb)" ;;
+ kill -34 $(pidof sb) ;;
*favorite|fav)
getpath
gettitle
diff --git a/.local/etc/nvim/appearance.vim b/.local/etc/nvim/appearance.vim
index 14afd8d..a211f7b 100644
--- a/.local/etc/nvim/appearance.vim
+++ b/.local/etc/nvim/appearance.vim
@@ -176,10 +176,10 @@ require("nvim-web-devicons").setup {}
require("nvim-treesitter.configs").setup {
ensure_installed = {
- "bash", "c", "c_sharp", "comment", "css", "diff", "git_rebase",
- "gitattributes", "gitcommit", "gitignore", "html", "latex",
- "lua", "make", "markdown", "python", "rust", "vim", "vimdoc",
- "zig"
+ "bash", "c", "comment", "css", "diff", "git_rebase",
+ "gitattributes", "gitcommit", "gitignore", "go", "html",
+ "latex", "lua", "make", "markdown", "python", "rust", "vim",
+ "vimdoc", "zig"
},
highlight = {
diff --git a/.local/etc/nvim/basics.vim b/.local/etc/nvim/basics.vim
index 73707db..632f72d 100644
--- a/.local/etc/nvim/basics.vim
+++ b/.local/etc/nvim/basics.vim
@@ -25,9 +25,7 @@ set clipboard+=unnamedplus
"set list
"set lcs=tab:\|\ ,space:⋅,eol:$ "↴
autocmd FileType * setl fo-=ro fo+=tc
-abbreviate hte the
-nnoremap :Q<CR> :q<CR>
-nnoremap :Q!<CR> :q!<CR>
+cabbrev Q q
set ttimeoutlen=10
nnoremap <silent> <C-L> :nohls<C-R>=has('diff')?'<Bar>dif':''<CR><CR><C-L>
@@ -37,5 +35,7 @@ autocmd FileType lisp,html setl ts=2 sw=2 sts=2 expandtab
autocmd FileType html,markdown setl spell
autocmd FileType tex setl spell spl=fr
autocmd FileType c setl makeprg=cc\ %:p
-autocmd BufWritePost *.c silent! !astyle -A3 -t8 -p -xg -H -xB -n -w %:p
+autocmd BufWritePost *.c silent !astyle -A3 -t8 -p -xg -H -xB -n -w %:p
+autocmd BufWritePost *.go silent !gofmt -s -w %:p
command Astyle !astyle -A3 -t8 -p -xg -H -xB -n -w %:p
+command GoBuild !go build %:p
diff --git a/.local/etc/nvim/init.vim b/.local/etc/nvim/init.vim
index a63e664..4cc6ceb 100644
--- a/.local/etc/nvim/init.vim
+++ b/.local/etc/nvim/init.vim
@@ -42,6 +42,8 @@ Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' } " fuzzy finder
Plug 'preservim/nerdtree' " vs code be like
Plug 'mbbill/undotree' " history visualizer
Plug 'tpope/vim-commentary' " gc/gcc magic comment
+"Plug 'tpope/vim-abolish'
+"Plug 'tpope/vim-fugitive' " git in vim
Plug 'ziglang/zig.vim'
Plug 'kovetskiy/sxhkd-vim'
Plug 'petertriho/nvim-scrollbar'
@@ -65,10 +67,13 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr
" Undotree config
nnoremap <F3> :UndotreeToggle<CR>
+autocmd BufWritePost * GitGutter
+
" custom vim-commentary
autocmd FileType zig setl commentstring=//\ %s
autocmd FileType cs setl commentstring=/*\ %s\ */
+" g?p or g?v
lua << EOF
require("debugprint").setup()
EOF
diff --git a/.local/etc/nvim/lsp.vim b/.local/etc/nvim/lsp.vim
index 04a7b75..0ecc8c8 100644
--- a/.local/etc/nvim/lsp.vim
+++ b/.local/etc/nvim/lsp.vim
@@ -32,7 +32,7 @@ end
-- https://github.com/williamboman/mason-lspconfig.nvim#available-lsp-servers
local servers = {'zls', 'clangd', 'bashls', 'rust_analyzer', 'texlab', 'gopls',
- 'jedi_language_server', 'lua_ls', 'cssls', 'html', 'csharp_ls'}
+ 'jedi_language_server', 'lua_ls', 'cssls', 'html', }
for _, lsp in ipairs(servers) do
require("lspconfig")[lsp].setup ({
diff --git a/.local/etc/zsh/.zshenv b/.local/etc/zsh/.zshenv
index 7c85d54..636f626 100644
--- a/.local/etc/zsh/.zshenv
+++ b/.local/etc/zsh/.zshenv
@@ -1,7 +1,7 @@
# Update PATH
PATH="$HOME/.local/bin:$PATH"
-PATH="$PATH:$XDG_DATA_HOME/cargo/bin"
-PATH="$PATH:$XDG_DATA_HOME/dotnet/.dotnet/tools"
+PATH="$PATH:$CARGO_HOME/bin"
+PATH="$PATH:$GOPATH/bin"
export PATH
# Default programs
@@ -9,7 +9,7 @@ export EDITOR="editor"
export TERMINAL="st"
export BROWSER="browser"
export ROOTCMD="doas"
-export MANPAGER="sh -c 'col -bx | bat --paging=auto -l man -p'"
+export MANPAGER="manpager"
# XDG directories
export XDG_CONFIG_HOME="$HOME/.local/etc"
diff --git a/.local/etc/zsh/.zshrc b/.local/etc/zsh/.zshrc
index 01e5f6a..630c82a 100644
--- a/.local/etc/zsh/.zshrc
+++ b/.local/etc/zsh/.zshrc
@@ -1,5 +1,5 @@
# fun stuff
-quand
+quand -f 14
#shuf -n 1 "$XDG_DATA_HOME/navi" # database from https://github.com/HappyHippo77/NaviFrequencyList
exa -aa --color=auto --group-directories-first
diff --git a/.local/etc/zsh/aliasrc b/.local/etc/zsh/aliasrc
index 9b5d856..8f1015b 100644
--- a/.local/etc/zsh/aliasrc
+++ b/.local/etc/zsh/aliasrc
@@ -58,6 +58,7 @@ alias ytfzf="ytfzf -D --detach"
alias tmp='cd $(mktemp -d)'
alias p="plumber"
alias mount="$ROOTCMD mount -o nosuid,nodev,noexec"
+alias gb="go build"
# verbosity and colors
alias rm="rm -vI"
@@ -92,7 +93,6 @@ alias gp="git push --follow-tags" # --tags
alias gpl="git pull"
alias gr="git restore"
alias grs="gr --staged"
-alias gb="git branch"
alias gd="git diff"
alias gac="ga . && gc"
alias gacv="ga . && gcv"
diff --git a/.local/share/packages b/.local/share/packages
index f9a1c51..5b0c832 100644
--- a/.local/share/packages
+++ b/.local/share/packages
@@ -71,7 +71,6 @@ gitui # tui for git (good if you don't remember what change you made)
## dev
#texlive # LaTeX (big package)
#pandoc-cli # I only use that to convert markdown to latex to pdf (big package)
-#dotnet-sdk # C# for lsp do dotnet tool install -g csharp-ls
rustup # rust
nasm # x86 compiler
clang # another cc + clangd C lsp
@@ -125,7 +124,7 @@ p7zip
rsync
imagemagick # image manipulation from the terminal
mat2 # metadata removal tool
-man-db
+mandoc
man-pages # Linux man pages
sshfs # mount drive over ssh
bc # calculation