All Projects → MarcWeber → Vim Addon Local Vimrc

MarcWeber / Vim Addon Local Vimrc

kiss local vimrc with hash protection

Labels

Projects that are alternatives of or similar to Vim Addon Local Vimrc

Vim Qfreplace
Perform the replacement in quickfix.
Stars: ✭ 121 (-11.03%)
Mutual labels:  viml
Vim Todo Lists
Vim plugin for TODO lists
Stars: ✭ 126 (-7.35%)
Mutual labels:  viml
Align
Help folks to align text, eqns, declarations, tables, etc
Stars: ✭ 132 (-2.94%)
Mutual labels:  viml
Vim Arduino
Compile and Deploy Arduino sketches in Vim
Stars: ✭ 122 (-10.29%)
Mutual labels:  viml
Spacemacs Theme.vim
Spacemacs-flavoured colorscheme for Vim and iTerm
Stars: ✭ 125 (-8.09%)
Mutual labels:  viml
Quickfixsigns vim
Mark quickfix & location list items with signs
Stars: ✭ 126 (-7.35%)
Mutual labels:  viml
Minimap Vim
Minimap for Vim
Stars: ✭ 121 (-11.03%)
Mutual labels:  viml
Haskellmode Vim
An unpacked copy of the haskellmode vimball. Ping me if it needs updating.
Stars: ✭ 135 (-0.74%)
Mutual labels:  viml
Perlomni.vim
perl omnicompletion for vim (including base class function compleltions .. etc)
Stars: ✭ 125 (-8.09%)
Mutual labels:  viml
Unite Outline
outline source for unite.vim
Stars: ✭ 132 (-2.94%)
Mutual labels:  viml
Xml.vim
helps editing xml (and [x]html, sgml, xslt) files
Stars: ✭ 123 (-9.56%)
Mutual labels:  viml
Vim Makegreen
MakeGreen runs make and shows a red or green message bar for success/failure. Speeds the red-green-refactor cycle!
Stars: ✭ 124 (-8.82%)
Mutual labels:  viml
Vim Noscrollbar
A scrollbar-like widget for the vim statusline
Stars: ✭ 129 (-5.15%)
Mutual labels:  viml
Provim
Repository to hold dotfiles and scripts specific to ProVim
Stars: ✭ 122 (-10.29%)
Mutual labels:  viml
Vim Textobj Line
Vim plugin: Text objects for the current line
Stars: ✭ 134 (-1.47%)
Mutual labels:  viml
Tmux Config
Configuration and tools for tmux. Can be used as a Vim plugin.
Stars: ✭ 121 (-11.03%)
Mutual labels:  viml
Vim Twig
Twig syntax highlighting, snipMate, etc.
Stars: ✭ 126 (-7.35%)
Mutual labels:  viml
Vimkata
Deliberate Practice lessons for learning the Vim Editor
Stars: ✭ 135 (-0.74%)
Mutual labels:  viml
Eddie Vim2
Yet another vimrc
Stars: ✭ 135 (-0.74%)
Mutual labels:  viml
Mustache.vim
Vim mode for mustache and handlebars (Deprecated)
Stars: ✭ 129 (-5.15%)
Mutual labels:  viml

vim-addon-local-vimrc

Configuration: these are the defaults:

let g:local_vimrc = {'names':['.vimrc'],'hash_fun':'LVRHashOfFile'}

Features:

  • When Vim starts up, every directory from root to the directory of the file is traversed and special files such as .(local-)vimrc files are sourced

  • Because you don't want to run untrusted code by accident, this plugin calculates a hash before sourcing. If its unknown you must confirm sourcing the file. The hash is updated automatically if you write a local vimrc file.

  • if you change a directory and edit a file the local vimrc files are resourced

USAGE:

create a .vimrc in your project directory. To make sure it's working, add: echo "this file is being sourced by vim"

Sample local .vimrc

augroup LOCAL_SETUP
  " using vim-addon-sql providing alias aware SQL completion for .sql files and PHP:
  autocmd BufRead,BufNewFile *.sql,*.php call vim_addon_sql#Connect('mysql',{'database':'DATABASE', 'user':'USER', 'password' : 'PASSWORD'})

  " for php use tab as indentation character. Display a tab as 4 spaces:
  " autocmd BufRead,BufNewFile *.php set noexpandtab| set tabstop=4 | set sw=4
  autocmd FileType php setlocal noexpandtab| setlocal tabstop=4 | setlocal sw=4

  " hint: for indentation settings modelines can be an alternative as well as
  " various plugins trying to set vim's indentation based on file contents.
augroup end

KISS: If you need filetype support write au commands into the local vimrc.

Yes I know that there are already a couple of existing similar plugins. But I they work for filetypes only (why?) and they don't verify file contents.

Alternatives

directory local .vimrc without walking up directory tree using vim builtin 'exrc' option: :h 'exrc' :h 'secure' but 'secure' is not very secure, eg echo system('cat .vimrc') is executed unless the file belongs to a different owner..

contributors

Thiago de Arruda (github.com/tarruba)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].