Home

Awesome

CDO_lazy_vim README

If you are using vi/vim/gvim for scripting with cdo, you can sometimes hardly remember cdo commands or you are just too lazy to type out "sellonlatbox" all the time, this might be something for you.

animation

Configuration instructions

cat add_cdo_complete_to_your_vimrc >> ~/.vimrc

Optional: <br>

  1. Variable completion: Set a file path and 'ENABLE' vars_completion in your ".vimrc" <br> animation <br>
  2. If you want to use <Tab> for auto-completion like in your shell, add those lines to your .vimrc <br> FIXME: Doesnt replace <C-U><C-U> yet, but only <C-N>
" Use TAB to complete when typing words, else inserts TABs as usual.
" Uses dictionary and source files to find matching words to complete.
" "See help completion for source,
" Note: usual completion is on <C-n> but more trouble to press all the time.
" Never type the same word twice and maybe learn a new spellings!
" Use the Linux dictionary when spelling is in doubt.
" Window users can copy the file to their machine.
function! Tab_Or_Complete()
  if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
    return "\<C-N>"
  else
      return "\<Tab>"
  endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>

Source: http://vim.wikia.com/wiki/Smart_mapping_for_tab_completion <br> The usual <Tab> command will still be executed when no completion is feasable, eg. in the beginning of (empty) lines <br> 3. If you fancy other auto-completion setting, play with the line

set complete=longest,menuone

The current setting completes up to the last common string and then shows a menu. Other options are listed in the vim help or http://vimdoc.sourceforge.net/htmldoc/options.html#'completeopt' <br>

<br>

For syntax highlighting: <br>

  1. Copy the file ".vim/after/syntax/sh.vim" and make sure your ".vimrc" contains
syntax on

This works for '.bash', '.ksh' and '*.sh'-files. If you want to use other shell file extensions, please rename according to the available file in "/usr/share/vim/vim74/syntax/".

Operating instructions

Start typing your desired cdo command and hit <Ctrl-X><Ctrl-U>

cdo sell<Ctrl-X><Ctrl-U>

Get the following autocompletion options

sellevel                sellevel description
sellevidx               sellevidx description
sellonlatbox            sellonlatbox description
selltype                selltype description
...

Hit <Ctrl-N> go get the first shown match

cdo sellevel

Hit another <Ctrl-N> to choose the next match or move down with arrow keys and hit <Enter> for your choice

Copyright and licensing information

Known bugs

Contact information

Aaron Spring <br> Bundesstraße 53 <br> ZMAW Room 122 <br> aaron.spring@mpimet.mpg.de <br> <br> Looking forward to receiving your questions, comments or wishes

Changelog

Working on

Credits and acknowledgements

Sister project