summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorBryan Richter <b@chreekat.net>2018-04-20 10:39:58 -0400
committerBryan Richter <b@chreekat.net>2018-04-20 10:39:58 -0400
commit94fd34a31b9228d20c66fbf6815b81354b5091a4 (patch)
tree23fa3a8b5a06a0512bd7a1d7d0a6bf39c5bf7f0e /pkgs/applications/editors
parent951d6a9f93f95b500f37d3c2dbb27f8b7dc512c3 (diff)
downloadnixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.tar
nixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.tar.gz
nixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.tar.bz2
nixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.tar.lz
nixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.tar.xz
nixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.tar.zst
nixlib-94fd34a31b9228d20c66fbf6815b81354b5091a4.zip
vim: idiomatic nix filetype plugin
* Never modify tabstop. This causes incompatibilities with other
  utilities that expect tabs to always be 8 spaces.
* Add standard boilerplate for system-level filetype plugins.
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/vim/ft-nix-support.patch9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/applications/editors/vim/ft-nix-support.patch b/pkgs/applications/editors/vim/ft-nix-support.patch
index 416ec18cf2ca..25fd4b6ad9fa 100644
--- a/pkgs/applications/editors/vim/ft-nix-support.patch
+++ b/pkgs/applications/editors/vim/ft-nix-support.patch
@@ -85,5 +85,12 @@ new file mode 100644
 --- /dev/null
 +++ b/runtime/ftplugin/nix.vim
 @@ -0,0 +1,2 @@
++" Only do this when not done yet for this buffer
++if exists("b:did_ftplugin")
++  finish
++endif
++let b:did_ftplugin = 1
++
 +" coding conventions
-+setlocal sw=2 ts=2 expandtab
++setlocal shiftwidth=2 expandtab
++let b:undo_ftplugin = "setlocal sw< et<"