From 5db6c04c425173274fa032bb216bbca9154ddb55 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 12 Dec 2015 17:34:16 +0100 Subject: [PATCH 1/4] Add vim modelines to all shell scripts Signed-off-by: Uli Schlachter --- build-utils/atoms-ext.sh | 2 ++ build-utils/atoms-int.sh | 2 ++ build-utils/dist.sh | 2 ++ build-utils/git-version-stamp.sh | 2 ++ build-utils/lgi-check.sh | 2 ++ build-utils/travis-apidoc.sh | 2 ++ tests/run.sh | 2 ++ utils/awesome-client | 2 ++ 8 files changed, 16 insertions(+) diff --git a/build-utils/atoms-ext.sh b/build-utils/atoms-ext.sh index 59ba03a38..3822dcdb8 100755 --- a/build-utils/atoms-ext.sh +++ b/build-utils/atoms-ext.sh @@ -7,3 +7,5 @@ while read atom do echo extern xcb_atom_t $atom\; done < $1 + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/build-utils/atoms-int.sh b/build-utils/atoms-int.sh index 5f8f127f5..0c75ba829 100755 --- a/build-utils/atoms-int.sh +++ b/build-utils/atoms-int.sh @@ -18,3 +18,5 @@ do done < $1 echo '};' + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/build-utils/dist.sh b/build-utils/dist.sh index 7aa290bf7..d64bb26f3 100755 --- a/build-utils/dist.sh +++ b/build-utils/dist.sh @@ -11,3 +11,5 @@ cd dist echo -n $VERSION > awesome-$SVERSION/.version_stamp tar cjf awesome-$SVERSION.tar.bz2 awesome-$SVERSION tar cJf awesome-$SVERSION.tar.xz awesome-$SVERSION + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/build-utils/git-version-stamp.sh b/build-utils/git-version-stamp.sh index 039470007..0e676de6e 100755 --- a/build-utils/git-version-stamp.sh +++ b/build-utils/git-version-stamp.sh @@ -29,3 +29,5 @@ then mv "$2.new" "$2" echo -n "$CURRENT" > "$1" fi + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/build-utils/lgi-check.sh b/build-utils/lgi-check.sh index 0f7ad78e8..f315513dc 100755 --- a/build-utils/lgi-check.sh +++ b/build-utils/lgi-check.sh @@ -33,3 +33,5 @@ lua -e '_, _, major_minor, patch = string.find(require("lgi.version"), "^(%d%.%d # Check for the needed gi files lua -e 'l = require("lgi") assert(l.cairo, l.Pango, l.PangoCairo, l.GLib, l.Gio)' || die + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/build-utils/travis-apidoc.sh b/build-utils/travis-apidoc.sh index 67f4bdea7..0ceab5ed7 100755 --- a/build-utils/travis-apidoc.sh +++ b/build-utils/travis-apidoc.sh @@ -107,3 +107,5 @@ if [ "$TRAVIS_PULL_REQUEST" != false ]; then -d "{\"body\": \"Documentation has been updated for this PR:\n$COMPARE_LINKS\"}" \ https://api.github.com/repos/awesomeWM/awesome/issues/${TRAVIS_PULL_REQUEST}/comments fi + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/run.sh b/tests/run.sh index 70a808327..4938594ba 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -184,3 +184,5 @@ if ! [ $errors = 0 ]; then exit 1 fi exit 0 + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/utils/awesome-client b/utils/awesome-client index 72555d333..5ffa7ec60 100755 --- a/utils/awesome-client +++ b/utils/awesome-client @@ -62,3 +62,5 @@ then else a_dbus_send "$(cat)" fi + +# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 From a14137070457ceeb46a7f3f612098d460164340e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 12 Dec 2015 17:37:35 +0100 Subject: [PATCH 2/4] Add a vim modeline to all C source Most of the files already had this, at least. Signed-off-by: Uli Schlachter --- awesome-version-internal.h | 2 ++ build-tests/__builtin_clz.c | 2 ++ common/buffer.c | 2 ++ common/buffer.h | 2 ++ common/lualib.c | 2 ++ common/version.h | 2 ++ config.h | 2 ++ xkb.c | 2 ++ xkb.h | 3 ++- xrdb.c | 2 ++ xrdb.h | 3 ++- 11 files changed, 22 insertions(+), 2 deletions(-) diff --git a/awesome-version-internal.h b/awesome-version-internal.h index e916e50c1..173c2d3cf 100644 --- a/awesome-version-internal.h +++ b/awesome-version-internal.h @@ -5,3 +5,5 @@ #define AWESOME_RELEASE "@AWESOME_RELEASE@" #endif //_AWE_VERSION_INTERNAL_H_ + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/build-tests/__builtin_clz.c b/build-tests/__builtin_clz.c index 42cd15af0..b4ab53785 100644 --- a/build-tests/__builtin_clz.c +++ b/build-tests/__builtin_clz.c @@ -10,3 +10,5 @@ main(void) return (__builtin_clz(42)); } + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/common/buffer.c b/common/buffer.c index 0c7757f5c..2bff36042 100644 --- a/common/buffer.c +++ b/common/buffer.c @@ -113,3 +113,5 @@ buffer_detach(buffer_t *buf) buffer_init(buf); return res; } + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/common/buffer.h b/common/buffer.h index 1f42029ef..8ada17544 100644 --- a/common/buffer.h +++ b/common/buffer.h @@ -195,3 +195,5 @@ void buffer_addf(buffer_t *buf, const char *fmt, ...) __attribute__((format(printf, 2, 3))); #endif + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/common/lualib.c b/common/lualib.c index a2bbcf68a..312fb2d59 100644 --- a/common/lualib.c +++ b/common/lualib.c @@ -61,3 +61,5 @@ void luaA_dumpstack(lua_State *L) } fprintf(stderr, "------- Lua stack dump end ------\n"); } + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/common/version.h b/common/version.h index ee368bc33..7bf3bc908 100644 --- a/common/version.h +++ b/common/version.h @@ -27,3 +27,5 @@ const char *awesome_version_string(void); const char *awesome_release_string(void); #endif + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/config.h b/config.h index 46c2c31ab..94c64070a 100644 --- a/config.h +++ b/config.h @@ -10,3 +10,5 @@ #cmakedefine HAS___BUILTIN_CLZ #endif //_CONFIG_H_ + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/xkb.c b/xkb.c index 07560c9da..95b788844 100644 --- a/xkb.c +++ b/xkb.c @@ -315,3 +315,5 @@ xkb_free(void) 0); xkb_free_keymap(); } + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/xkb.h b/xkb.h index c3987157a..fc91e1f99 100644 --- a/xkb.h +++ b/xkb.h @@ -33,5 +33,6 @@ int luaA_xkb_set_layout_group(lua_State *L); int luaA_xkb_get_layout_group(lua_State *L); int luaA_xkb_get_group_names(lua_State *L); - #endif + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/xrdb.c b/xrdb.c index 974dee756..af393145c 100644 --- a/xrdb.c +++ b/xrdb.c @@ -74,3 +74,5 @@ int luaA_xrdb_get_value(lua_State *L) { return 0; } } + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/xrdb.h b/xrdb.h index 57a0083a5..3e0053516 100644 --- a/xrdb.h +++ b/xrdb.h @@ -26,5 +26,6 @@ int luaA_xrdb_get_value(lua_State *L); - #endif + +// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 From 63653bed766b84e2d3dc52a7c1b0548ca9875342 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 12 Dec 2015 17:42:33 +0100 Subject: [PATCH 3/4] Add the right vim modeline to all lua files Signed-off-by: Uli Schlachter --- docs/config.ld | 2 +- lib/awful/hotkeys_popup/init.lua | 2 ++ lib/awful/hotkeys_popup/keys/init.lua | 2 ++ lib/awful/layout/suit/fair.lua | 2 ++ lib/awful/layout/suit/floating.lua | 2 ++ lib/awful/layout/suit/init.lua | 2 ++ lib/awful/layout/suit/magnifier.lua | 2 ++ lib/awful/layout/suit/max.lua | 2 ++ lib/awful/layout/suit/tile.lua | 2 ++ lib/awful/mouse/finder.lua | 2 +- lib/awful/tooltip.lua | 2 +- spec/preload.lua | 2 ++ tests/_runner.lua | 2 ++ tests/_wibox_helper.lua | 2 ++ tests/test-benchmark.lua | 2 ++ tests/test-focus.lua | 2 ++ tests/test-leaks.lua | 2 ++ tests/test-spawn-snid.lua | 2 ++ tests/test-spawn.lua | 2 ++ tests/test-urgent.lua | 2 ++ themes/default/theme.lua | 1 + themes/sky/theme.lua | 1 + themes/xresources/theme.lua | 1 + themes/zenburn/theme.lua | 2 ++ 24 files changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/config.ld b/docs/config.ld index 6a805061e..94403fe1e 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -71,4 +71,4 @@ file = { } } --- vim: filetype=lua +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/hotkeys_popup/init.lua b/lib/awful/hotkeys_popup/init.lua index 513dd76ca..dc65d586a 100644 --- a/lib/awful/hotkeys_popup/init.lua +++ b/lib/awful/hotkeys_popup/init.lua @@ -14,3 +14,5 @@ local hotkeys_popup = { } hotkeys_popup.show_help = hotkeys_popup.widget.show_help return hotkeys_popup + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/hotkeys_popup/keys/init.lua b/lib/awful/hotkeys_popup/keys/init.lua index ce3411f35..52892793d 100644 --- a/lib/awful/hotkeys_popup/keys/init.lua +++ b/lib/awful/hotkeys_popup/keys/init.lua @@ -12,3 +12,5 @@ local keys = { vim = require("awful.hotkeys_popup.keys.vim") } return keys + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/layout/suit/fair.lua b/lib/awful/layout/suit/fair.lua index 030728b93..dcb3d3688 100644 --- a/lib/awful/layout/suit/fair.lua +++ b/lib/awful/layout/suit/fair.lua @@ -95,3 +95,5 @@ function fair.arrange(p) end return fair + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/layout/suit/floating.lua b/lib/awful/layout/suit/floating.lua index 3a320df17..d94672f35 100644 --- a/lib/awful/layout/suit/floating.lua +++ b/lib/awful/layout/suit/floating.lua @@ -100,3 +100,5 @@ end floating.name = "floating" return floating + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/layout/suit/init.lua b/lib/awful/layout/suit/init.lua index a29b2c01f..5cfd9f352 100644 --- a/lib/awful/layout/suit/init.lua +++ b/lib/awful/layout/suit/init.lua @@ -16,3 +16,5 @@ return magnifier = require("awful.layout.suit.magnifier"); spiral = require("awful.layout.suit.spiral"); } + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/layout/suit/magnifier.lua b/lib/awful/layout/suit/magnifier.lua index 4e69c4e0e..6f9bc7b01 100644 --- a/lib/awful/layout/suit/magnifier.lua +++ b/lib/awful/layout/suit/magnifier.lua @@ -141,3 +141,5 @@ end magnifier.name = "magnifier" return magnifier + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/layout/suit/max.lua b/lib/awful/layout/suit/max.lua index 14ea9f02b..6313724c7 100644 --- a/lib/awful/layout/suit/max.lua +++ b/lib/awful/layout/suit/max.lua @@ -49,3 +49,5 @@ function max.fullscreen.arrange(p) end return max + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/layout/suit/tile.lua b/lib/awful/layout/suit/tile.lua index 976b7bca0..e8f0d3ee5 100644 --- a/lib/awful/layout/suit/tile.lua +++ b/lib/awful/layout/suit/tile.lua @@ -321,3 +321,5 @@ tile.mouse_resize_handler = tile.right.mouse_resize_handler tile.name = tile.right.name return tile + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/mouse/finder.lua b/lib/awful/mouse/finder.lua index 86e5b34b2..cb43692c3 100644 --- a/lib/awful/mouse/finder.lua +++ b/lib/awful/mouse/finder.lua @@ -167,4 +167,4 @@ end return setmetatable(finder, finder.mt) --- vim: ft=lua:et:sw=4:ts=4:sts=4:tw=78 +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/lib/awful/tooltip.lua b/lib/awful/tooltip.lua index ca51e8012..83899f3da 100644 --- a/lib/awful/tooltip.lua +++ b/lib/awful/tooltip.lua @@ -284,4 +284,4 @@ end return setmetatable(tooltip, tooltip.mt) --- vim: ft=lua:et:sw=4:ts=4:sts=4:tw=78 +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/spec/preload.lua b/spec/preload.lua index 9c5610f15..8535a2d84 100644 --- a/spec/preload.lua +++ b/spec/preload.lua @@ -2,3 +2,5 @@ -- won't be cleared and reloaded by Busted. This is needed for lgi because lgi -- is not safe to reload and yet Busted manages to do this. require("lgi") + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/_runner.lua b/tests/_runner.lua index dce58a144..c07490fe9 100644 --- a/tests/_runner.lua +++ b/tests/_runner.lua @@ -85,3 +85,5 @@ runner.run_steps = function(steps) end return runner + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/_wibox_helper.lua b/tests/_wibox_helper.lua index 3612374ad..d21ebbfec 100644 --- a/tests/_wibox_helper.lua +++ b/tests/_wibox_helper.lua @@ -30,3 +30,5 @@ return { create_wibox = function() return wb, textclock, img, left_layout, right_layout, layout end } + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/test-benchmark.lua b/tests/test-benchmark.lua index 065b8e47e..5f600bdd5 100644 --- a/tests/test-benchmark.lua +++ b/tests/test-benchmark.lua @@ -73,3 +73,5 @@ benchmark(redraw_textclock, "redraw textclock") benchmark(e2e_tag_switch, "tag switch") require("_runner").run_steps({ function() return true end }) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/test-focus.lua b/tests/test-focus.lua index b8c11ecd0..bc8b86732 100644 --- a/tests/test-focus.lua +++ b/tests/test-focus.lua @@ -46,3 +46,5 @@ local steps = { } require("_runner").run_steps(steps) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/test-leaks.lua b/tests/test-leaks.lua index f8b06bce8..a7622fbd1 100644 --- a/tests/test-leaks.lua +++ b/tests/test-leaks.lua @@ -80,3 +80,5 @@ prepare_for_collect = emit_refresh collectable(create_wibox()) require("_runner").run_steps({ function() return true end }) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/test-spawn-snid.lua b/tests/test-spawn-snid.lua index 87541583f..8438cd19f 100644 --- a/tests/test-spawn-snid.lua +++ b/tests/test-spawn-snid.lua @@ -40,3 +40,5 @@ local steps = { } require("_runner").run_steps(steps) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/test-spawn.lua b/tests/test-spawn.lua index 8341f6533..732c4b091 100644 --- a/tests/test-spawn.lua +++ b/tests/test-spawn.lua @@ -43,3 +43,5 @@ local steps = { } require("_runner").run_steps(steps) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/test-urgent.lua b/tests/test-urgent.lua index 33b6d14bf..9e42727ff 100644 --- a/tests/test-urgent.lua +++ b/tests/test-urgent.lua @@ -107,3 +107,5 @@ local steps = { } require("_runner").run_steps(steps) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/default/theme.lua b/themes/default/theme.lua index 1557c6263..9577ad947 100644 --- a/themes/default/theme.lua +++ b/themes/default/theme.lua @@ -103,4 +103,5 @@ theme.awesome_icon = "@AWESOME_ICON_PATH@/awesome16.png" theme.icon_theme = nil return theme + -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/sky/theme.lua b/themes/sky/theme.lua index 936d4ddd0..e8fbe7e61 100644 --- a/themes/sky/theme.lua +++ b/themes/sky/theme.lua @@ -82,4 +82,5 @@ theme.titlebar_maximized_button_normal_active = "@AWESOME_THEMES_PATH@/default/t theme.titlebar_maximized_button_focus_active = "@AWESOME_THEMES_PATH@/default/titlebar/maximized_focus_active.png" return theme + -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/xresources/theme.lua b/themes/xresources/theme.lua index 850c0de2d..507914798 100644 --- a/themes/xresources/theme.lua +++ b/themes/xresources/theme.lua @@ -96,4 +96,5 @@ theme.wallpaper = theme_assets.wallpaper( ) return theme + -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/zenburn/theme.lua b/themes/zenburn/theme.lua index 69be51de2..d6a48863e 100644 --- a/themes/zenburn/theme.lua +++ b/themes/zenburn/theme.lua @@ -129,3 +129,5 @@ theme.titlebar_maximized_button_normal_inactive = "@AWESOME_THEMES_PATH@/zenburn -- }}} return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 From feb7b3672867a1526903ff0ea290f46fdc7acc6e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 12 Dec 2015 17:48:42 +0100 Subject: [PATCH 4/4] Add an EditorConfig file I didn't (and couldn't) actually test this in any way, but hopefully this makes it easier to edit awesome's source without vim. Thanks to Daniel Hahler for telling me about this. Signed-off-by: Uli Schlachter --- .editorconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..aede4562f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# See http://editorconfig.org + +# Don't search for other .editconfig files +root = true + +[*] + +# Unix-style newlines +end_of_line = lf + +# There a newline at the end of the file +insert_final_newline = true + +# Trailing whitespaces, no one needs them +trim_trailing_whitespace = true + +# Why would anyone use anything else? +charset = utf-8 + +# This is just what we use, sorry if you disagree +indent_style = space +indent_size = 4 + +# In a Makefile, the tab is significant and not "just" whitespace +[Makefile] +indent_style = tab