From 52ce124894b72f3e160127b18d97fc4e5677fd35 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 24 Nov 2021 12:17:10 +0100 Subject: [PATCH] Add more options from old configuraion --- nvim/init.lua | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index 4c7b039..82a03bc 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -3,6 +3,11 @@ --fix different locale settings when ssh'ing vim.o.encoding = 'utf-8' +vim.o.syntax = 'on' + +--display all matching files when we tab complete +vim.o.wildmenu = true + --replace vertical split pipe character with space vim.o.fillchars = 'vert:|,fold: ' @@ -19,7 +24,7 @@ vim.o.hidden = true --fold indents vim.o.foldmethod = 'indent' ---Don't open folds when jumping over one with (, {, [[ or [{ +--don't open folds when jumping over one with (, {, [[ or [{ vim.opt.foldopen = vim.opt.foldopen - { 'block' } --search down into subfolders @@ -51,6 +56,30 @@ vim.o.termguicolors = true vim.o.background = 'dark' vim.cmd('colorscheme space_vim_theme') ---activate statusbar +--enable statusbar vim.o.laststatus = 2 vim.o.statusline = ' %F %m%r%w %= %{hostname()} %{strlen(&ft)?&ft:"none"} %{(&bomb?",BOM":"")} %{&ff} %l/%L %c %P' + +--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+%#@