summaryrefslogtreecommitdiffstats
path: root/after/ftplugin
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2012-06-02 07:04:40 +0200
committerMichal Minar <miminar@redhat.com>2012-06-02 07:04:40 +0200
commit9ef239af97895f304d2fc875122f491d9f5d79b9 (patch)
treef43211a2ea32e5dfb0b8c85d6e642016176b9454 /after/ftplugin
parentdf00229162c136cb77f2172a18bc9871b0e90b3b (diff)
downloadvim-9ef239af97895f304d2fc875122f491d9f5d79b9.zip
vim-9ef239af97895f304d2fc875122f491d9f5d79b9.tar.gz
vim-9ef239af97895f304d2fc875122f491d9f5d79b9.tar.xz
added gpl license snippet
Diffstat (limited to 'after/ftplugin')
-rw-r--r--after/ftplugin/c_snippets.vim6
-rw-r--r--after/ftplugin/gpl.header15
2 files changed, 21 insertions, 0 deletions
diff --git a/after/ftplugin/c_snippets.vim b/after/ftplugin/c_snippets.vim
index d4159a2..8896d5e 100644
--- a/after/ftplugin/c_snippets.vim
+++ b/after/ftplugin/c_snippets.vim
@@ -26,6 +26,10 @@ function! s:Comment(text)
return <SID>FillLine("//".a:text." ", 2)."<CR><BS><BS>"
endfunction
+function! s:LoadFile(file)
+ return join(readfile(a:file), "\n")
+endfunction
+
let st = g:snip_start_tag
let et = g:snip_end_tag
let cd = g:snip_elem_delim
@@ -44,3 +48,5 @@ exec "Snippet if if(".st.et.") {<CR>".st.et."<CR>}<CR>".st.et
exec "Snippet main int main (int argc, char const* argv[]) {<CR>".st.et."<CR>return 0;<CR>}<CR>"
exec "Snippet Inc #include <".st.et.">".st.et
exec "Snippet inc #include \"".st.et."\"".st.et
+exec "Snippet gpl <ESC>:set paste<CR>i".<SID>LoadFile(expand("$HOME/.vim/after/ftplugin/gpl.header"))."<ESC>:set nopaste<CR>i"
+
diff --git a/after/ftplugin/gpl.header b/after/ftplugin/gpl.header
new file mode 100644
index 0000000..973b7b1
--- /dev/null
+++ b/after/ftplugin/gpl.header
@@ -0,0 +1,15 @@
+/* This file is part of <{name}>.
+ *
+ * <{name}> is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * <{name}> is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with <{name}>. If not, see <http://www.gnu.org/licenses/>.
+ */