Usage Notes

  • You must have a working Trac repository version 0.10 or later complete with the xmlrpc plugin and a user with suitable access rights.
  • Vim must be compiled with python support and your client must have python 2.4.4 or later
  • Read the trac.vim leading comments on the setup and alter any configurations you like

Password/server details to be in a dictionary in your vimrc as follows

  • You will need the Align.vim plugin if you want to use the summary view Screenshots .
    let g:tracServerList{}
    let g:tracServerList['Vim Trac - vimtrac user'] = 'http://vimtracuser:wibble@www.ascetinteractive.com.au/vimtrac/login/xmlrpc'
    let g:tracServerList['(Server Name)'] = 'http://(user):(password)@(tracserverpath)/login/xmlrpc'

The servers can now be set by typing

	:TTServer <Server Name>
        :TWServer <Server Name>

The <tab> key will cycle through available servers.

Layout options

The plugin has a number of layout options that the respective views open with.

    let g:tracWikiStyle     = 'full'    " 'bottom' 'top' 'full'
    let g:tracSearchStyle   = 'left'   " 'right'
    let g:tracTimelineStyle = 'bottom'   " 'left' 'right'
    let g:tracTicketStyle   = 'full' " 'top' 'left' right' 'full'

  • Full mode offers the most screen realestate but will hide any other windows.
    • (In full mode <c-w><c-n><c-w>K will get a new window at the top you can :b or :e <tab> to...)
    • :TClose will close the trac screens but not vim.
  • The other settings open in various splits.

You could probably add a map to toggle this behavior

Defatult key mappings:

You'll need to uncomment the lines in the trac.vim or add to vimrc

  • <leader>to - Opens the Trac wiki view
  • <leader>tq - Closes the Trac wiki View
  • <leader>tw - Writes the Current Wiki Page (Uses default update Comment)
  • <leader>tt - Toggles between current window size mode. (normal, full horizontal,maximized ....)
  • <leader>tp - Launches a browser preview of the current wiki page

or

  • :TWOpen <WikiPage?> - Open the current servers wiki View
  • :TClose - Close any trac Views
  • :TWSave "<Comment>" - Saves the Active Wiki Page
  • :TTOpen <Ticket ID> - Open current servers Trac Ticket Browser
  • :TWCreate <NewWikiId?> - Create a Wiki Page
  • :TWServer <Trac Server> - Set the Current Server (tab complete). Opens to Wiki
  • :TTServer <Trac Server> - Set the Current Server (tab complete). Opens to Ticket
  • :TSearch <search term> - Opens Trac Search View
  • :TWPreview - opens current wiki in browser
  • :TWDump - lynx dump of the current wiki
  • :TChangesetOpen <id> - Opens a Unified Diff of a specific changeset

Buffer Specific Key Mappings

Note: if for any reason you think these mappings suck or mess with your setup you can modify the on_create methods in the relevant VimWindow? class in trac.py. In a future release. I'm probably going to add a flag to make it optional

  • In the Wiki TOC View Pages can be loaded for editing by hitting <enter> or <space> for browser preview
  • In the Ticket can be loaded for editing by hitting <enter> or <space> for browser preview on lines containing Ticket:>>
  • In the Wiki View Window a Page will go to the wiki page if you hit ctrl+] but will throw an error if you arent on a proper link.
  • Wikis can now be saved with :w and :wq. (invokes :TWSave)
  • In all Trac windows :q will return to the normal view
  • Wiki Syntax will work with this wiki syntax file http://www.vim.org/scripts/script.php?script_id=725