From 5e9e233fe519769f529f83369c021ce255864383 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 5 Apr 2020 22:11:04 +0300
Subject: [PATCH] Modular Vim config.

- Set filetype to unix by default.
- Use the filetype plugin to have per-filetype configuration.
- Use 2 spaces for YAML and Terraform files.
- Move Python configuration from .vimrc to filetype plugin.
---
 .vim/after/ftplugin/python.vim | 3 +++
 .vim/after/ftplugin/tf.vim     | 3 +++
 .vim/after/ftplugin/yaml.vim   | 3 +++
 .vimrc                         | 4 +---
 4 files changed, 10 insertions(+), 3 deletions(-)
 create mode 100644 .vim/after/ftplugin/python.vim
 create mode 100644 .vim/after/ftplugin/tf.vim
 create mode 100644 .vim/after/ftplugin/yaml.vim

diff --git a/.vim/after/ftplugin/python.vim b/.vim/after/ftplugin/python.vim
new file mode 100644
index 0000000..a8eead3
--- /dev/null
+++ b/.vim/after/ftplugin/python.vim
@@ -0,0 +1,3 @@
+setlocal smartindent
+setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class
+setlocal nocindent
diff --git a/.vim/after/ftplugin/tf.vim b/.vim/after/ftplugin/tf.vim
new file mode 100644
index 0000000..b892e77
--- /dev/null
+++ b/.vim/after/ftplugin/tf.vim
@@ -0,0 +1,3 @@
+setlocal tabstop=2
+setlocal softtabstop=2
+setlocal shiftwidth=2
diff --git a/.vim/after/ftplugin/yaml.vim b/.vim/after/ftplugin/yaml.vim
new file mode 100644
index 0000000..b892e77
--- /dev/null
+++ b/.vim/after/ftplugin/yaml.vim
@@ -0,0 +1,3 @@
+setlocal tabstop=2
+setlocal softtabstop=2
+setlocal shiftwidth=2
diff --git a/.vimrc b/.vimrc
index e867ed2..d8436c2 100644
--- a/.vimrc
+++ b/.vimrc
@@ -1,6 +1,3 @@
-"autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
-"autocmd BufRead *.py set nocindent
-"autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
 filetype plugin indent on
 setlocal tabstop=4
 setlocal softtabstop=4
@@ -12,3 +9,4 @@ setlocal incsearch
 syntax on
 setlocal modeline
 set viminfo='20,<9999,s1024,h
+setlocal fileformat=unix
-- 
GitLab