Split neovim lua configuration into separate files
These seperate files should be put into $HOME/.config/nvim/lua
This commit is contained in:
parent
97aee75d0b
commit
50936596b5
5 changed files with 155 additions and 0 deletions
27
nvim/lua/auto-commands.lua
Normal file
27
nvim/lua/auto-commands.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
--colorscheme
|
||||
vim.cmd('colorscheme space_vim_theme')
|
||||
vim.cmd('syntax enable')
|
||||
|
||||
--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
|
||||
]])
|
||||
|
||||
--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+%#@<!$/')
|
||||
vim.cmd('autocmd InsertLeave * match ExtraWhitespace /s+$/')
|
||||
vim.cmd('autocmd BufWinLeave * call clearmatches()')
|
||||
Loading…
Add table
Add a link
Reference in a new issue