aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/general.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/general.lua')
-rw-r--r--.config/nvim/lua/general.lua30
1 files changed, 19 insertions, 11 deletions
diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua
index cfe3c9c..27bf28e 100644
--- a/.config/nvim/lua/general.lua
+++ b/.config/nvim/lua/general.lua
@@ -12,6 +12,7 @@ vim.opt.colorcolumn = "120"
vim.opt.scrolloff = 5
vim.opt.spelllang = "en,nb"
vim.opt.cursorline = true
+vim.g.__plain = false
-- vim.opt.tabstop = 4
-- vim.opt.softtabstop = -1
@@ -19,22 +20,29 @@ vim.opt.cursorline = true
-- vim.opt.expandtab = true
-- vim.opt.autoindent = true
-vim.cmd [[autocmd FileType typescript setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType typescript setlocal softtabstop=2 expandtab]]
vim.cmd [[autocmd FileType typescriptreact setlocal shiftwidth=2 softtabstop=2 expandtab]]
-vim.cmd [[autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab]]
vim.cmd [[autocmd FileType javascriptreact setlocal shiftwidth=2 softtabstop=2 expandtab]]
-vim.cmd [[autocmd FileType css setlocal shiftwidth=2 softtabstop=2 expandtab]]
-vim.cmd [[autocmd FileType scss setlocal shiftwidth=4 softtabstop=4 expandtab]]
-vim.cmd [[autocmd FileType html setlocal shiftwidth=2 softtabstop=2 expandtab]]
-vim.cmd [[autocmd FileType json setlocal shiftwidth=2 softtabstop=2 expandtab]]
-vim.cmd [[autocmd FileType cs setlocal shiftwidth=4 softtabstop=4 expandtab]]
-vim.cmd [[autocmd FileType mail setlocal textwidth=72 colorcolumn=72 spell]]
-vim.cmd [[autocmd FileType markdown setlocal textwidth=72 colorcolumn=72 spell]]
-vim.cmd [[autocmd FileType gitcommit setlocal textwidth=72 colorcolumn=50,72 spell]]
-vim.cmd [[autocmd BufNew,BufNewFile,BufRead *.cshtml :set filetype=razor]]
+vim.cmd [[autocmd FileType css setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType html setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd BufNew,BufNewFile,BufRead,BufEnter,TabEnter *.lua :lua require("utils").toggle_plain()]]
+vim.cmd [[autocmd FileType json setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType cs setlocal shiftwidth=4 softtabstop=4 expandtab]]
+vim.cmd [[autocmd FileType mail setlocal textwidth=72 colorcolumn=72 spell]]
+vim.cmd [[autocmd FileType markdown setlocal textwidth=72 colorcolumn=72 spell]]
+vim.cmd [[autocmd FileType gitcommit setlocal textwidth=72 colorcolumn=50,72 spell]]
vim.cmd [[filetype indent off]]
+vim.filetype.add({
+ extension = { cshtml = "razor" };
+ pattern = {
+ -- void linux templates
+ ["template"] = "bash";
+ };
+})
+
-- Comment the following lines to disable whitespace characters
vim.opt.list = true
vim.opt.listchars:append("space:⋅")