summaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2024-10-09 16:00:11 -0500
committerluxagraf <sng@luxagraf.net>2024-10-09 16:00:11 -0500
commitd2e87e2d9f8ee2fd014087dafdc8c7cbd229a088 (patch)
treee7dfff8ec923c7e7b0aa8b1a2776f15fb057cf58 /.vimrc
parenteecedc09e7be82fd80460e268e3746c33a613602 (diff)
switched to alacritty and updated some shell scripts and w3m config
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc15
1 files changed, 15 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index f378848..ac4da84 100644
--- a/.vimrc
+++ b/.vimrc
@@ -59,6 +59,7 @@ autocmd BufLeave,FocusLost * silent! wall
let g:auto_save = 1
let g:auto_save_in_insert_mode = 0
"}}}
+
" Abbreviations {{{
" easier markdown links:
@@ -113,6 +114,20 @@ noremap <C-l> <C-w>l
inoremap <F5> <C-R>=strftime("%Y-%m-%d")<CR>
+nmap ,t yiw:call AddTag('<C-R>"')<CR>
+vmap ,t y:call AddTag('<C-R>"')<CR>
+
+function! AddTag(tagname)
+ let tagname = input('Tag name: ', a:tagname, 'tag')
+ let tagfile = expand('%:p')
+ let tagaddress = input('Address: ', '/\<' . a:tagname . '\>/')
+ if (tagname == '' || tagaddress == '')
+ return
+ endif
+ let cmd = '!echo -e "' . tagname . '\t' . tagfile . '\t' . tagaddress . '" >> ' . $HOME . '/.tags.global'
+ execute cmd
+endfunction
+
" Convert curly quotes to straight. {{{
" Any argument causes substitute to confirm changes.
function! ToStraight(line1, line2, args)