From 0b8c2e718d06bc10fde743fd110f03e1a0c97cc9 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 13:16:54 +0100 Subject: [PATCH 01/15] scripts: re-add missing dock-displays utility --- scripts/dock-displays | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/dock-displays diff --git a/scripts/dock-displays b/scripts/dock-displays new file mode 100755 index 0000000..ac7244f --- /dev/null +++ b/scripts/dock-displays @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +SCALE=${1:-1.4} +OUTPUT=eDP1 +NWIDTH=2160 +NHEIGHT=1440 + +WIDTH="$(bc <<< "$NWIDTH / $SCALE")" # $(($NWIDTH / $SCALE)) +HEIGHT="$(bc <<< "$NHEIGHT / $SCALE")" # $(($NHEIGHT / $SCALE)) + +MODELINE=$(cvt $WIDTH $HEIGHT | sed -n 's/Modeline\s*//p' | tr -d \") +MODENAME=${MODELINE%% *} + +xrandr --newmode $MODELINE 2>/dev/null || true +xrandr --addmode $OUTPUT $MODENAME 2>/dev/null || true +xrandr --output $OUTPUT --mode $MODENAME From 92542e8cf0abe2cf0ef7299b03f0173252349f3b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 13:44:42 +0100 Subject: [PATCH 02/15] vim: visually indent wrapped lines --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 4e016a3..9eca9ec 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -18,6 +18,7 @@ set smartindent set number set linebreak set autoindent +set breakindent set laststatus=2 set encoding=utf-8 set background=dark From fe7b74fb0a92122a4de3e4aae2c5d7f1307dc3b2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 13:46:04 +0100 Subject: [PATCH 03/15] zsh: manage autogen with git, fixes `autogen selfupdate' --- .zshrc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.zshrc b/.zshrc index 4849327..5d7ca21 100644 --- a/.zshrc +++ b/.zshrc @@ -5,9 +5,10 @@ CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" ZSH_DIR="$CONFIG_DIR/zsh" ZSH_CACHE_DIR="$CONFIG_DIR/oh-my-zsh/cache" ADOTDIR="$ZSH_DIR/antigen" # Antigen directory -ANTIGEN_LOG="$ADOTDIR/log/antigen-$(date +"%Y_%m_%d_%I_%M_%p").log" +LOG_DIR="$ZSH_DIR/log" +ANTIGEN_LOG="$LOG_DIR/antigen-$(date +"%Y_%m_%d_%I_%M_%p").log" -mkdir -p "$ZSH_CACHE_DIR" "$ZSH_DIR" "$ADOTDIR/log" +mkdir -p "$ZSH_CACHE_DIR" "$ZSH_DIR" "$LOG_DIR" HISTFILE="$ZSH_DIR/histfile" HISTSIZE=999999 @@ -43,14 +44,9 @@ zstyle ':compinstall' filename "$HOME/.zshrc" # Load antigen & plugins -antigen_src="$ZSH_DIR/antigen.zsh" +antigen_src="$ADOTDIR/antigen.zsh" if [ ! -f "$antigen_src" ]; then - if exists curl; then - getcmd='curl -L' - else - getcmd='wget -qO-' - fi - eval $getcmd git.io/antigen > "$antigen_src" + git clone https://github.com/zsh-users/antigen.git "$ADOTDIR" fi source "$antigen_src" From c308fe09c523452d05903afbd670c90409a3fba5 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 14:50:53 +0100 Subject: [PATCH 04/15] rofi: move configuration into own file --- .Xresources | 24 +----------------------- .config/rofi/config | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 .config/rofi/config diff --git a/.Xresources b/.Xresources index 4cf13ec..f7c5637 100644 --- a/.Xresources +++ b/.Xresources @@ -38,7 +38,7 @@ urxvt.iso14755_52: false urxvt.perl-ext-common: default,clipboard,vtwheel,font-size urxvt.keysym.Shift-Control-C: perl:clipboard:copy urxvt.keysym.Shift-Control-V: perl:clipboard:paste -urxvt.url-launcher: /usr/bin/google-chrome-stable +urxvt.url-launcher: /usr/bin/chromium urxvt.matcher.button: 1 urxvt.keysym.C-Up: font-size:increase @@ -94,25 +94,3 @@ urxvt*colorMode: on *.color6: #10aeba *.color14: #5ddae2 - -!----------------------------- -! Rofi config - -! State: 'bg', 'fg', 'bgalt' 'hlbg', 'hlfg' -rofi.color-window: #F2383C4A, #2F343F -rofi.color-normal: #00383C4A, #D3DAE3, #00383C4A, #5294E2, #ECEFF1 -rofi.bc: #CC383C4A -rofi.bw: 5 -rofi.padding: 8 -rofi.lines: 12 -rofi.width: 40 -rofi.font: Noto Sans 14 -rofi.line-margin: 6 -rofi.sep: | -rofi.prompt: > -rofi.ssh-command: {terminal} -e "{ssh-client} {host}" -rofi.separator-style: solid - -rofi.matching: glob -rofi.tokenize: true -rofi.normal-window: true diff --git a/.config/rofi/config b/.config/rofi/config new file mode 100644 index 0000000..d563b04 --- /dev/null +++ b/.config/rofi/config @@ -0,0 +1,26 @@ +!----------------------------- +! Rofi config +!----------------------------- + +! State: 'bg', 'fg', 'bgalt' 'hlbg', 'hlfg' +rofi.color-window: #F2383C4A, #2F343F +rofi.color-normal: #00383C4A, #D3DAE3, #00383C4A, #5294E2, #ECEFF1 +rofi.bc: #CC383C4A +rofi.bw: 5 +rofi.padding: 8 +rofi.lines: 12 +rofi.width: 40 +rofi.font: Noto Sans 14 +rofi.line-margin: 6 +rofi.sep: | +rofi.prompt: > +rofi.ssh-command: {terminal} -e "{ssh-client} {host}" +rofi.separator-style: solid +rofi.kb-row-tab: Shift+Tab +rofi.kb-row-select: Tab + +rofi.matching: glob +rofi.tokenize: true +rofi.normal-window: true + +! vim: ft=xdefaults From fc256a3f4fbdc5b6fb857aeed0d388113e69e900 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:02 +0100 Subject: [PATCH 05/15] vim: add FZF and NERDTree .. keybinds --- .config/vim/vimrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 9eca9ec..1e98398 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -35,6 +35,8 @@ set scrolloff=6 set nojoinspaces set updatetime=500 " reduce delay from 4s default +let mapleader="\" + " Autosave settings function! SaveIfExist() if @% != "" && filereadable(@%) && !&readonly @@ -90,6 +92,7 @@ Plugin 'chr4/nginx.vim' Plugin 'PotatoesMaster/i3-vim-syntax' Plugin 'lervag/vimtex' Plugin 'JamshedVesuna/vim-markdown-preview' +Plugin 'junegunn/fzf.vim' call vundle#end() @@ -135,6 +138,12 @@ let g:tagbar_show_linenumbers = 1 let g:tagbar_singleclick = 1 let g:tagbar_autopreview = 1 +" NERDTree configuration +map :NERDTreeToggle + +" FZF configurationn +map :Files + " Disable mouse set mouse=nicr nnoremap @@ -144,7 +153,6 @@ nnoremap inoremap inoremap -let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] for key in ['', '', '', ''] @@ -232,6 +240,8 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) \ 'x': ['tsd', 'tsD'], \} + let NERDTreeMapOpenInTab='\t' + endif " Save aliases. From f35e8b8becbab2c0aa8079d0023127f609644c54 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:28 +0100 Subject: [PATCH 06/15] vim: autosave modified files, also when FocusGained --- .config/vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 1e98398..df83efd 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -39,12 +39,12 @@ let mapleader="\" " Autosave settings function! SaveIfExist() - if @% != "" && filereadable(@%) && !&readonly + if @% != "" && filereadable(@%) && !&readonly && &modified write endif endfunction set autowrite -autocmd CursorHold,CursorHoldI,InsertLeave,FocusLost * call SaveIfExist() +autocmd CursorHold,CursorHoldI,InsertLeave,FocusGained,FocusLost * call SaveIfExist() " Search options set hlsearch From f985d47b68821f39b3fe12f36167f0c7ac3012b4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:52 +0100 Subject: [PATCH 07/15] vim: split in the direction you'd expect --- .config/vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index df83efd..1af5ded 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -51,6 +51,10 @@ set hlsearch set ignorecase set smartcase +" More natural splits +set splitbelow " Horizontal split below current. +set splitright " Vertical split to right of current. + " GVim settings set guifont=Sauce\ Code\ Pro\ 10.5 set guioptions= From 93e11c73f8968fe72ccd5e2588a7ec0cca7663b1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:53:40 +0100 Subject: [PATCH 08/15] vim: add magic regex to search patterns --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 1af5ded..dd335a6 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -50,6 +50,7 @@ autocmd CursorHold,CursorHoldI,InsertLeave,FocusGained,FocusLost * call SaveIfEx set hlsearch set ignorecase set smartcase +set magic " More natural splits set splitbelow " Horizontal split below current. From 776e641ed0f383eb916137f0568b8a66b93433a6 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:08 +0100 Subject: [PATCH 09/15] vim: add wqa and fat-finger aliases --- .config/vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index dd335a6..48f116f 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -250,11 +250,13 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) endif " Save aliases. -noremap q :wq com! W w com! Q q com! Wq wq com! WQ wq +com! Wqa wqa +com! WQa wqa +com! WQA wqa " Write with sudo cmap w!! w !sudo tee > /dev/null % From 6da74ddddeb96f52fc1b9950a7b28b791a9d0740 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:36 +0100 Subject: [PATCH 10/15] vim: highlight cursor position with cursor{line,column} --- .config/vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 48f116f..d583902 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -71,6 +71,10 @@ if exists('+colorcolumn') autocmd filetype c,h,cpp,hpp match ErrorMsg '\%>80v.\+' endif +" Highlight line and column of cursor +set cul cuc +highlight CursorLine cterm=NONE ctermbg=8 +highlight CursorColumn cterm=NONE ctermbg=8 " set the runtime path to include Vundle and initialize set rtp+=~/.config/vim/bundle/Vundle.vim From 65c8a2d9a6addf5c72e135dd16b4c1fbe8b1111b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:53 +0100 Subject: [PATCH 11/15] gvim: use consistent font size with system --- .config/vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index d583902..520e14b 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -57,7 +57,7 @@ set splitbelow " Horizontal split below current. set splitright " Vertical split to right of current. " GVim settings -set guifont=Sauce\ Code\ Pro\ 10.5 +set guifont=Sauce\ Code\ Pro\ 9 set guioptions= " Whitespace highlight settings From c797593e9f66c34ad3952eeaa96ebcc74c6884cd Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:55:23 +0100 Subject: [PATCH 12/15] aliases: start vim with servername for lervag/vimtex --- aliases | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aliases b/aliases index cfbd5d8..8b73914 100644 --- a/aliases +++ b/aliases @@ -58,6 +58,8 @@ alias make="make -j$(nproc)" alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" +alias vim="vim --servername vim -p" +alias vi=vim alias grip='grip --user=frebib --pass=$GRIP_API_KEY' alias acme.sh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' alias acmesh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' From 2b8ab8cb3787a526f6cf73238e8fabd447ba19e4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:55:50 +0100 Subject: [PATCH 13/15] scripts/dock-displays: update fehbg after resize --- scripts/dock-displays | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dock-displays b/scripts/dock-displays index ac7244f..421f396 100755 --- a/scripts/dock-displays +++ b/scripts/dock-displays @@ -15,3 +15,7 @@ MODENAME=${MODELINE%% *} xrandr --newmode $MODELINE 2>/dev/null || true xrandr --addmode $OUTPUT $MODENAME 2>/dev/null || true xrandr --output $OUTPUT --mode $MODENAME + +if [ -f ~/.fehbg -a -x ~/.fehbg ]; then + ~/.fehbg +fi From eadeba5baaba9e3a7885d81d85efdaeeac0bac86 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Apr 2018 17:09:31 +0100 Subject: [PATCH 14/15] vim: use pretty unicode listchars --- .config/vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 520e14b..100bbd4 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -62,7 +62,7 @@ set guioptions= " Whitespace highlight settings set list -set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< +set listchars=eol:$,space:·,tab:>-,trail:◦,extends:▶,precedes:◀ highlight SpecialKey ctermfg=8 if exists('+colorcolumn') From 771cdf4b5dc3fb1f40c5c7cd577d780d88d1e23a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Apr 2018 17:12:32 +0100 Subject: [PATCH 15/15] vim: disable vimtex autoindent --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 100bbd4..36294f6 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -116,6 +116,7 @@ endif let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme "let g:vimtex_view_method='zathura' let g:tex_flavor='latex' +let g:vimtex_indent_enabled = 0 " auto-indentation is wrong and annoying autocmd FileType tex silent VimtexCompile autocmd FileType tex setlocal spell autocmd FileType tex TagbarOpen