From a4d1cd07761264d3a1d8744ea16e3e59676107cb Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Wed, 7 Mar 2018 07:42:23 -0500 Subject: [PATCH] Remove Enter mapping for Vim & other Vim settings - increase timeoutlen - fix F10 paste for Neovim - escape url mapping (for LaTeX) Also added pdftojpg function. --- aliases/zsh_aliases | 13 +++++++++++++ configs/NZXT/i3/config | 1 - configs/NZXT/ranger/rc.conf | 1 + configs/NZXT/ranger/scope.sh | 3 ++- dotfiles/vimrc | 11 ++++++++--- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 315a67d..3c2e329 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -87,6 +87,7 @@ alias tm="ni $usnp_dir/texmath.snippets" # }}} config files # # applications {{{ # +alias rg="ranger" function ok() { okular $1 ; } function chr() { google-chrome $1 ; } function ni() { nvim $1 ; } @@ -172,6 +173,18 @@ if [ "$(hostname)" = "NZXT" ]; then alias cvf="f ~/Documents/resume/examples/cv" alias vcv="ni ~/Documents/resume/examples/cv.tex" alias okcv="ok ~/Documents/resume/examples/cv.pdf" + # https://stackoverflow.com/a/6605085/8811872 + function pdftojpg() { + convert \ + -verbose \ + -density 150 \ + -trim \ + $1.pdf \ + -quality 100 \ + -flatten \ + -sharpen 0x1.0 \ + $1.jpg + } # }}} resume # # }}} various coding projs # diff --git a/configs/NZXT/i3/config b/configs/NZXT/i3/config index dae77af..6f8da7d 100644 --- a/configs/NZXT/i3/config +++ b/configs/NZXT/i3/config @@ -134,7 +134,6 @@ bindsym $mod+F3 workspace $ws3; exec google-chrome set $ws4 "4 " workspace $ws4 output $samsung -assign [class="Okular"] $ws4 set $ws5 "5 " workspace $ws5 output $benq diff --git a/configs/NZXT/ranger/rc.conf b/configs/NZXT/ranger/rc.conf index f038c6b..9e46fe2 100644 --- a/configs/NZXT/ranger/rc.conf +++ b/configs/NZXT/ranger/rc.conf @@ -347,6 +347,7 @@ map move down=1 map move left=1 map move right=1 map move to=0 + map move to=-1 map move down=1 pages=True map move up=1 pages=True diff --git a/configs/NZXT/ranger/scope.sh b/configs/NZXT/ranger/scope.sh index 540a910..514d8f9 100755 --- a/configs/NZXT/ranger/scope.sh +++ b/configs/NZXT/ranger/scope.sh @@ -60,7 +60,8 @@ handle_extension() { # PDF pdf) # Preview as text conversion - pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - && exit 5 + pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - && exit 5 + # pdftoppm -jpeg -singlefile "$path" "${cached//.jpg}" && exit 6 || exit 1;; exiftool "${FILE_PATH}" && exit 5 exit 1;; diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 2b19b41..5a57897 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -19,7 +19,7 @@ set linespace=5 " set list " set cursorcolumn " set cursorline -set timeoutlen=300 +set timeoutlen=500 set hlsearch " }}} set x=y " @@ -104,6 +104,9 @@ Plug 'dkarter/bullets.vim' " coordinate Vim color scheme with terminal color scheme Plug 'dylanaraps/wal.vim' +" repeat plugin commands +Plug 'tpope/vim-repeat' + call plug#end() " colorscheme gotham256 @@ -117,12 +120,12 @@ colorscheme wal map :wa map :wqa map :qa! +map :make -C ~/Documents/resume cv map :AutoSaveToggle map :LLPStartPreview -nnoremap :set pastep:set nopaste +nnoremap :set paste"+p:set nopaste " }}} function keys " -map o map O " splits {{{ " @@ -168,6 +171,8 @@ nnoremap rv :source $MYVIMRC nnoremap R q:i%s///g2F/i " set syntax to shell (for dotfiles) nnoremap s :set syn=sh +" replace bars/underscores in URL +nnoremap url :.s/\([-_]\)/\\\1/g " format current line nnoremap w Vgq " format this and next line