Skip to content
cutils is a repository of small functions I've found useful when using vim.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoload
doc
plugin
tests
.gitignore
.travis.yml
README.md
package.sh

README.md

About

Build Status

cutils is a repository of small functions I've found useful when using vim. This plugin was created to clean my vimrc file (which at the time was getting huge > 1200 LOC!). Feel free to use it, suggest new functions or improve current ones.

NOTE: Not all functions are mine. you'll find the url/author from where I fetch the original versions at the documentation.


Requirements

  • Vim 7.0+

Installation

  • Vundle way (recommended), add the following to your $HOME/.vimrc file:

      Bundle 'javier-lopez/cutils.vim'
    

    And run inside of vim:

      :BundleInstall
    
  • Pathogen way:

      $ git clone https://github.com/javier-lopez/cutils.vim.git ~/.vim/bundle/cutils.vim
    
  • Manual (simplest if you've never heard of vundle or pathogen), download the zip file generated from github and extract it to $HOME/.vim

      mv cutils.vim*.zip $HOME/.vim
      cd $HOME/.vim && unzip cutils*.zip
    

    Update the help tags from vim:

      :helpt ~/.vim/doc/
    

Usage

cutils define at least the following functions:

  • CULongLines (show long lines)

     :CULongLines [#_characters]
     let g:cutils_map_longlines = '<Leader>cul'
    


  • CUVCSInfo (show branch information, support: git, svn)

     :echo CUVCSInfo()
     [master]
     :set statusline+=%{CUVCSInfo()}
    


  • CUFileSize (show current file size in Kb or MB)

     :echo CUFileSize()
     2kb
     set statusline+=%-7{CUFileSize()}
    


  • CUAppendModeLine (append modeline at the end of current file)

     :CUAppendModeLine
     let g:cutils_map_appendmodeline  = '<Leader>cua'
    


  • CUSkel (template system for empty files)

     let g:cutils_skel_dir  = './assets/skeletons'
    


  • CUSetProperties (apply preferences by lang)

     let g:cutils_setproperties_dir  = './assets/lang'
    
  • CUVisualSearch (enable [*|#] in visual mode)

     let g:cutils_visualsearch  = 1 "enabled by default
    
You can’t perform that action at this time.