dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

commit 2037643199255801cebf82e1e6f64ad3e7c6ac60
parent df6376885b8d28599d7c25f24955fa7a3b63de55
Author: Bharatvaj <bharatvaj@yahoo.com>
Date:   Mon,  4 Jul 2022 18:43:44 +0530

Merge branch 'macos_leftovers' into base

Diffstat:
D.Xresources | 38--------------------------------------
M.config/.gitignore | 5++++-
A.config/X11/Xresources | 38++++++++++++++++++++++++++++++++++++++
A.config/X11/keybindings | 7+++++++
M.config/X11/xinitrc | 13+++++--------
M.config/alacritty/alacritty.yml | 1+
M.config/git/config | 5++++-
M.config/sh/functions | 2++
M.config/vim/keybindings/keybindings.vim | 19++++++++++++-------
9 files changed, 73 insertions(+), 55 deletions(-)

diff --git a/.Xresources b/.Xresources @@ -1,38 +0,0 @@ -URxvt*background: #000000 -URxvt*foreground: #FFFFFF -URxvt*font: xft:Fira Mono:pixelsize=14 -URxvt*boldFont: xft:Fira Mono:bold:pixelsize=14 -URxvt*saveLines: 12000 -URxvt*scrollBar: false -URxvt*scrollstyle: rxvt -URxvt*perl-ext-common: default,matcher,new-window -URxvt*urlLauncher: firefox -URxvt.internalBorder: 6 -URxvt.keysym.C-N: perl:new-window -URxvt*matcher.button: 1 - -URxvt*colorUL: #86a2be -! black -URxvt*color0 : #2E3436 -URxvt*color8 : #555753 -! red -URxvt*color1 : #CC0000 -URxvt*color9 : #EF2929 -! green -URxvt*color2 : #4E9A06 -URxvt*color10 : #8AE234 -! yellow -URxvt*color3 : #C4A000 -URxvt*color11 : #FCE94F -! blue -URxvt*color4 : #3465A4 -URxvt*color12 : #729FCF -! magenta -URxvt*color5 : #75507B -URxvt*color13 : #AD7FA8 -! cyan -URxvt*color6 : #06989A -URxvt*color14 : #34E2E2 -! white -URxvt*color7 : #D3D7CF -URxvt*color15 : #EEEEEC diff --git a/.config/.gitignore b/.config/.gitignore @@ -2,7 +2,10 @@ * !.gitignore -!X11 +!X11/ +!X11/keybindings +!X11/xinitrc +!X11/Xresources !alacritty/ !alacritty/** !bash/ diff --git a/.config/X11/Xresources b/.config/X11/Xresources @@ -0,0 +1,38 @@ +URxvt*background: #000000 +URxvt*foreground: #FFFFFF +URxvt*font: xft:Fira Mono:pixelsize=14 xft:Noto Color Emoji:pixelsize=14 +URxvt*boldFont: xft:Fira Mono:bold:pixelsize=14 +URxvt*saveLines: 12000 +URxvt*scrollBar: false +URxvt*scrollstyle: rxvt +URxvt*perl-ext-common: default,matcher,new-window +URxvt*urlLauncher: firefox +URxvt.internalBorder: 6 +URxvt.keysym.C-N: perl:new-window +URxvt*matcher.button: 1 + +URxvt*colorUL: #86a2be +! black +URxvt*color0 : #2E3436 +URxvt*color8 : #555753 +! red +URxvt*color1 : #CC0000 +URxvt*color9 : #EF2929 +! green +URxvt*color2 : #4E9A06 +URxvt*color10 : #8AE234 +! yellow +URxvt*color3 : #C4A000 +URxvt*color11 : #FCE94F +! blue +URxvt*color4 : #3465A4 +URxvt*color12 : #729FCF +! magenta +URxvt*color5 : #75507B +URxvt*color13 : #AD7FA8 +! cyan +URxvt*color6 : #06989A +URxvt*color14 : #34E2E2 +! white +URxvt*color7 : #D3D7CF +URxvt*color15 : #EEEEEC diff --git a/.config/X11/keybindings b/.config/X11/keybindings @@ -0,0 +1,7 @@ +__type() { + type "$@" >/dev/null 2>/dev/null +} + +__type setxkbmap && setxkbmap -option caps:escape +__type setxkbmap && setxkbmap -option altwin:swap_alt_win +__type xbmap && xbmap diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc @@ -1,16 +1,13 @@ #!/bin/sh -__type() { - type "$@" >/dev/null 2>/dev/null -} +. ~/.config/X11/keybindings -__type i3 || (echo "i3 not found" && exit 1) +WM=dwm + +__type $WM || (echo "$WM not found" && exit 1) -__type setxkbmap && setxkbmap -option caps:escape -__type setxkbmap && setxkbmap -option altwin:swap_alt_win -__type xbmap && xbmap __type xrdb && xrdb merge ~/.config/X11/Xresources __type hsetroot && exec hsetroot -solid "#000000" & __type compton && exec compton & -exec i3 +exec $WM diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml @@ -6,6 +6,7 @@ import: - ~/.config/alacritty/font.yml - ~/.config/alacritty/unix.yml - ~/.config/alacritty/windows.yml + - ~/.config/alacritty/mac.yml live_config_reload: true diff --git a/.config/git/config b/.config/git/config @@ -12,7 +12,9 @@ ds = diff --staged l = log ld = log --pretty=format:"%h %ad %s" --date=short --all - lg = log --graph --oneline --decorate --all + lg = log --all --grep + lgr = log --graph --oneline --decorate --all + lss = log --show-signature p = pull pu = push rs = remote set-url @@ -28,6 +30,7 @@ [init] defaultBranch = main + templatedir = ~/.config/git/template [include] path = config.user diff --git a/.config/sh/functions b/.config/sh/functions @@ -1,4 +1,6 @@ # TODO implement [dest_dir] functionality +# Iterate over each arguments +# Treat last argument as dest folder? or use -d extract_archive () { test $# -lt 1 && { printf "Usage: $0 <archive>\n"; exit 1; } test -f $1 || { printf "$0: $1: No such file \n"; exit 1; } diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim @@ -1,15 +1,16 @@ " General keybindings -nmap <leader>F :GFiles<cr> nnoremap <Leader>l :ls<CR>:b<space> -nnoremap <leader><leader> :grep +nnoremap <leader>F :GFiles<cr> nnoremap <leader>co :copen<cr> nnoremap <leader>ec :edit ~/.config/vim/vimrc<cr> -nnoremap <leader>f :find -nnoremap <leader>g :grep +nnoremap <leader>ek :edit ~/.config/vim/keybindings/keybindings.vim<cr> +nnoremap <leader>f :find * +nnoremap <leader>gg :vimgrep<space> nnoremap <leader>p :Rg<cr> nnoremap <leader>t :tabnew<cr> -nnoremap Y y$ +# Behave vim +nnoremap Y y$ fun! GitFind() endfun @@ -33,14 +34,18 @@ endfunction nnoremap <leader>tl :call ToggleList()<CR> " Buffer Creation -nnoremap <Leader>v :vsplit<enter> -nnoremap <Leader>s :split<enter> +nnoremap <Leader>vv :vsplit<enter> +nnoremap <Leader>ss :split<enter> +nnoremap <Leader>sc :source ~/.config/vim/vimrc<enter> " Quick save and write nnoremap <leader>wq :wq<cr> nnoremap <leader>ww :w<cr> nnoremap <leader>qq :q<cr> +" Fugitive +nnoremap <space>gd :Gvdiff<CR> + " Run Make function SaveAndBuild()