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

Re: abbreviations not working

Expand Messages
  • Srinath Avadhanula
    Hello Sandip, From your .vimrc, I am guessing that you are using vim-latex. In this case, that is what is causing the problem... Vim-latex maps the
    Message 1 of 19 , Feb 1, 2003
      Hello Sandip,

      From your .vimrc, I am guessing that you are using vim-latex. In this
      case, that is what is causing the problem... Vim-latex maps the <space>
      key, which breaks abbreviations. I might fix this in the future if I
      find a good way of doing it (Its not really just vim-latex. If you had
      mapped say \ to something, then 12\ wouldn't have expanded to twelve\).
      In the meanwhile, here's what I suggest you can try doing in case you
      use want to use vim-latex:

      Put the line:

      call IMAP('12 ', 'twleve ', '')

      in ~/.vim/ftplugin/tex.vim

      and

      iab 12 twelve

      in your ~/.vimrc. If in a vim session, you invoke latex-suite, it will
      restore some functionality... Specifically, it will make 12<space>
      expand to twelve<space>... Its not quite a vim abbreviation because 12\
      will not expand to twelve\... but its a start anyway... If you never
      edit a tex file in a vim session, the iab in your ~/.vimrc will do the
      job a little better.

      Let me know if this works....

      Sorry to hear that you had to scrap all of your ~/.vim folder. Hopefully
      it isn't too much work to set up again... (Hopefully you just moved it
      or something).

      > i also realized that my latex commands were not doing as expected. main
      > reason for restarting my vim experience.

      Could you explain what you mean by this? I would like to hear about
      vim-latex bugs...

      > will surely come back to group if i get problems again.

      From next time on, a valuable debugging technique is to first find out
      if you still have problems by starting vim with
      vim -u NONE -U NONE
      This basically starts off vim without sourcing the .vimrc. If it works,
      then you know the problem is in the .vimrc. Then you can be a bit more
      brave and do:
      vim --noplugin
      Finally, comment out
      filetype plugin on
      in your ~/.vimrc... All these things will get you to the root of the
      problem much faster.

      Srinath
    • Dave Rahardja
      Did you type a space after the 12 ? - Dave Rahardja
      Message 2 of 19 , Feb 1, 2003
        Did you type a space after the "12"?

        - Dave Rahardja

        > -----Original Message-----
        > From: sandip [mailto:deshmukh@...]
        > Sent: Thursday, January 30, 2003 12:23 AM
        > To: vim@...
        > Subject: abbreviations not working
        >
        >
        > hello all
        >
        > i am editing a tex file.
        >
        > i do :iab 12 twelve
        >
        > type 12 in insert mode. nothing happens.
        >
        > am i doing something wrong?
        >
        > tia
        >
        > --
        > regards,
        > sandip p deshmukh
        > ------***--------
        > They are called computers simply because computation is the
        > only significant
        > job that has so far been given to them.
        >
      • Neil Watson
        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.
        Message 3 of 19 , Sep 14, 2004
          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.

          .gvimrc:
          "set guioptions
          colorscheme neilwatson

          "font
          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

          .vimrc:
          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
          endif

          :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

          "===================================
          "HTML SECTION
          "===================================

          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>


          "===================================
          "PERL SECTION
          "===================================

          :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;

          "===================================
          "MASON SECTION
          "===================================

          "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>


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


          "===================================
          "SUBROUTINES
          "===================================

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

          --
          Neil Watson | Gentoo Linux
          Network Administrator | Uptime 12 days
          http://watson-wilson.ca | 2.6.8.1 AMD Athlon(tm) MP 2000+ x 2
        • Neil Watson
          Upon further investigation I can see that the abbreviations are stored (:ab will list them). However, the abbreviations do actually execute. Is there some
          Message 4 of 19 , Sep 14, 2004
            Upon further investigation I can see that the abbreviations are stored
            (:ab will list them). However, the abbreviations do actually execute.

            Is there some setting that prevents or delays abbreviation completion?

            --
            Neil Watson | Gentoo Linux
            Network Administrator | Uptime 12 days
            http://watson-wilson.ca | 2.6.8.1 AMD Athlon(tm) MP 2000+ x 2
          • Neil Watson
            I ve narrowed the problem down to the global rc files (gvimrc or vimrc). I can t determine what is causing the problem. Perhaps someone here can?
            Message 5 of 19 , Sep 14, 2004
              I've narrowed the problem down to the global rc files (gvimrc or vimrc).
              I can't determine what is causing the problem. Perhaps someone here
              can?

              /etc/vim/vimrc
              " Default configuration file for Vim
              " Written by Aron Griffis <agriffis@...>
              " Modified by Ryan Phillips <rphillips@...>
              " Added Redhat's vimrc info by Seemant Kulleen <seemant@...>

              " The following are some sensible defaults for Vim for most users.
              " We attempt to change as little as possible from Vim's defaults,
              " deviating only where it makes sense
              set nocompatible " Use Vim defaults (much better!)
              set bs=2 " Allow backspacing over everything in insert mode
              set ai " Always set auto-indenting on
              "set backup " Keep a backup file
              set viminfo='20,\"500 " read/write a .viminfo file -- limit regs to 500 lines
              set history=50 " keep 50 lines of command history
              set ruler " Show the cursor position all the time

              " Added to default to high security within Gentoo. Fixes bug #14088.
              " Modified 07 Oct 2003 by agriffis from "modelines=0" to "nomodeline"
              " according to conversation on vim devel ML:
              " http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212696
              " http://article.gmane.org/gmane.editors.vim.devel/4410
              set nomodeline

              if v:lang =~ "^ko"
              set fileencodings=euc-kr
              set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
              elseif v:lang =~ "^ja_JP"
              set fileencodings=euc-jp
              set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
              elseif v:lang =~ "^zh_TW"
              set fileencodings=big5
              set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
              elseif v:lang =~ "^zh_CN"
              set fileencodings=gb2312
              set guifontset=*-r-*
              endif
              if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
              set fileencodings=utf-8,latin1
              endif

              " Don't use Ex mode, use Q for formatting
              map Q gq

              " Switch syntax highlighting on, when the terminal has colors
              " Also switch on highlighting the last used search pattern.
              if &t_Co > 2 || has("gui_running")
              syntax on
              set hlsearch
              endif

              if &term=="xterm"
              " Previously we would unset t_RV to prevent gnome-terminal from beeping as
              " vim started. These days it appears that gnome-terminal has been repaired,
              " so re-enable this, and don't restrict t_Co=8. (21 Jun 2004 agriffis)
              "set t_RV= " don't check terminal version
              "set t_Co=8
              set t_Sb=^[4%dm
              set t_Sf=^[3%dm
              set ttymouse=xterm2 " only works for >=xfree86-3.3.3, should be okay
              endif

              if has("autocmd")

              augroup gentoo
              au!

              " Gentoo-specific settings for ebuilds. These are the federally-mandated
              " required tab settings. See the following for more information:
              " http://www.gentoo.org/doc/en/xml/gentoo-howto.xml
              au BufRead,BufNewFile *.e{build,class} let is_bash=1|set ft=sh
              au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab

              " In text files, limit the width of text to 78 characters, but be careful
              " that we don't override the user's setting.
              autocmd BufNewFile,BufRead *.txt if &tw == 0 | set tw=78 | endif

              " When editing a file, always jump to the last cursor position
              autocmd BufReadPost *
              \ if line("'\"") > 0 && line ("'\"") <= line("$") |
              \ exe "normal g'\"" |
              \ endif

              " When editing a crontab file, set backupcopy to yes rather than auto. See
              " :help crontab and bug 53437.
              autocmd FileType crontab set backupcopy=yes

              augroup END

              endif " has("autocmd")

              /etc/vim/gvrimrc
              " Default configuration file for gvim
              " Written by Aron Griffis <agriffis@...>
              "
              " This file is read AFTER normal Vim initializations, like reading your .vimrc
              " file (and the default /usr/share/vim/vimrc). So there's no reason to
              " duplicate settings from vimrc. Red Hat has had this wrong for years, to the
              " great annoyance of users.

              " Pre-GUI settings
              set columns=80 lines=30 " don't inherit geometry from parent term
              set mousemodel=popup " right mouse button pops up a menu in the GUI

              " Use a sufficiently wide window automatically when started as "gvimdiff"
              if (&foldmethod == 'diff')
              set columns=165
              endif

              " For bug 33327, add a mapping which allows shift-insert to function
              " as expected in insert and command-line modes
              map! <s-insert> <c-r>*

              --
              Neil Watson | Gentoo Linux
              Network Administrator | Uptime 12 days
              http://watson-wilson.ca | 2.6.8.1 AMD Athlon(tm) MP 2000+ x 2
            Your message has been successfully submitted and would be delivered to recipients shortly.