File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- autocmd BufNewFile ,BufRead *.clj,*.cljs set filetype = clojure
1+ au BufNewFile ,BufRead *.clj,*.cljs setf clojure
Original file line number Diff line number Diff line change 55; ; Copy this file to a project running the latest Clojure release and generate
66; ; updated Vimscript definitions.
77
8- (ns vim-clojure-static )
8+ (ns vim-clojure-static
9+ (:require clojure.string clojure.java.shell))
910
1011(def generation-message
1112 (str " \" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-001/vim_clojure_static.clj"
6970 sort
7071 (clojure.string/join \,)))))
7172
73+ (defn update-vim!
74+ " Update runtime files in dir/runtime"
75+ [src dst]
76+ (let [join (fn [& args] (clojure.string/join \/ args))
77+ indent-file (join dst " runtime/doc/indent.txt" )
78+ indent-buf (slurp indent-file)
79+ indent-match (re-find #"(?ms)^CLOJURE.*?(?=^[ \p {Lu}]+\t *\* )" indent-buf)
80+ indent-doc (re-find #"(?ms)^CLOJURE.*(?=^ABOUT)" (slurp (join src " doc/clojure.txt" )))]
81+ ; ; Insert indentation documentation
82+ (spit indent-file (clojure.string/replace-first indent-buf
83+ indent-match
84+ (str indent-doc \newline)))
85+ ; ; Copy runtime files
86+ (doseq [file [" autoload/clojurecomplete.vim" " ftplugin/clojure.vim" " indent/clojure.vim" " syntax/clojure.vim" ]]
87+ (println (clojure.java.shell/sh " cp" (join src file) (join dst " runtime" file))))))
88+
7289(comment
73- (spit " /tmp/clojure-defs.vim" (str syntax-keywords " \n\n " completion-words)))
90+ (spit " /tmp/clojure-defs.vim" (str syntax-keywords " \n\n " completion-words))
91+ (update-vim! " /home/guns/src/vim-clojure-static" " /home/guns/src/vim" ))
You can’t perform that action at this time.
0 commit comments