diff --git a/home/.config/dunst/dunstrc b/home/.config/dunst/dunstrc index acc5e7b0..b3ecb8b1 100644 --- a/home/.config/dunst/dunstrc +++ b/home/.config/dunst/dunstrc @@ -26,7 +26,7 @@ frame_color = "#c0c5ce" separator_color = frame frame_width = 1 startup_notification = false -dmenu = /usr/bin/rofi -dmenu -p dunst: +dmenu = /usr/bin/rofi -dmenu -p dunst browser = /usr/bin/firefox icon_position = left icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ diff --git a/home/.config/networkmanager-dmenu/config.ini b/home/.config/networkmanager-dmenu/config.ini index 9ee9969e..3d0c4f5a 100644 --- a/home/.config/networkmanager-dmenu/config.ini +++ b/home/.config/networkmanager-dmenu/config.ini @@ -1,5 +1,5 @@ [dmenu] -dmenu_command = rofi -location 3 -yoffset 35 -xoffset -10 -width 37 -font "DejaVu Sans Mono 10" -padding 20 -line-padding 4 -hide-scrollbar -password +dmenu_command = rofi -location 3 -yoffset 35 -xoffset -10 -width 37 -font "DejaVu Sans Mono 11" -padding 20 -line-padding 4 -hide-scrollbar -password [editor] terminal = termite diff --git a/home/.config/ranger/rc.conf b/home/.config/ranger/rc.conf index 018757ba..e150af92 100644 --- a/home/.config/ranger/rc.conf +++ b/home/.config/ranger/rc.conf @@ -71,7 +71,7 @@ set clear_filters_on_dir_change true set line_numbers false set one_indexed false set save_tabs_on_exit true -set wrap_scroll true +set wrap_scroll false set global_inode_type_filter set show_hidden true set show_hidden_bookmarks true diff --git a/home/.config/ranger/rifle.conf b/home/.config/ranger/rifle.conf index 5ef91563..d8816633 100644 --- a/home/.config/ranger/rifle.conf +++ b/home/.config/ranger/rifle.conf @@ -48,6 +48,20 @@ # Note: When using rifle in ranger, there is an additional flag "c" for # only running the current file even if you have marked multiple files. + +# -- Alternative example for opening files using xdg-open + +# Replace your rifle.conf with this file to use xdg-open as your file opener. +# This is, of course, adaptable for use with any other file opener. +# else = xdg-open "$1" + +# You need an "editor" and "pager" in order to use certain functions in ranger: +# label editor = "$EDITOR" -- "$@" +# label pager = "$PAGER" -- "$@" + +# -- End example + + #------------------------------------------- # Text # @@ -133,6 +147,7 @@ ext xcf, has gimp, X, flag f = gimp -- "$@" # Archives # ext to|torrent, flag f, has deluge = deluge "$1" +ext to|torrent, flag f, has transmission = transmission "$1" ext 7z|ace|ar|arc|xar|xpi|xz|zip|gz, has aunpack = aunpack -- "$@" ext bz2?|cab|cpio|cpt|deb|dgc|dmg, has aunpack = aunpack -- "$@" ext iso|jar|msi|pkg|rar|shar|tar|tgz, has aunpack = aunpack -- "$@" diff --git a/home/.vimrc b/home/.vimrc index 2f566b61..0ad1af6a 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -13,24 +13,35 @@ set softtabstop=4 " spaces to enter for each tab set shiftwidth=4 " amount of spaces for indentation set shortmess+=aAcIws " Hide or shorten certain messages -" enable mouse.. sgr is better but not every term supports it +" ------ leader mapping ------ + +let g:mapleader = ',' +map , + + +" ------ enable additional features ------ + +" enable mouse set mouse=a if has('mouse_sgr') + " sgr mouse is better but not every term supports it set ttymouse=sgr endif -" syntax highlighting with true colors in the terminal +" syntax highlighting syntax enable if has('termguicolors') && $DISPLAY !=? '' + " true color in the terminal set termguicolors - " fix true colours in some terminals + + " fix true color in some terminals (nvim doesn't have this issue) if !has('nvim') && !($TERM =~? 'xterm' || &term =~? 'xterm') let $TERM = 'xterm-256color' let &term = 'xterm-256color' endif endif -" change cursor shape for different modes +" change cursor shape for different editing modes (nvim does this by default) if !has('nvim') && exists('$TMUX') let &t_SI = "\Ptmux;\\e[5 q\\\" let &t_SR = "\Ptmux;\\e[4 q\\\" @@ -41,6 +52,12 @@ elseif !has('nvim') let &t_EI = "\e[2 q" endif + +" ------ basic maps ------ + +" open ranger as a file chooser using the function below +nnoremap r :call ranger() + " paste while in insert mode inoremap :set pastea+:set nopastea @@ -51,10 +68,17 @@ nnoremap n nzzzv nnoremap N Nzzzv nnoremap ==j +" re-visual text after changing indent +vnoremap > >gv +vnoremap < j v:count ? 'j' : 'gj' nnoremap k v:count ? 'k' : 'gk' + +" ------ autocmd ------ + " Reload changes if file changed outside of vim requires autoread augroup load_changed_file autocmd! @@ -67,3 +91,102 @@ augroup save_cursor_position autocmd! autocmd BufReadPost * call setpos(".", getpos("'\"")) augroup END + + +" ------ adv maps ------ + +" toggle line numbers +nnoremap nn + \ :if &number + \ set nonumber + \ else + \ set number + \ endif + +" strip trailing whitespace +nnoremap ss + \ :let _p = getpos(".") + \ let _s = (@/ != '') ? @/ : '' + \ %s/\s\+$//e + \ let @/ = _s + \ nohlsearch + \ unlet _s + \ call setpos('.', _p) + \ unlet _p + +" global replace +vnoremap sw "hy + \ :let b:sub = input('global replacement: ') + \ if b:sub !=? '' + \ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') + \ execute '%s/'.b:rep."/".b:sub.'/g' + \ unlet b:sub b:rep + \ endif +nnoremap sw + \ :let b:sub = input('global replacement: ') + \ if b:sub !=? '' + \ execute "%s//".b:sub.'/g' + \ unlet b:sub + \ endif + +" prompt before each replace +vnoremap cw "hy + \ :let b:sub = input('interactive replacement: ') + \ if b:sub !=? '' + \ let b:rep = substitute(getreg('h'), '/', '\\/', 'g') + \ execute '%s/'.b:rep.'/'.b:sub.'/gc' + \ unlet b:sub b:rep + \ endif +nnoremap cw + \ :let b:sub = input('interactive replacement: ') + \ if b:sub !=? '' + \ execute "%s//".b:sub.'/gc' + \ unlet b:sub + \ endif + +" highlight long lines +let w:longlines = matchadd('ColorColumn', '\%'.&tw.'v', &tw) +nnoremap ll + \ :if exists('w:longlines') + \ silent! call matchdelete(w:longlines) + \ unlet w:longlines + \ elseif &textwidth > 0 + \ let w:longlines = matchadd('ColorColumn', '\%'.&textwidth.'v', &textwidth) + \ else + \ let w:longlines = matchadd('ColorColumn', '\%80v', 80) + \ endif + +" local keyword jump +nnoremap fw + \ [I:let b:jump = input('Go To: ') + \ if b:jump !=? '' + \ execute "normal! ".b:jump."[\t" + \ unlet b:jump + \ endif + + +" open ranger as a file chooser +function! ranger() + let l:temp = tempname() + + execute 'silent !st -e ranger --choosefiles='.shellescape(l:temp).' $PWD' + + if !filereadable(temp) + redraw! + return + endif + + let l:names = readfile(l:temp) + if empty(l:names) + redraw! + return + endif + + execute 'edit '.fnameescape(l:names[0]) + + for l:name in l:names[1:] + execute 'argadd '.fnameescape(l:name) + endfor + + redraw! +endfunction