Use ftplugin for indent configuration
This commit is contained in:
parent
e3cece6400
commit
fe025d76de
12 changed files with 81 additions and 19 deletions
5
nvim/ftplugin/bash.lua
Normal file
5
nvim/ftplugin/bash.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 4
|
||||||
|
vim.b.softtabstop = 4
|
||||||
|
vim.b.shiftwidth = 4
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/css.lua
Normal file
5
nvim/ftplugin/css.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/html.lua
Normal file
5
nvim/ftplugin/html.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/htmldjango.lua
Normal file
5
nvim/ftplugin/htmldjango.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/javascript.lua
Normal file
5
nvim/ftplugin/javascript.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/json.lua
Normal file
5
nvim/ftplugin/json.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 4
|
||||||
|
vim.b.softtabstop = 4
|
||||||
|
vim.b.shiftwidth = 4
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/lua.lua
Normal file
5
nvim/ftplugin/lua.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/python.lua
Normal file
5
nvim/ftplugin/python.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 4
|
||||||
|
vim.b.softtabstop = 4
|
||||||
|
vim.b.shiftwidth = 4
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/scss.lua
Normal file
5
nvim/ftplugin/scss.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/sh.lua
Normal file
5
nvim/ftplugin/sh.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 4
|
||||||
|
vim.b.softtabstop = 4
|
||||||
|
vim.b.shiftwidth = 4
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
5
nvim/ftplugin/yaml.lua
Normal file
5
nvim/ftplugin/yaml.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.b.tabstop = 2
|
||||||
|
vim.b.softtabstop = 2
|
||||||
|
vim.b.shiftwidth = 2
|
||||||
|
vim.b.expandtab = true
|
||||||
|
vim.b.autoindent = true
|
||||||
|
|
@ -1,27 +1,34 @@
|
||||||
--colorscheme
|
--colorscheme
|
||||||
vim.cmd('colorscheme space_vim_theme')
|
vim.cmd('colorscheme space_vim_theme')
|
||||||
|
|
||||||
|
--enable this option here as the events are used in this buffer
|
||||||
vim.cmd('syntax on')
|
vim.cmd('syntax on')
|
||||||
|
|
||||||
--open folds by default
|
vim.api.nvim_create_autocmd('Syntax', {
|
||||||
vim.cmd('autocmd Syntax * normal zR')
|
command = [[:normal zR]],
|
||||||
|
desc = 'Open folds by default',
|
||||||
--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
|
|
||||||
]])
|
|
||||||
|
|
||||||
--color trailing spaces with red color
|
--color trailing spaces with red color
|
||||||
vim.cmd('highlight ExtraWhitespace ctermbg=green guibg=green')
|
vim.cmd('highlight ExtraWhitespace ctermbg=green guibg=green')
|
||||||
vim.cmd('match ExtraWhitespace /s+$/')
|
vim.cmd('match ExtraWhitespace /s+$/')
|
||||||
vim.cmd('autocmd BufWinEnter * match ExtraWhitespace /s+$/')
|
|
||||||
vim.cmd('autocmd InsertEnter * match ExtraWhitespace /s+%#@<!$/')
|
vim.api.nvim_create_autocmd('BufWinEnter', {
|
||||||
vim.cmd('autocmd InsertLeave * match ExtraWhitespace /s+$/')
|
pattern = "*",
|
||||||
vim.cmd('autocmd BufWinLeave * call clearmatches()')
|
command = [[:match ExtraWhitespace /s+$/]],
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('InsertEnter', {
|
||||||
|
pattern = "*",
|
||||||
|
command = [[:match ExtraWhitespace /s+%#@<!$/]],
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('InsertLeave', {
|
||||||
|
pattern = "*",
|
||||||
|
command = [[:match ExtraWhitespace /s+$/]],
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('BufWinLeave', {
|
||||||
|
pattern = "*",
|
||||||
|
command = [[:call clearmatches()]],
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue