# FreeBSD documentation and XML



## mod3777 (Apr 1, 2019)

I have submitted my first contribution to FreeBSD documentation. 
However I use vim and I had to modify XML with vim. I don't have any prior experience in manipulating XML, but I tell you, I am not having fun with this.
How you people comfortably contribute to FreeBSD documentation?

This is my vimrc:


```
"" Load custom runtime path
" let $VIM         = $HOME . "/.vim"   
" let $VIMRUNTIME  = $HOME . "/.vim/runtime"
" set runtimepath^=$VIMRUNTIME           
" set helpfile=$VIMRUNTIME/doc/help.txt
"
"" General configurations
set nocompatible
set wildmenu
set encoding=utf-8

"" Syntax and other cool stuff
filetype plugin indent on               " Load plugins according to detected filetype.
syntax on
"set termguicolors
set t_Co=256
set fileencoding="UTF-8"
set background=dark
colorscheme nord

if has("autocmd")
    au BufNewFile,BufRead *.sgml,*.ent,*.xsl,*.xml call Set_SGML()
    au BufNewFile,BufRead *.[1-9] call ShowSpecial()
endif " has(autocmd)

function Set_Highlights()
    "match ExtraWhitespace /^\s* \s*\|\s\+$/
    highlight default link OverLength ErrorMsg
    match OverLength /\%71v.\+/
    return 0
endfunction

function ShowSpecial()
    setlocal list listchars=tab:>>,trail:*,eol:$
    hi def link nontext ErrorMsg
    return 0
endfunction

" ShowSpecial()

function Set_SGML()
    setlocal number
    syn match sgmlSpecial "&[^;]*;"
    setlocal syntax=sgml
    setlocal filetype=xml
    setlocal shiftwidth=2
    setlocal textwidth=70
    setlocal tabstop=8
    setlocal softtabstop=2
    setlocal formatprg="fmt -p"
    setlocal autoindent
    setlocal smartindent
    set backspace   =indent,eol,start       " Make backspace work as you would expect.
    " Rewrap paragraphs
    noremap P gqj
    " Replace spaces with tabs
    noremap T :s/        /\t/<CR>
    call ShowSpecial()
    call Set_Highlights()
    return 0
endfunction " Set_SGML()

"" Paste mode toggle
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode

" Remove all trailing whitespace by pressing F5
nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>

"" Text find/search mode
set incsearch                           " Highlight while searching with / or ?.
set hlsearch                            " Keep matches highlighted.

if has("gui_running")
    set guioptions-=m                   " Remove menu bar
    set guioptions-=T                   " Remove toolbar
    set guioptions-=r                   " Remove right-hand scroll bar
    set guioptions-=L                   " Remove left-hand scroll bar
    set guifont=Iosevka\ Term\ \ 12     " Fonts to be used"
    set vb t_vb=                        " Turn off that annoying beep!"
    " set lines=49                      " Set initial window size:lines
    " set columns=109                   " Set initial window size:columns
endif
```

Is there any dedicated tool for editing XML comfortably?


----------



## trev (Apr 2, 2019)

See www/bluefish for an XML editor.


----------

