]> Frank Brehm's Git Trees - salt/states.git/commitdiff
Adding basic/editors.sls
authorFrank Brehm <frank@brehm-online.com>
Thu, 25 Feb 2016 22:01:39 +0000 (23:01 +0100)
committerFrank Brehm <frank@brehm-online.com>
Thu, 25 Feb 2016 22:01:39 +0000 (23:01 +0100)
basic/editors.sls [new file with mode: 0644]
basic/files/vimrc [new file with mode: 0644]
top.sls

diff --git a/basic/editors.sls b/basic/editors.sls
new file mode 100644 (file)
index 0000000..8acdecf
--- /dev/null
@@ -0,0 +1,22 @@
+vim:
+  pkg.installed:
+    - name: vim
+
+vimrc:
+  file.managed:
+    - name: /etc/vim/vimrc.local
+    - source: salt://basic/files/vimrc
+    - mode: 644
+    - user: root
+    - group: root
+    - require:
+      - pkg: vim
+
+default-editor:
+  alternatives.set:
+    - name: editor
+    - path: /usr/bin/vim.basic
+    - require:
+      - pkg: vim
+
+# vim: filetype=sls tabstop=2 shiftwidth=2
diff --git a/basic/files/vimrc b/basic/files/vimrc
new file mode 100644 (file)
index 0000000..c37139d
--- /dev/null
@@ -0,0 +1,39 @@
+set noai
+set nohlsearch
+set fo="tcq"
+set modeline
+set showmatch
+set ignorecase
+
+autocmd FileType sls set tabstop=2 expandtab shiftwidth=2 softtabstop=2
+autocmd FileType python set tabstop=4 expandtab shiftwidth=4 softtabstop=4
+autocmd FileType sh set tabstop=4 expandtab shiftwidth=4 softtabstop=4
+autocmd FileType perl set tabstop=4 noexpandtab shiftwidth=4
+
+set listchars=tab:»·,trail:·
+" set list
+
+if has("multi_byte")
+       set encoding=utf-8
+       setglobal fileencoding=utf-8
+else
+       echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
+endif
+
+if has("autocmd")
+    " Jump to the last position on opening
+    autocmd BufReadPost *
+        \ if ! exists("g:leave_my_cursor_position_alone") |
+        \     if line("'\"") > 0 && line ("'\"") <= line("$") |
+        \         exe "normal g'\"" |
+        \     endif |
+        \ endif
+endif " has("autocmd")
+
+
+filetype plugin off
+
+color delek
+
+syntax on
+
diff --git a/top.sls b/top.sls
index 94bf527ef20f500d0fce78b1a6626b0f20a1ab43..8804e1f0b972362ebf4f9d2ef02fb5aae8d619d4 100644 (file)
--- a/top.sls
+++ b/top.sls
@@ -1,16 +1,17 @@
 base:
   'ns2.uhu-banane.de':
     - debian.apt
+    - basic.editors
     - basic.localization
     - basic.pkgs
 #    - basic.rsync
     - basic.rsyslog
     - basic.shells
     - basic.skel
-#    - basic.editors
 
   'ns3.uhu-banane.de':
     - debian.apt
+    - basic.editors
     - basic.localization
     - basic.pkgs
     - basic.rsyslog