" line number and syntax highlighting fanciness set number set numberwidth=1 set relativenumber syntax enable " add a window for the file tree vsplit vert res 30 silent e . " add a window for a terminal split wincmd j res 10 term ++curwin ++kill=kill " netrw is the file tree explorer and there's " a bit of weirdness here because it's a plugin, " and plugins are loaded after vimrc. so you " have to define an autocmd that will get called " after the plugins are loaded " what this actually does is configure it so that " netrw opens files in the main editing window " rather than in its own window, and also focuses " the cursor onto the main editing window on startup autocmd VimEnter * call vim_enter() function s:vim_enter() let g:netrw_chgwin = 3 let g:netrw_liststyle = 3 wincmd l endfunction " custom function to help just a bit with writing " gophermaps.. just does the obvious thing to fill " out all the fields for infotext lines function s:gopher_info() execute "normal ^ii\$a fake (NULL) 0" endfunction " call it with :Info command Info call gopher_info() " custom function to finalize a gemlog.. what this " does is it adds links to the capsule's home page " and to the particular log's index to the header " and footer of the entry, then it saves the entry " and opens up the index, and starts writing the " link line to the new entry out with the filename " and date, so all i gotta do is put in the title function s:gemlog() let filename = expand("%:t") let datestring = system('date "+%Y-%m-%d"') normal G /^#/ execute "normal $a\\" execute "normal i=> index.gmi back to gemlog\" execute "normal i=> / back to home" execute "normal G$a\\" execute "normal i=>index.gmi back to gemlog\" execute "normal i=> / back to home\" w edit index.gmi /^$/ / execute "normal a\=> " .. filename .. " " .. datestring .. " " normal ddk$a return 1 endfunction " call it with :Gemlog command Gemlog call gemlog()