A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/MarcWeber/vim-addon-local-vimrc below:

MarcWeber/vim-addon-local-vimrc: kiss local vimrc with hash protection

Configuration: these are the defaults:

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

Mind that lua files can be sourced the same way so using .vimrc.lua or similar should just be fine.

Features:

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

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.

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..

Thiago de Arruda (github.com/tarruba)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4