config.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. local cmd = vim.cmd -- execute Vim commands
  2. local set_option = vim.api.nvim_set_option
  3. -- Various UX
  4. -- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
  5. -- delays and poor user experience.
  6. -- set('updatetime', 300)
  7. -- set signcolumn=number
  8. -- long lines
  9. -- :set colorcolumn=120
  10. -- colorscheme onedark
  11. --
  12. -- Look and Feel settings
  13. -- cmd([[
  14. -- syntax enable
  15. -- colorscheme onedark
  16. -- highlight SignColumn guibg=Black
  17. -- highlight SignColumn ctermbg=Black
  18. -- ]])
  19. ncvim.theme = ncvim.themes.DARK
  20. -- line numbers
  21. set_option('number', true)
  22. set_option('numberwidth', 4)
  23. set_option('ruler', true)
  24. set_option('signcolumn', 'yes')
  25. -- auto switch line numbering
  26. cmd([[
  27. :augroup numbertoggle
  28. : autocmd!
  29. : autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif
  30. : autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
  31. :augroup END
  32. ]])
  33. -- Indentation
  34. -- set autoindent
  35. -- set cindent
  36. -- set smartindent
  37. set_option('expandtab', true)
  38. set_option('tabstop', 4)
  39. set_option('softtabstop', 4)
  40. set_option('shiftwidth', 4)
  41. -- Disable all bells and whistles
  42. set_option('errorbells', false)
  43. set_option('visualbell', false)
  44. set_option('updatetime', 1000)