From c308fe09c523452d05903afbd670c90409a3fba5 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 14:50:53 +0100 Subject: [PATCH 01/11] 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 1f8272d259c86b3962d819ce75c629460d92ff4d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:50:50 +0100 Subject: [PATCH 02/11] vim: alias te to tabedit --- .config/vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 9eca9ec..bc1dbb9 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -35,6 +35,9 @@ set scrolloff=6 set nojoinspaces set updatetime=500 " reduce delay from 4s default +" te seems like the correct shorthand, not tabe +cmap te tabedit + " Autosave settings function! SaveIfExist() if @% != "" && filereadable(@%) && !&readonly From 7bbe3f07c07ab595484bea955fcc821a607603f7 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:02 +0100 Subject: [PATCH 03/11] 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 bc1dbb9..6068a2a 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -38,6 +38,8 @@ set updatetime=500 " reduce delay from 4s default " te seems like the correct shorthand, not tabe cmap te tabedit +let mapleader="\" + " Autosave settings function! SaveIfExist() if @% != "" && filereadable(@%) && !&readonly @@ -93,6 +95,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() @@ -138,6 +141,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 @@ -147,7 +156,6 @@ nnoremap inoremap inoremap -let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] for key in ['', '', '', ''] @@ -235,6 +243,8 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) \ 'x': ['tsd', 'tsD'], \} + let NERDTreeMapOpenInTab='\t' + endif " Save aliases. From 94b221ebb34e687de3c40422d7762492a3e60f52 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:28 +0100 Subject: [PATCH 04/11] 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 6068a2a..21b5a43 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -42,12 +42,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 daea729cc8a246b7d16afb6aa42109838e772bba Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:52 +0100 Subject: [PATCH 05/11] 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 21b5a43..f28081c 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -54,6 +54,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 5f76cace0488f9eff75df0c312dd1c3120d94031 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:53:40 +0100 Subject: [PATCH 06/11] 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 f28081c..12c315e 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -53,6 +53,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 ae855ed9676c4d53bd0f36de4b6cf02355d536df Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:08 +0100 Subject: [PATCH 07/11] 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 12c315e..451c9f8 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -253,11 +253,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 80fc648fad0952d8f0dbbf085a7d93f06214ea4e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:36 +0100 Subject: [PATCH 08/11] 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 451c9f8..1a0c802 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -74,6 +74,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 1d12a5afab8e0db32b86bc0db87eb5278a859ff3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:53 +0100 Subject: [PATCH 09/11] 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 1a0c802..75f7e06 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -60,7 +60,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 c329271f0f18c35e83d26e82b54ff4d3c57d24de Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:55:23 +0100 Subject: [PATCH 10/11] 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 cb4c89ab5b8938f527ff077a245edc87d444f38b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:55:50 +0100 Subject: [PATCH 11/11] 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