1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-04-19 16:27:45 +02:00

Compare commits

..

No commits in common. "46649c2ac8b07e1b850d5c44b8b45bbcac9bc0a4" and "0187e53508c41b9f0f36ab8a45223b181eafd7ee" have entirely different histories.

6 changed files with 47 additions and 39 deletions

View File

@ -444,16 +444,57 @@ nnoremap S :sort<cr>
nnoremap w :view<cr> nnoremap w :view<cr>
vnoremap w :view<cr>gv vnoremap w :view<cr>gv
" Open file in existing instance of vim " Open file in existing instance of gvim
nnoremap o :!$EDITOR %f<cr> nnoremap o :!gvim --remote-tab-silent %f<cr>
" Open file in new instance of gvim
nnoremap O :!gvim %f<cr>
" Open file in the background using its default program
nnoremap gb :file &<cr>l
" Interaction with system clipboard
if has('win')
" Yank current directory path to Windows clipboard with forward slashes
nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
" Yank path to current file to Windows clipboard with forward slashes
nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
elseif executable('xclip')
" Yank current directory path into the clipboard
nnoremap yd :!echo %d | xclip %i<cr>
" Yank current file path into the clipboard
nnoremap yf :!echo %c:p | xclip %i<cr>
elseif executable('xsel')
" Yank current directory path into primary and selection clipboards
nnoremap yd :!echo -n %d | xsel --input --primary %i &&
\ echo -n %d | xsel --clipboard --input %i<cr>
" Yank current file path into into primary and selection clipboards
nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
\ echo -n %c:p | xsel --clipboard --input %i<cr>
endif
" Mappings for faster renaming " Mappings for faster renaming
nnoremap I cw<c-a> nnoremap I cw<c-a>
nnoremap cc cw<c-u> nnoremap cc cw<c-u>
nnoremap A cw
" Mapping for extraction and compression " Open console in current directory
nnoremap xx :!vifm_extract %f<cr> nnoremap ,t :!xterm &<cr>
nnoremap aa :!vifm_compress %f 7z
" Open editor to edit vifmrc and apply settings after returning to vifm
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
" Open gvim to edit vifmrc
nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC &<cr>
" Toggle wrap setting on ,w key
nnoremap ,w :set wrap!<cr>
" Example of standard two-panel file managers mappings
nnoremap <f3> :!less %f<cr>
nnoremap <f4> :edit<cr>
nnoremap <f5> :copy<cr>
nnoremap <f6> :move<cr>
nnoremap <f7> :mkdir<space>
nnoremap <f8> :delete<cr>
" ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
# Disable ctrl-s and ctrl-q. # Disable ctrl-s and ctrl-q.
stty -ixon stty -ixon
setopt autocd autopushd setopt autocd autopushd \
# Enable autosuggestions # Enable autosuggestions
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

View File

@ -1 +0,0 @@
../../tools/compress

View File

@ -1 +0,0 @@
../../tools/extract

View File

@ -1,10 +0,0 @@
#!/bin/sh
if [ -e $1 ] ; then
case $2 in
7z) 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $1.7z $1 ;;
*) echo "don't know how to compress '$1' in '$2'..." ;;
esac
else
echo "'$1' is not a valid file or directory!"
fi

View File

@ -1,21 +0,0 @@
#!/bin/sh
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.tar.xz) tar xf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi