Loading ...
Sorry, an error occurred while loading the content.

53472abbreviations not working

Expand Messages
  • Neil Watson
    Sep 14, 2004
    • 0 Attachment
      I have a strange problem that I can't seem to narrow down. The
      abbreviations that I've been using for years have suddenly stopped
      working at random times. I'm not sure what the problem is or how to
      debug it.

      "set guioptions
      colorscheme neilwatson

      set guifont=luxi\ mono\ bold\ 14

      "window size
      set guiheadroom=20
      set columns=176
      set lines=999

      " remove menus, icons and scrollbars
      set guioptions-=m
      set guioptions-=T
      set guioptions-=R
      set guioptions-=r

      set history=50
      set ruler
      set expandtab
      set tabstop=4
      set shiftwidth=4
      set smartindent
      set autoindent
      set undolevels=100
      set showmatch
      set showcmd
      set number

      "for scp
      set nocp
      if version >= 600
      filetype plugin indent on

      :syntax on

      "spell check
      "map ,fs :w<CR>:!ispell %<CR>:e %<CR>
      map ,fs :w<CR>:!aspell -x -d canadian -c %<CR>:e %<CR>
      map ,fsf :w<CR>:!aspell -x -d french -c %<CR>:e %<CR>

      "open my gvimrc file
      map ,r :edit! ~/.gvimrc<CR>

      "my signature and date
      map ,sd :read !date<CR>kddi# Neil H Watson on <ESC><Home>

      "date stamp
      map ,d :read !date<CR>

      "set syntax to mason for dir
      au BufRead,BufNewFile */htdocs/* set syntax=mason


      set matchpairs+=<:>
      :syntax match xComment /<!.*/

      "html comment current line
      map ,hc I<!--<ESC>A--><ESC>

      "html header
      map ,hh i<html><CR><head><CR><meta name="keywords" content=""><CR><meta name="Author" content="Neil H Watson"><CR><title></title><CR></head><CR><body><CR><ESC>:3>3<CR>

      "html footer
      map ,hf :i</body><CR></html><C-C>

      "create html header lines (h1 to h6)
      nmap ,h1 <HOME>v$"zdi<h1><ESC>"zp$a</h1><ESC>
      nmap ,h2 <HOME>v$"zdi<h2><ESC>"zp$a</h2><ESC>
      nmap ,h3 <HOME>v$"zdi<h3><ESC>"zp$a</h3><ESC>
      nmap ,h4 <HOME>v$"zdi<h4><ESC>"zp$a</h4><ESC>
      nmap ,h5 <HOME>v$"zdi<h5><ESC>"zp$a</h5><ESC>
      nmap ,h6 <HOME>v$"zdi<h6><ESC>"zp$a</h6><ESC>

      "add html bold tags
      vmap ,hb "zdi<b><ESC>"zpgviw<ESC>a</b><ESC>

      "add html code tags
      vmap ,hc "zdi<code><ESC>"zpgv$<ESC>a</code><ESC>

      "add html name tags
      vmap ,hn "zdi<name="<ESC>"zpgv$<ESC>a"></a><ESC>

      "add html paragraph tags
      nmap ,hp <HOME>v$"zdi<p><ESC>"zp$a</p><ESC>

      "create html table from ;; delimited table
      nmap ,ht vip :s/^/<tr>/<CR> gv :s/$/<\/tr>/<CR> gv :s/<tr>/<tr>\r\t<td>/<CR> gvip :s/<\/tr>/<\/td>\r<\/tr>/<CR> gvip :s/;;/<\/td>\r\t<td>/g<CR><C-C>

      "create html list items
      nmap ,hl vip :s/^\(.*\)$/\t<li>\1<\/li>/g<CR><C-C>

      iab ht http://<C-R>=Eatchar('\s')<CR>
      iab ah <a href="<C-R>=Eatchar('\s')<CR>
      iab mailto <a href="mailto:"></a>


      :syntax match xComment /#.*/

      "create perl header
      map ,ph i!<ESC>:read !which perl<CR>kgJA<CR><CR>use strict;<CR>use warnings;<CR><CR><ESC>ggI#<ESC>G<C-C>

      "common DBI statements
      iab hashref while ($ref = $sth->fetchrow_hashref){
      "iab sth $sth = $dbh->prepare($statement) or die "Couldn't prepare statement: $statement ".$dbh->errstr;<CR>$sth->execute or die "Couldn't execute statement: $statement ".$dbh->errstr;


      "insert mason titles and names
      nmap ,mt GA<CR><%method title></%method><CR><%method header></%method><CR><%method author>Neil H Watson</%method><C-C>

      iab oa O&A.<C-R>=Eatchar('\s')<CR>
      iab oas O&A.sysadm =
      iab oass O&A.sales.sysadm =
      iab ws workstation support


      "remove last character (space) after abbreviation
      fun! Eatchar(pat)
      let c = nr2char(getchar())
      return (c =~ a:pat) ? '' : c

      Neil Watson | Gentoo Linux
      Network Administrator | Uptime 12 days
      http://watson-wilson.ca | AMD Athlon(tm) MP 2000+ x 2
    • Show all 19 messages in this topic