Giter Site home page Giter Site logo

mod-vim's Introduction

                                   .o8                       o8o                    
                                  "888                       `"'                    
 ooo. .oo.  .oo.    .ooooo.   .oooo888          oooo    ooo oooo  ooo. .oo.  .oo.   
 `888P"Y88bP"Y88b  d88' `88b d88' `888           `88.  .8'  `888  `888P"Y88bP"Y88b  
  888   888   888  888   888 888   888  8888888   `88..8'    888   888   888   888  
  888   888   888  888   888 888   888             `888'     888   888   888   888  
 o888o o888o o888o `Y8bod8P' `Y8bod88P"             `8'     o888o o888o o888o o888o 

mod-vim : a modular vim config

This is my vim config. It started out as spf-13 (Steve Francia's) vimrc. But things got out of hand and spf-13 had to be gutted. Also, I found my vim sessions could get a biiiitt slloooooow.

So in the words of the rogue marine to Nick Cage in "The Rock":

"I'll take pleasure in guttin' you boy!"

It works well for me on my macs and linux, but I've stripped out the windows support (at least for now). mod-vim achieves the same ends as spf-13 in that it installs a set of useful plugins and provides some organisational philosophy to the configuration.

Installation

Nothing fancy as yet. Simply clone this project somewhere convenient and create symlinks:

vim

  1. Edit path/to/mod-vim/vimrc setting g:vim_root_dir to $HOME
  2. Edit path/to/mod-vim/vimrc setting g:mod_root_dir to $HOME/.vim.d
  3. Edit path/to/mod-vim/vimrc setting g:mod_plugins_dir to $HOME/.vim/plugins.d
  4. Edit path/to/mod-vim/vimrc setting g:mod_data_dir to $HOME/.vim
  5. ln -s path/to/mod-vim/vimrc ~/.vimrc
  6. ln -s path/to/mod-vim/vim.d ~/.vim.d
  7. mkdir -p ~/.vim/plugins.d/
  8. Install vundle. See install details at [https://github.com/VundleVim/Vundle.vim]
  9. cd ~/.vim/plugins.d
  10. git clone [email protected]:VundleVim/Vundle.vim.git
  11. vim +PluginInstall! +qall

neovim

I'm now using neovim and, provided you install neovim's python support, this config and its plugins work.

Neovim puts its rc file in a different place to vim. See :help nvim-from-vim and also :help nvim-configuration

The XDG spec indicates that the default for $XDG_CONFIG_HOME is $HOME/.config. neovim will look for its config at $HOME/.config/nvim if $XDG_CONFIG_HOME is not set.

Setup

  1. mkdir -p $XDG_CONFIG_HOME/nvim/plugins.d
  2. cd $XDG_CONFIG_HOME/nvim/plugins.d
  3. git clone [email protected]:VundleVim/Vundle.vim.git
  4. cd ..
  5. ln -s path/to/mod-vim/vim.d mod-vim.d
  6. ln -s path/to/mod-vim/vimrc init.vim
  7. nvim +PluginInstall +qall

To setup neovim's python package

This is needed for YouCompleteMe and any other python based plugins you may want to use.

From :help nvim-python

To use Vim Python 2/3 plugins with Nvim, do the following:

  • For Python 2 plugins, make sure an interpreter for Python 2.6 or 2.7 is available in your $PATH, then install the neovim Python package systemwide:

    $ sudo pip2 install neovim

    or for the current user:

    $ pip2 install --user neovim

  • For Python 3 plugins, make sure an interpreter for Python 3.3 or above is available in your $PATH, then install the neovim Python package systemwide:

    $ sudo pip3 install neovim

    or for the current user:

    $ pip3 install --user neovim

Design

 g:vim_root_dir      <- $HOME for vim, $HOME/.config/nvim for neovim.
 |                       See variable definitions below.
 |
 |-- init.vim        <- If using neovim init.vim will be a symlink to
 |                      this file (mod-vim/vimrc)
 |
 +-- .vimrc          <- If using vim .vimrc will usually be a symlink to this
 |                      file (mod-vim/vimrc).
 |
 +-- g:mod_root_dir  <- The root of our vim config.
 |   |                  For vim: this can be $HOME/.vim.d/ which can be a 
 |   |                  symlink to mod-vim/vim.d/.
 |   |                  For neovim: $HOME/.config/nvim/mod-vim.d/ which can
 |   |                  also be a symlink to mod-vim/vim.d/.
 |   |
 |   +-- conf.d      <- contains symlinks to 'parts'.  These parts form the
 |   |                  active configuration.
 |   |
 |   +-- parts.d     <- 'parts' fragments of vim config to be sourced by
 |   |   |              .vimrc
 |   |   |
 |   |   +-- <*>        <- other vim config fragments to be included
 |   |
 |   +-- helpers.d      <- fragments of viml with functions to assist the
 |   |                     loading of the config
 |   |
 |   +-- swap.d         <- swap file directory
 |   |
 |   +-- view.d         <- view file directory
 |   |
 |   +-- undo.d         <- undo file directory
 |   |
 |   +-- backup.d       <- backup file directory
 |
 +-- g:mod_data_dir     <- Parent dir for files (n)vim creates while editing.
 |   |                     May not actually be under g:vim_root_dir.  nvim
 |   |                     places it under ~/.local/share/nvim/
 |   |
 |   +-- swap.d         <- swap file directory
 |   |
 |   +-- view.d         <- view file directory
 |   |
 |   +-- undo.d         <- undo file directory
 |   |
 |   +-- backup.d       <- backup file directory
 |
 +-- g:mod-plugins-dir <- Plugins installed below here.
 |   |                    For vim: $HOME/.vim/bundle/ typically.
 |   |                    for neovim: $HOME/.config/nvim/plugins.d/
 |   |
 |   +-- <plugins>


.vimrc/init.vim doesn't contain much. It defines a few symbols to refer to the directories in .vim.d/, and it calls a helper function, defined in helpers.d, to load the config fragments (parts) linked to from conf.d.

Customization

To be explained.

Plugins

SPF-13 installs a fairly massive number of plugins, and the functionality of some seem to overlap. I found that you really need to study each plugin and its keybindings to really get the best out of it (surprise).

It dawned on me that it would probably be best to build my own config and install only the plugins that I use. Secondly, I would only install one plugin at a time, set its key bindings, and learn how to make effective use of it.

With that in mind here's what is installed:

'VundleVim/Vundle.vim'
the plugin manager
'jefflasslett/positive-reinforcement'
my own syntax highlighting
'scrooloose/nerdtree'
project tree view
'Shougo/vimproc'
prerequisite for Shuogo's other plugins
'ctrlpvim/ctrlp.vim'
fuzzy finder and lister of files/buffers
'tpope/vim-fugitive'
git wrapper
'rking/ag.vim'
regexp file search
'scrooloose/syntastic'
syntax checker
'Twinside/vim-haskellConceal
replaces peices of haskell syntax with unicode chars
'eagletmt/ghcmod-vim'
calls ghc on modules of haskell code. Provides fantastic guidance.
'eagletmt/neco-ghc'
Autocompletion for Haskell code
'Twinside/vim-hoogle'
Haskell library search
'pbrisbin/html-template-syntax'
Yesod templates
'bling/vim-airline'
Enhanced status line
'Valloric/YouCompleteMe'
Code completion
'mattn/emmet-vim'
HTML editing
'groenewege/vim-less'
Syntax highlighting of Less CSS preprocessor syntax
'tpope/vim-rails'
Rails project navigation and helpers
'tpope/vim-bundler'
"Lightweight bag of goodies for bundler. Works well with rails.vim
'slim-template/vim-slim'
Syntax highlighting for slim templates
'kchmck/vim-coffee-script'
Syntax highlighting for coffeescript files

Adding and removing new plugins

Just edit the list in vim.d/parts.d/plugins.vim and run:

    vim +PluginInstall! +PluginClean +q

There may also be custom key bindings to alter and other fragments of config to edit.

More to come.

mod-vim's People

Contributors

spf13 avatar johntyree avatar putermancer avatar taxilian avatar jefflasslett avatar sbennett18 avatar jhnwsk avatar teasp00n avatar jcbwlkr avatar joveyu avatar e7h4n avatar switchspan avatar jamestomasino avatar lukedomanski avatar chrisnicola avatar victoredwardocallaghan avatar jphustman avatar mmikitka avatar wolfgangpfnuer avatar parherman avatar krbltgokhan avatar stephpy avatar fabianhjr avatar xcmer avatar rekendahl avatar shoekstra avatar jhenahan avatar lihuazhang avatar saswatpadhi avatar ramonmaruko avatar

Stargazers

Toomaj Boloorian avatar  avatar dchoi avatar

Watchers

James Cloos avatar  avatar

Forkers

cewood

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.