This document assumes a standard Bricolage installation on Ubuntu. If you’ve configured Bricolage with local::lib and a different user, as per Installing Bricolage 2.0.1 on Ubuntu 10.04 LTS (Lucid Lynx), then you’ll need to adjust the user name, group and
bric_ftpd paths accordingly.
sudo vim /usr/local/bricolage/conf/bricolage.conf
# ENABLE_FTP_SERVER = No ENABLE_FTP_SERVER = Yes
The Virtual FTP Server should be run as the same user that runs the Bricolage Apache process.
You’ll probably need to change some permissions to allow
www-data to read the Bricolage configuration:
sudo chown -R root:www-data /usr/local/bricolage/conf
sudo -u www-data /usr/local/bricolage/bin/bric_ftpd -S
sudo -u www-data /usr/local/bricolage/bin/bric_ftpd -k
It should be possible to browse for and open files using the standard Vim edit and open commands:
Note: I have been able to connect to the virtual FTP server in Ubuntu desktop (11.04) through Places → Connect to server…. From there, I can browse files in the Nautilus file browser, and open them in GVim via Nautilus. However, attempting to open the files directly from Vim or GVim using the open command (as shown above) has not been quite so successful.
The top level site directory is shown, but I am unable to descend into it. Instead, I receive the following errors:
ftp: connect: Connection refused Not connected. Not connected.
Any updates to this section would therefore be appreciated :) See Virtual FTP Server with Vim for more information.
You can open and edit files directly on an FTP server using Vim.
If Vim attempts to create
.swp files in the same directory as the template, this causes errors to appear in the
log/ftp.log file. A simple solution is to tell Vim to store the swap files somewhere else:
Append to the end of
" Change the .swp file location set directory=/tmp
If there’s a suitable
.netrc file in your home directory, Vim will use it to supply your username and password to the FTP server:
machine bric.mikeraynham.co.uk login admin password "change me now!"
Lock down the permissions:
chmod 0600 ~/.netrc
Download, extract and install the syntax files:
wget -O vim-perl.tar.gz https://github.com/petdance/vim-perl/tarball/master/ tar xvfz vim-perl.tar.gz cd petdance-vim-perl-23483b7/ make install
To enable automatic syntax detection, add the following lines to the end of
vim73 may need changing if you have a different version of Vim.
sudo vim /usr/share/vim/vim73/filetype.vim
" TT2 - Template Toolkit au BufNewFile,BufRead *.tt,*.tt2 \ if getline(1) . getline(2) . getline(3) =~ '\c<!DOCTYPE html' || \ getline(1) . getline(2) . getline(3) =~ '\c<html' \| setf tt2html \| else \| setf tt2 \| endif