Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 541 Bytes

vim.md

File metadata and controls

23 lines (18 loc) · 541 Bytes

Vim

Notes

" use hybrid line numbering by default with automatic toggling
augroup numbertoggle
  autocmd!
  autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
  autocmd BufLeave,FocusLost,InsertEnter   * set norelativenumber
augroup END

" Change directory to the current buffer when opening files.
set autochdir

:%bd|e#  " close all other buffers; reopen last buffer

" Execute bash script; passing CWD to script
function InsertMdLink()
  let l:path = expand('%:p:h')
  execute 'r!vimsert ' . l:path
endfunction