diff options
author | Paul Barker <paul@paulbarker.me.uk> | 2013-04-20 12:17:05 +0000 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-04-22 19:00:56 +0200 |
commit | 29f73dc16d537726696e408d526085bf88be26e6 (patch) | |
tree | 18b7ddecbe7560978f755df8e8741c9fd2140273 /meta-oe | |
parent | 4e896feefbf034a0d0bf5409bc69d86c24859ca4 (diff) | |
download | meta-openembedded-29f73dc16d537726696e408d526085bf88be26e6.tar.gz |
vim: use example vimrc from vim runtime files
Rather than keeping our own local vimrc file we can use vimrc_example.vim from
the runtime files distributed with vim. This keeps us up-to-date with changes to
the config when we move to a new vim version.
Also tidy comments around do_install_append so that it is clearer what is
happening.
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-support/vim/files/vimrc | 96 | ||||
-rw-r--r-- | meta-oe/recipes-support/vim/vim.inc | 7 |
2 files changed, 4 insertions, 99 deletions
diff --git a/meta-oe/recipes-support/vim/files/vimrc b/meta-oe/recipes-support/vim/files/vimrc deleted file mode 100644 index df65555af..000000000 --- a/meta-oe/recipes-support/vim/files/vimrc +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | " An example for a vimrc file. | ||
2 | " | ||
3 | " Maintainer: Bram Moolenaar <Bram@vim.org> | ||
4 | " Last change: 2008 Jul 02 | ||
5 | " | ||
6 | " To use it, copy it to | ||
7 | " for Unix and OS/2: ~/.vimrc | ||
8 | " for Amiga: s:.vimrc | ||
9 | " for MS-DOS and Win32: $VIM\_vimrc | ||
10 | " for OpenVMS: sys$login:.vimrc | ||
11 | |||
12 | " When started as "evim", evim.vim will already have done these settings. | ||
13 | if v:progname =~? "evim" | ||
14 | finish | ||
15 | endif | ||
16 | |||
17 | " Use Vim settings, rather then Vi settings (much better!). | ||
18 | " This must be first, because it changes other options as a side effect. | ||
19 | set nocompatible | ||
20 | |||
21 | " allow backspacing over everything in insert mode | ||
22 | set backspace=indent,eol,start | ||
23 | |||
24 | if has("vms") | ||
25 | set nobackup " do not keep a backup file, use versions instead | ||
26 | else | ||
27 | set backup " keep a backup file | ||
28 | endif | ||
29 | set history=50 " keep 50 lines of command line history | ||
30 | set ruler " show the cursor position all the time | ||
31 | set showcmd " display incomplete commands | ||
32 | set incsearch " do incremental searching | ||
33 | |||
34 | " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries | ||
35 | " let &guioptions = substitute(&guioptions, "t", "", "g") | ||
36 | |||
37 | " Don't use Ex mode, use Q for formatting | ||
38 | map Q gq | ||
39 | |||
40 | " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, | ||
41 | " so that you can undo CTRL-U after inserting a line break. | ||
42 | inoremap <C-U> <C-G>u<C-U> | ||
43 | |||
44 | " In many terminal emulators the mouse works just fine, thus enable it. | ||
45 | if has('mouse') | ||
46 | set mouse=a | ||
47 | endif | ||
48 | |||
49 | " Switch syntax highlighting on, when the terminal has colors | ||
50 | " Also switch on highlighting the last used search pattern. | ||
51 | "if &t_Co > 2 || has("gui_running") | ||
52 | " syntax on | ||
53 | " set hlsearch | ||
54 | "endif | ||
55 | |||
56 | " Only do this part when compiled with support for autocommands. | ||
57 | if has("autocmd") | ||
58 | |||
59 | " Enable file type detection. | ||
60 | " Use the default filetype settings, so that mail gets 'tw' set to 72, | ||
61 | " 'cindent' is on in C files, etc. | ||
62 | " Also load indent files, to automatically do language-dependent indenting. | ||
63 | filetype plugin indent on | ||
64 | |||
65 | " Put these in an autocmd group, so that we can delete them easily. | ||
66 | augroup vimrcEx | ||
67 | au! | ||
68 | |||
69 | " For all text files set 'textwidth' to 78 characters. | ||
70 | autocmd FileType text setlocal textwidth=78 | ||
71 | |||
72 | " When editing a file, always jump to the last known cursor position. | ||
73 | " Don't do it when the position is invalid or when inside an event handler | ||
74 | " (happens when dropping a file on gvim). | ||
75 | " Also don't do it when the mark is in the first line, that is the default | ||
76 | " position when opening a file. | ||
77 | autocmd BufReadPost * | ||
78 | \ if line("'\"") > 1 && line("'\"") <= line("$") | | ||
79 | \ exe "normal! g`\"" | | ||
80 | \ endif | ||
81 | |||
82 | augroup END | ||
83 | |||
84 | else | ||
85 | |||
86 | set autoindent " always set autoindenting on | ||
87 | |||
88 | endif " has("autocmd") | ||
89 | |||
90 | " Convenient command to see the difference between the current buffer and the | ||
91 | " file it was loaded from, thus the changes you made. | ||
92 | " Only define it when not defined already. | ||
93 | if !exists(":DiffOrig") | ||
94 | command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | ||
95 | \ | wincmd p | diffthis | ||
96 | endif | ||
diff --git a/meta-oe/recipes-support/vim/vim.inc b/meta-oe/recipes-support/vim/vim.inc index 359e2c592..fbc086199 100644 --- a/meta-oe/recipes-support/vim/vim.inc +++ b/meta-oe/recipes-support/vim/vim.inc | |||
@@ -15,7 +15,6 @@ SRC_URI = " \ | |||
15 | ftp://ftp.${PN}.org/pub/${PN}/unix/${PN}-${PV_MAJOR}.tar.bz2;name=${VIMDIR} \ | 15 | ftp://ftp.${PN}.org/pub/${PN}/unix/${PN}-${PV_MAJOR}.tar.bz2;name=${VIMDIR} \ |
16 | ftp://ftp.${PN}.org/pub/${PN}/extra/${PN}-${PV_MAJOR}-extra.tar.gz;name=${VIMDIR}-extra \ | 16 | ftp://ftp.${PN}.org/pub/${PN}/extra/${PN}-${PV_MAJOR}-extra.tar.gz;name=${VIMDIR}-extra \ |
17 | ftp://ftp.${PN}.org/pub/${PN}/extra/${PN}-${PV_MAJOR}-lang.tar.gz;name=${VIMDIR}-lang \ | 17 | ftp://ftp.${PN}.org/pub/${PN}/extra/${PN}-${PV_MAJOR}-lang.tar.gz;name=${VIMDIR}-lang \ |
18 | file://vimrc \ | ||
19 | " | 18 | " |
20 | 19 | ||
21 | S = "${WORKDIR}/${VIMDIR}/src" | 20 | S = "${WORKDIR}/${VIMDIR}/src" |
@@ -57,10 +56,12 @@ EXTRA_OECONF = " \ | |||
57 | STRIP=/bin/true \ | 56 | STRIP=/bin/true \ |
58 | " | 57 | " |
59 | 58 | ||
60 | # Work around rpm picking up csh as a dep | ||
61 | do_install_append() { | 59 | do_install_append() { |
60 | # Work around rpm picking up csh as a dep | ||
62 | chmod -x ${D}${datadir}/${PN}/${VIMDIR}/tools/vim132 | 61 | chmod -x ${D}${datadir}/${PN}/${VIMDIR}/tools/vim132 |
63 | install -m 0644 ${WORKDIR}/vimrc ${D}/${datadir}/${PN} | 62 | |
63 | # Install example vimrc from runtime files | ||
64 | install -m 0644 ../runtime/vimrc_example.vim ${D}/${datadir}/${PN}/vimrc | ||
64 | } | 65 | } |
65 | 66 | ||
66 | PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-data" | 67 | PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-data" |