Skip to content

Commit

Permalink
paste stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
antipasta committed Sep 24, 2020
1 parent 9d7c13d commit 3aadc17
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
10 changes: 0 additions & 10 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ fd() {
cd "$dir"
}

#if [ -x "$(command -v gpg-agent)" ]; then
# if pgrep -x "gpg-agent" > /dev/null
# then
# export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh
# else
# eval $(gpg-agent --daemon --enable-ssh-support --sh)
# fi
#fi
#


function toggle-agent {
if [[ $SSH_AUTH_SOCK =~ gpg ]]
Expand Down
34 changes: 29 additions & 5 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,38 @@ map .# :s/^\(\s*\)#\+/\1<CR> <Esc>:noh<CR>
" }}}


" Function key toggles {{{
" Paste stuff {{{
set pastetoggle=<F1>
function! WrapForTmux(s)
if !exists('$TMUX')
return a:s
endif

let tmux_start = "\<Esc>Ptmux;"
let tmux_end = "\<Esc>\\"

return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
endfunction

let &t_SI .= WrapForTmux("\<Esc>[?2004h")
let &t_EI .= WrapForTmux("\<Esc>[?2004l")

function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction

inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()


"line number toggles
nnoremap <silent> <F2> :exec &nu==&rnu? "se nu!" : "se rnu!"<CR>
nnoremap <silent> <F3> :exec "se rnu!"<CR>
" }}}

" Basic key remapping {{{
let mapleader = ","
"line number toggles
nnoremap <silent> <F12> :exec &nu==&rnu? "se nu!" : "se rnu!"<CR>
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
Expand Down Expand Up @@ -339,6 +361,8 @@ augroup CredFile
au! BufRead,BufNewFile,BufEnter creds.yml.asc nmap <Leader>o f:w"+y$0yt::vs ../sf-deploy-application/<C-r>".aes<CR>
augroup END

let g:nv_search_paths = ['~/wiki']




" vim: set fdm=marker:

0 comments on commit 3aadc17

Please sign in to comment.