diff --git a/nvim/ftplugin/bash.lua b/nvim/ftplugin/bash.lua new file mode 100644 index 0000000..332f079 --- /dev/null +++ b/nvim/ftplugin/bash.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 4 +vim.b.softtabstop = 4 +vim.b.shiftwidth = 4 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/css.lua b/nvim/ftplugin/css.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/css.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/html.lua b/nvim/ftplugin/html.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/html.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/htmldjango.lua b/nvim/ftplugin/htmldjango.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/htmldjango.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/javascript.lua b/nvim/ftplugin/javascript.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/javascript.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/json.lua b/nvim/ftplugin/json.lua new file mode 100644 index 0000000..332f079 --- /dev/null +++ b/nvim/ftplugin/json.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 4 +vim.b.softtabstop = 4 +vim.b.shiftwidth = 4 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/lua.lua b/nvim/ftplugin/lua.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/lua.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/python.lua b/nvim/ftplugin/python.lua new file mode 100644 index 0000000..332f079 --- /dev/null +++ b/nvim/ftplugin/python.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 4 +vim.b.softtabstop = 4 +vim.b.shiftwidth = 4 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/scss.lua b/nvim/ftplugin/scss.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/scss.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/sh.lua b/nvim/ftplugin/sh.lua new file mode 100644 index 0000000..332f079 --- /dev/null +++ b/nvim/ftplugin/sh.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 4 +vim.b.softtabstop = 4 +vim.b.shiftwidth = 4 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/ftplugin/yaml.lua b/nvim/ftplugin/yaml.lua new file mode 100644 index 0000000..ed1fb11 --- /dev/null +++ b/nvim/ftplugin/yaml.lua @@ -0,0 +1,5 @@ +vim.b.tabstop = 2 +vim.b.softtabstop = 2 +vim.b.shiftwidth = 2 +vim.b.expandtab = true +vim.b.autoindent = true diff --git a/nvim/lua/auto-commands.lua b/nvim/lua/auto-commands.lua index 0daf807..90c9b84 100644 --- a/nvim/lua/auto-commands.lua +++ b/nvim/lua/auto-commands.lua @@ -1,27 +1,34 @@ --colorscheme vim.cmd('colorscheme space_vim_theme') + +--enable this option here as the events are used in this buffer vim.cmd('syntax on') ---open folds by default -vim.cmd('autocmd Syntax * normal zR') - ---file specific formatting -vim.cmd([[ - autocmd Filetype python,bash,sh,java,php,json - \ setlocal tabstop=4 softtabstop=4 shiftwidth=4 - \ expandtab autoindent fileformat=unix -]]) - -vim.cmd([[ - autocmd Filetype css,scss,html,htmldjango,javascript,yaml - \ setlocal tabstop=2 softtabstop=2 shiftwidth=2 - \ expandtab autoindent -]]) +vim.api.nvim_create_autocmd('Syntax', { + command = [[:normal zR]], + desc = 'Open folds by default', +}) --color trailing spaces with red color vim.cmd('highlight ExtraWhitespace ctermbg=green guibg=green') vim.cmd('match ExtraWhitespace /s+$/') -vim.cmd('autocmd BufWinEnter * match ExtraWhitespace /s+$/') -vim.cmd('autocmd InsertEnter * match ExtraWhitespace /s+%#@