Skip to content

light yet powerful vim config for general usage, tested under multi platforms

Notifications You must be signed in to change notification settings

YY00528/zf_vimrc.vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 

Repository files navigation

introduction

my personal vimrc config for vim

aiming to be used under multi platforms, low dependency, yet powerful for general usage

tested:

  • vim version 7.3 or above
  • Windows's gVim
  • cygwin's vim
  • Mac OS's vim and macvim (console or GUI)
  • Ubuntu's vim
  • Android's VimTouch (with full runtime)

may work: (search and see g:zf_fakevim)

  • Qt Creator's FakeVim (able to use, no plugin support, some keymap doesn't work)
  • IntelliJ IDEA's IdeaVim (able to use, no plugin support, some keymap doesn't work)
  • XCode's XVim (not recommended, some action have unexpected behavior)

for me, I use this config mainly for C/C++ markdown PHP development, as well as for default text editor and log viewer

main usage habits difference

  • <leader> is single quote '

    each leader keymap has these prefix to prevent conflict with other config

    • <leader>v : main prefix, perform actions that are not descructive
    • <leader>c : descructive actions, such as modify text or file directly
    • <leader>z : secondary prefix, additions to <leader>v
  • many keymap with letters A~Z a~z, less keymap with ctrl, non with alt or meta

  • q <space> jk mapped as <esc>

  • Q to record macro and M to replay macro, to simplify macro usage, only one macro is supported

quick install

if you have curl, git, vim installed, here's a very simple command to install everything:

curl zsaber.com/vim | sh

# or, run the install script directly
sh zf_vim_install.sh

after installed, you may use <leader>vimru to update with this repo (note: local changes to zf_vimrc.vim would be discarded)

manual install

  1. download or clone the zf_vimrc.vim file to anywhere

  2. have these in your .vimrc (under linux) or _vimrc (under Windows):

    source path/zf_vimrc.vim
    
  3. use Vundle to manage plugins

    git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
    
  4. it's recommended to modify platform-dependent settings in .vimrc, such as:

    au GUIEnter * simalt ~x
    set guifont=Consolas:h12
    set termencoding=cp936
    let g:zf_colorscheme_256=1
    source path/zf_vimrc.vim
    

for a list of plugins and configs, please refer to the zf_vimrc.vim itself, which is self described

additional requirement

  • cygwin

    not necessary, but strongly recommended for Windows users

  • GNU grep (greater than 2.5.3)

    for vim-easygrep if you want to use Perl style regexp

    note the FreeBSD version won't work due to the lack of -P option of grep

  • Pandoc

    for Markdown preview and conversion

  • LLVM

    for clang_complete, you should:

    • have python support

    • have g:clang_library_path been set properly

      the default config may suit most case, modify it if necessary

platform spec

cygwin

when used under different version of cygwin, you should concern these settings if weird problem occurred:

set shell=cmd.exe
set shellcmdflag=/c

or

set shell=bash
set shellcmdflag=-c

set it directly to .vimrc, choose the right one for you

Android's VimTouch

  • VimTouch Full Runtime is also required

  • the vim config is placed under /data/data/net.momodalo.app.vimtouch/files/.vimrc

  • you should manually copy all settings from other platform to VimTouch's folder, the result folder tree should looks like:

    /data/data/net.momodalo.app.vimtouch/files/
        .vim/
            bundle/
                ...
        .vimrc
        zf_vimrc.vim
    
  • othree/xml.vim won't work on VimTouch, disable it manually by:

    let g:plugin_xml_vim=0
    

Note: vimrc may or may not work under Android 5 or above, reason unknown, this is VimTouch's problem, not this repo's problem

for simulation plugins of IDE

let g:zf_fakevim=1
  • not fully tested
  • some vim simulation plugins doesn't support source command, so you may need to paste directly to proper vimrc files (e.g. .ideavim, .xvimrc)
  • some vim simulation plugins doesn't support if-statement and plugins, so you may need to manually delete all lines under the if g:zf_no_plugin!=1 section

About

light yet powerful vim config for general usage, tested under multi platforms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 97.4%
  • Shell 2.6%