Commit 83e7172d authored by Murukesh Mohanan's avatar Murukesh Mohanan

merge colorscheme

parents a9cddabf 9256db4c
"
" utility functions for haskellmode plugins
"
" (Claus Reinke; last modified: 22/06/2010)
"
" part of haskell plugins: http://projects.haskell.org/haskellmode-vim
" please send patches to <claus.reinke@talk21.com>
" find start/extent of name/symbol under cursor;
" return start, symbolic flag, qualifier, unqualified id
" (this is used in both haskell_doc.vim and in GHC.vim)
function! haskellmode#GetNameSymbol(line,col,off)
let name = "[a-zA-Z0-9_']"
let symbol = "[-!#$%&\*\+/<=>\?@\\^|~:.]"
"let [line] = getbufline(a:buf,a:lnum)
let line = a:line
" find the beginning of unqualified id or qualified id component
let start = (a:col - 1) + a:off
if line[start] =~ name
let pattern = name
elseif line[start] =~ symbol
let pattern = symbol
else
return []
endif
while start > 0 && line[start - 1] =~ pattern
let start -= 1
endwhile
let id = matchstr(line[start :],pattern.'*')
" call confirm(id)
" expand id to left and right, to get full id
let idPos = id[0] == '.' ? start+2 : start+1
let posA = match(line,'\<\(\([A-Z]'.name.'*\.\)\+\)\%'.idPos.'c')
let start = posA>-1 ? posA+1 : idPos
let posB = matchend(line,'\%'.idPos.'c\(\([A-Z]'.name.'*\.\)*\)\('.name.'\+\|'.symbol.'\+\)')
let end = posB>-1 ? posB : idPos
" special case: symbolic ids starting with .
if id[0]=='.' && posA==-1
let start = idPos-1
let end = posB==-1 ? start : end
endif
" classify full id and split into qualifier and unqualified id
let fullid = line[ (start>1 ? start-1 : 0) : (end-1) ]
let symbolic = fullid[-1:-1] =~ symbol " might also be incomplete qualified id ending in .
let qualPos = matchend(fullid, '\([A-Z]'.name.'*\.\)\+')
let qualifier = qualPos>-1 ? fullid[ 0 : (qualPos-2) ] : ''
let unqualId = qualPos>-1 ? fullid[ qualPos : -1 ] : fullid
" call confirm(start.'/'.end.'['.symbolic.']:'.qualifier.' '.unqualId)
return [start,symbolic,qualifier,unqualId]
endfunction
function! haskellmode#GatherImports()
let imports={0:{},1:{}}
let i=1
while i<=line('$')
let res = haskellmode#GatherImport(i)
if !empty(res)
let [i,import] = res
let prefixPat = '^import\s*\%({-#\s*SOURCE\s*#-}\)\?\(qualified\)\?\s\+'
let modulePat = '\([A-Z][a-zA-Z0-9_''.]*\)'
let asPat = '\(\s\+as\s\+'.modulePat.'\)\?'
let hidingPat = '\(\s\+hiding\s*\((.*)\)\)\?'
let listPat = '\(\s*\((.*)\)\)\?'
let importPat = prefixPat.modulePat.asPat.hidingPat.listPat ".'\s*$'
let ml = matchlist(import,importPat)
if ml!=[]
let [_,qualified,module,_,as,_,hiding,_,explicit;x] = ml
let what = as=='' ? module : as
let hidings = split(hiding[1:-2],',')
let explicits = split(explicit[1:-2],',')
let empty = {'lines':[],'hiding':hidings,'explicit':[],'modules':[]}
let entry = has_key(imports[1],what) ? imports[1][what] : deepcopy(empty)
let imports[1][what] = haskellmode#MergeImport(deepcopy(entry),i,hidings,explicits,module)
if !(qualified=='qualified')
let imports[0][what] = haskellmode#MergeImport(deepcopy(entry),i,hidings,explicits,module)
endif
else
echoerr "haskellmode#GatherImports doesn't understand: ".import
endif
endif
let i+=1
endwhile
if !has_key(imports[1],'Prelude')
let imports[0]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]}
let imports[1]['Prelude'] = {'lines':[],'hiding':[],'explicit':[],'modules':[]}
endif
return imports
endfunction
function! haskellmode#ListElem(list,elem)
for e in a:list | if e==a:elem | return 1 | endif | endfor
return 0
endfunction
function! haskellmode#ListIntersect(list1,list2)
let l = []
for e in a:list1 | if index(a:list2,e)!=-1 | let l += [e] | endif | endfor
return l
endfunction
function! haskellmode#ListUnion(list1,list2)
let l = []
for e in a:list2 | if index(a:list1,e)==-1 | let l += [e] | endif | endfor
return a:list1 + l
endfunction
function! haskellmode#ListWithout(list1,list2)
let l = []
for e in a:list1 | if index(a:list2,e)==-1 | let l += [e] | endif | endfor
return l
endfunction
function! haskellmode#MergeImport(entry,line,hiding,explicit,module)
let lines = a:entry['lines'] + [ a:line ]
let hiding = a:explicit==[] ? haskellmode#ListIntersect(a:entry['hiding'], a:hiding)
\ : haskellmode#ListWithout(a:entry['hiding'],a:explicit)
let explicit = haskellmode#ListUnion(a:entry['explicit'], a:explicit)
let modules = haskellmode#ListUnion(a:entry['modules'], [ a:module ])
return {'lines':lines,'hiding':hiding,'explicit':explicit,'modules':modules}
endfunction
" collect lines belonging to a single import statement;
" return number of last line and collected import statement
" (assume opening parenthesis, if any, is on the first line)
function! haskellmode#GatherImport(lineno)
let lineno = a:lineno
let import = getline(lineno)
if !(import=~'^import\s') | return [] | endif
let open = strlen(substitute(import,'[^(]','','g'))
let close = strlen(substitute(import,'[^)]','','g'))
while open!=close
let lineno += 1
let linecont = getline(lineno)
let open += strlen(substitute(linecont,'[^(]','','g'))
let close += strlen(substitute(linecont,'[^)]','','g'))
let import .= linecont
endwhile
return [lineno,import]
endfunction
function! haskellmode#UrlEncode(string)
let pat = '\([^[:alnum:]]\)'
let code = '\=printf("%%%02X",char2nr(submatch(1)))'
let url = substitute(a:string,pat,code,'g')
return url
endfunction
" TODO: we could have buffer-local settings, at the expense of
" reconfiguring for every new buffer.. do we want to?
function! haskellmode#GHC()
if (!exists("g:ghc") || !executable(g:ghc))
if !executable('ghc')
echoerr s:scriptname.": can't find ghc. please set g:ghc, or extend $PATH"
return 0
else
let g:ghc = 'ghc'
endif
endif
return 1
endfunction
function! haskellmode#GHC_Version()
if !exists("g:ghc_version")
let g:ghc_version = substitute(system(g:ghc . ' --numeric-version'),'\n','','')
endif
return g:ghc_version
endfunction
function! haskellmode#GHC_VersionGE(target)
let current = split(haskellmode#GHC_Version(), '\.' )
let target = a:target
for i in current
if ((target==[]) || (i>target[0]))
return 1
elseif (i==target[0])
let target = target[1:]
else
return 0
endif
endfor
return 1
endfunction
airline @ 1b8e4b96
Subproject commit e2a120869ba36da5d26df74fb23ef4052d55b6f0 Subproject commit 1b8e4b965adc97af623bf71c046c7d7408aba725
syntastic @ 272fc7df
Subproject commit a7758aa188a2a1979070c704ff721216bdd68bc8 Subproject commit 272fc7df3a87876eb2ebd69d29c93920ef8c57c1
This diff is collapsed.
This diff is collapsed.
"
" general Haskell source settings
" (shared functions are in autoload/haskellmode.vim)
"
" (Claus Reinke, last modified: 28/04/2009)
"
" part of haskell plugins: http://projects.haskell.org/haskellmode-vim
" please send patches to <claus.reinke@talk21.com>
" try gf on import line, or ctrl-x ctrl-i, or [I, [i, ..
setlocal include=^import\\s*\\(qualified\\)\\?\\s*
setlocal includeexpr=substitute(v:fname,'\\.','/','g').'.'
setlocal suffixesadd=hs,lhs,hsc
" Haskell Cuteness for Vim.
" Inspired by emacs-haskell-cuteness.
" Based on unilatex.vim by Jos van den Oever <oever@fenk.wau.nl>
"
" Changelog
" 0.1.3 - added more mappings and fixed bug in HaskellSrcToUTF8, thanks
" to edwardkmett at Reddit
" 0.1.2 - added syntax highlighting as suggested by sfvisser at Reddit
" 0.1.1 - fixed stupid bug with haskell lambda expression
" 0.1 - initial release
"
" Version: 0.1.2
" Last Changed: 7 April 2009
" Maintainer: Andrey Popp <andrey.popp@braintrace.ru>
" Map to unicode symbols
imap <buffer> \ λ
imap <buffer> <-
imap <buffer> ->
imap <buffer> <=
imap <buffer> >=
imap <buffer> ==
imap <buffer> /=
imap <buffer> =>
imap <buffer> >> »
imap <buffer> .<space><space>
imap <buffer> forall<space>
" Turn syntax highlight on for new symbols
syn match hsVarSym "(\|λ\|←\|→\|≲\|≳\|≡\|≠\| )"
if exists("s:loaded_unihaskell")
finish
endif
let s:loaded_unihaskell = 1
augroup HaskellC
autocmd BufReadPost *.hs cal s:HaskellSrcToUTF8()
autocmd BufWritePre *.hs cal s:UTF8ToHaskellSrc()
autocmd BufWritePost *.hs cal s:HaskellSrcToUTF8()
augroup END
" function to convert ''fancy haskell source'' to haskell source
function s:UTF8ToHaskellSrc()
let s:line = line(".")
let s:column = col(".")
silent %s/λ/\\/eg
silent %s/←/<-/eg
silent %s/→/->/eg
silent %s/≲/<=/eg
silent %s/≳/>=/eg
silent %s/≡/==/eg
silent %s/≠/\/=/eg
silent %s/⇒/=>/eg
silent %s/»/>>/eg
silent %s/∙ /. /eg
silent %s/∀/forall /eg
let &l:fileencoding = s:oldencoding
call cursor(s:line,s:column)
endfunction
" function to convert haskell source to ''fancy haskell source''
function s:HaskellSrcToUTF8()
let s:line = line(".")
let s:column = col(".")
let s:oldencoding = &l:fileencoding
set fileencoding=utf-8
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=\\\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/λ\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=->\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/→\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=<-\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/←\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=<=\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/≲\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=>=\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/≳\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<===\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/≡\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=\/=\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/≠\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<==>\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/⇒\1/eg
silent %s/[^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>?@\^|~.]\@<=>>\([^λ←→≲≳≡≠⇒»∙∀\\\-!#$%&*+/<=>\?@\^|~.]\)/»\1/eg
silent %s/forall /∀/eg
silent %s/ \@<=\. /∙ /eg
let &l:fileencoding = s:oldencoding
call cursor(s:line,s:column)
endfunction
do HaskellC BufRead
This diff is collapsed.
" rudimentary hpaste support for vim
" (using netrw for reading, wget for posting/annotating)
"
" claus reinke, last modified: 07/04/2009
"
" part of haskell plugins: http://projects.haskell.org/haskellmode-vim
" unless wget is in your PATH, you need to set g:wget
" before loading this script. windows users are out of
" luck, unless they have wget installed (such as the
" cygwin one looked for here), or adapt this script to
" whatever alternative they have at hand (perhaps using
" vim's perl/python bindings?)
if !exists("g:wget")
if executable("wget")
let g:wget = "!wget -q"
else
let g:wget = "!c:\\cygwin\\bin\\wget -q"
endif
endif
" read (recent) hpaste files
" show index in new buffer, where ,r will open current entry
" and ,p will annotate current entry with current buffer
command! HpasteIndex call HpasteIndex()
function! HpasteIndex()
new
read http://hpaste.org
%s/\_$\_.//g
%s/<tr[^>]*>//g
%s/<\/tr>/ /g
g/<\/table>/d
g/DOCTYPE/d
%s/<td>\([^<]*\)<\/td><td><a href="\/fastcgi\/hpaste\.fcgi\/view?id=\([0-9]*\)">\([^<]*\)<\/a><\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td><td>\([^<]*\)<\/td>/\2 [\1] "\3" \4 \5 \6/
map <buffer> ,r 0yE:noh<cr>:call HpasteEditEntry('"')<cr>
endfunction
" load an existing entry for editing
command! -nargs=1 HpasteEditEntry call HpasteEditEntry(<f-args>)
function! HpasteEditEntry(entry)
new
exe 'Nread http://hpaste.org/fastcgi/hpaste.fcgi/raw?id='.a:entry
"exe 'map <buffer> ,p :call HpasteAnnotate('''.a:entry.''')<cr>'
endfunction
" " posting temporarily disabled -- needs someone to look into new
" " hpaste.org structure
" " annotate existing entry (only to be called via ,p in HpasteIndex)
" function! HpasteAnnotate(entry)
" let nick = input("nick? ")
" let title = input("title? ")
" if nick=='' || title==''
" echo "nick or title missing. aborting annotation"
" return
" endif
" call HpastePost('annotate/'.a:entry,nick,title)
" endfunction
"
" " post new hpaste entry
" " using 'wget --post-data' and url-encoded content
" command! HpastePostNew call HpastePost('new',<args>)
" function! HpastePost(mode,nick,title,...)
" let lines = getbufline("%",1,"$")
" let pat = '\([^[:alnum:]]\)'
" let code = '\=printf("%%%02X",char2nr(submatch(1)))'
" let lines = map(lines,'substitute(v:val."\r\n",'''.pat.''','''.code.''',''g'')')
"
" let url = 'http://hpaste.org/' . a:mode
" let nick = substitute(a:nick,pat,code,'g')
" let title = substitute(a:title,pat,code,'g')
" if a:0==0
" let announce = 'false'
" else
" let announce = a:1
" endif
" let cmd = g:wget.' --post-data="content='.join(lines,'').'&nick='.nick.'&title='.title.'&announce='.announce.'" '.url
" exe escape(cmd,'%')
" endfunction
-- 7.6.3
AlternativeLayoutRule
AlternativeLayoutRuleTransitional
Arrows
BangPatterns
CApiFFI
CPP
ConstrainedClassMethods
ConstraintKinds
DataKinds
DatatypeContexts
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DisambiguateRecordFields
DoAndIfThenElse
DoRec
EmptyDataDecls
ExistentialQuantification
ExplicitForAll
ExplicitNamespaces
ExtendedDefaultRules
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
FunctionalDependencies
GADTSyntax
GADTs
GHCForeignImportPrim
GeneralizedNewtypeDeriving
Haskell2010
Haskell98
ImplicitParams
ImplicitPrelude
ImpredicativeTypes
IncoherentInstances
InstanceSigs
InterruptibleFFI
KindSignatures
LambdaCase
LiberalTypeSynonyms
MagicHash
MonadComprehensions
MonoLocalBinds
MonoPatBinds
MonomorphismRestriction
MultiParamTypeClasses
MultiWayIf
NPlusKPatterns
NamedFieldPuns
NoAlternativeLayoutRule
NoAlternativeLayoutRuleTransitional
NoArrows
NoBangPatterns
NoCApiFFI
NoCPP
NoConstrainedClassMethods
NoConstraintKinds
NoDataKinds
NoDatatypeContexts
NoDefaultSignatures
NoDeriveDataTypeable
NoDeriveFoldable
NoDeriveFunctor
NoDeriveGeneric
NoDeriveTraversable
NoDisambiguateRecordFields
NoDoAndIfThenElse
NoDoRec
NoEmptyDataDecls
NoExistentialQuantification
NoExplicitForAll
NoExplicitNamespaces
NoExtendedDefaultRules
NoFlexibleContexts
NoFlexibleInstances
NoForeignFunctionInterface
NoFunctionalDependencies
NoGADTSyntax
NoGADTs
NoGHCForeignImportPrim
NoGeneralizedNewtypeDeriving
NoImplicitParams
NoImplicitPrelude
NoImpredicativeTypes
NoIncoherentInstances
NoInstanceSigs
NoInterruptibleFFI
NoKindSignatures
NoLambdaCase
NoLiberalTypeSynonyms
NoMagicHash
NoMonadComprehensions
NoMonoLocalBinds
NoMonoPatBinds
NoMonomorphismRestriction
NoMultiParamTypeClasses
NoMultiWayIf
NoNPlusKPatterns
NoNamedFieldPuns
NoNondecreasingIndentation
NoOverlappingInstances
NoOverloadedStrings
NoPackageImports
NoParallelArrays
NoParallelListComp
NoPatternGuards
NoPatternSignatures
NoPolyKinds
NoPolymorphicComponents
NoPostfixOperators
NoQuasiQuotes
NoRank2Types
NoRankNTypes
NoRebindableSyntax
NoRecordPuns
NoRecordWildCards
NoRecursiveDo
NoRelaxedLayout
NoRelaxedPolyRec
NoScopedTypeVariables
NoStandaloneDeriving
NoTemplateHaskell
NoTraditionalRecordSyntax
NoTransformListComp
NoTupleSections
NoTypeFamilies
NoTypeOperators
NoTypeSynonymInstances
NoUnboxedTuples
NoUndecidableInstances
NoUnicodeSyntax
NoUnliftedFFITypes
NoViewPatterns
NondecreasingIndentation
OverlappingInstances
OverloadedStrings
PackageImports
ParallelArrays
ParallelListComp
PatternGuards
PatternSignatures
PolyKinds
PolymorphicComponents
PostfixOperators
QuasiQuotes
Rank2Types
RankNTypes
RebindableSyntax
RecordPuns
RecordWildCards
RecursiveDo
RelaxedLayout
RelaxedPolyRec
Safe
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TraditionalRecordSyntax
TransformListComp
Trustworthy
TupleSections
TypeFamilies
TypeOperators
TypeSynonymInstances
UnboxedTuples
UndecidableInstances
UnicodeSyntax
UnliftedFFITypes
Unsafe
ViewPatterns
--
-fimplicit-import-qualified
This diff is collapsed.
This diff is collapsed.
" $Id: eregex_e.vim,v 1.40 2003-06-03 18:25:59+09 ta Exp ta $
" An evaluater for eregex.vim
if exists('g:eregex_evaluater_cmd') && exists('g:eregex_evaluater_how_exe')
if g:eregex_evaluater_how_exe==0
" :s silently exec, handle errmsg
silent! exec g:eregex_evaluater_cmd
elseif g:eregex_evaluater_how_exe==1
" :s invoked by :g and
" :s with confirm option
exec g:eregex_evaluater_cmd
elseif g:eregex_evaluater_how_exe==2
":g
redraw
exec g:eregex_evaluater_cmd
endif
endif
{'version': 0.3, 'files': [{'file': '/home/bro3886/.vim/doc/eregex.jax', 'checksum': ''}, {'file': '/home/bro3886/.vim/doc/eregex.txt', 'checksum': ''}, {'file': '/home/bro3886/.vim/plugin/eregex.vim', 'checksum': ''}, {'file': '/home/bro3886/.vim/plugin/eregex_e.vim', 'checksum': ''}], 'install_type': 'makefile', 'script_version': '2.61', 'package': 'eregex.vim', 'generated_by': 'Vim-Makefile'}
...@@ -51,12 +51,10 @@ set pastetoggle=<F10> ...@@ -51,12 +51,10 @@ set pastetoggle=<F10>
set title set title
set laststatus=2 set laststatus=2
"set t_Co=256
nore ; : nore ; :
nore , ; nore , ;
map < :tabp<CR> noremap < :tabp<CR>
map > :tabn<CR> noremap > :tabn<CR>
command! C let @/="" command! C let @/=""
cmap w!! w !sudo tee >/dev/null % cmap w!! w !sudo tee >/dev/null %
vnoremap cy "*y vnoremap cy "*y
...@@ -64,19 +62,20 @@ vnoremap cp "*p ...@@ -64,19 +62,20 @@ vnoremap cp "*p
inoremap <Down> <C-o>gj inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk inoremap <Up> <C-o>gk
colorscheme koehler colorscheme murphy
execute pathogen#infect() execute pathogen#infect()
autocmd Bufenter,BufNew *.pro set syntax=prolog autocmd Bufenter,BufNew *.pro set syntax=prolog
autocmd Filetype gitcommit setlocal spell textwidth=72 autocmd Filetype gitcommit setlocal spell textwidth=72
autocmd Bufenter *.hs compiler ghc autocmd Bufenter *.hs compiler ghc
" From http://vi.stackexchange.com/questions/258/
autocmd BufWritePre *.sh if !filereadable(expand('%')) | let b:is_new = 1 | endif autocmd BufWritePre *.sh if !filereadable(expand('%')) | let b:is_new = 1 | endif
autocmd BufWritePost *.sh if get(b:, 'is_new', 0) | silent execute '!chmod +x %' | endif autocmd BufWritePost *.sh if get(b:, 'is_new', 0) | silent execute '!chmod +x %' | endif
let g:SuperTabDefaultCompletionType="context" let g:SuperTabDefaultCompletionType="context"
set omnifunc=syntaxcomplete#Complete set omnifunc=syntaxcomplete#Complete
set foldmethod=syntax set foldmethod=syntax
"let g:SuperTabDefaultCompletionType = \"<C-X><C-O>\"
let g:syntastic_cpp_compiler_options=' -std=c++11' let g:syntastic_cpp_compiler_options=' -std=c++11'
let g:syntastic_python_python_exec = '/usr/bin/python3' let g:syntastic_python_python_exec = '/usr/bin/python3'
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
...@@ -104,9 +103,53 @@ if has("gui_running") ...@@ -104,9 +103,53 @@ if has("gui_running")
endif endif
endif endif
" From http://vi.stackexchange.com/questions/239/
if @% == "" && getcwd() == "/tmp" if @% == "" && getcwd() == "/tmp"
:silent edit test.sh :silent edit test.sh
endif endif
let g:DiffColors=100 let g:DiffColors=100
set path+=~/devel/elearning_academy/**
" function LookupFiles ()
" python <<EOF
" from os.path import *
" from vim import *
" current_file = eval ('expand("%")')
" current_index = str (current.buffer.number)
" PATHS = ['~', '~/.vim', '/etc']
"
" if current_file != '' and not isfile (current_file):
" for p in map (expanduser, PATHS):
" f = join (p, current_file)
" if isfile (f):
" command ('bad ' + f)
" command ('bd ' + current_index)
" command ('bl')
" # command ('silent keepalt file ' + f)
" break
" EOF
" endfunction
"
" autocmd BufWinEnter * nested call LookupFiles()
" From http://vi.stackexchange.com/questions/2009/
function! FindInPath(name)
let path=&path
" Add any extra directories to the normal search path
set path+=~,~/.vim,/etc
" If :find finds a file, then wipeout the buffer that was created for the "new" file
setlocal bufhidden=wipe
exe 'silent! keepalt find '. fnameescape(a:name)
" Restore 'path' and 'bufhidden' to their normal values
let &path=path
set bufhidden<
endfunction
autocmd BufNewFile * nested call FindInPath(expand('<afile>'))
"au VimEnter * tab all | tabfirst
" From http://vi.stackexchange.com/questions/2358/
autocmd FileType * exec("setlocal dictionary+=".$HOME."/.vim/dictionary/".expand('<amatch>'))
set completeopt=menuone,longest,preview
set complete+=k
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment