options.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. -- vim:fileencoding=utf-8:foldmethod=marker:foldmarker={{{,}}}
  2. -- {{{ imports and defines
  3. require "nvchad.options"
  4. local o = vim.o
  5. local g = vim.g
  6. local opt = vim.opt
  7. local cmd = vim.cmd
  8. -- }}}
  9. -- {{{
  10. -- }}}
  11. -- {{{ Diagnostic signs
  12. local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
  13. for type, icon in pairs(signs) do
  14. local hl = "DiagnosticSign" .. type
  15. vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
  16. end
  17. -- }}}
  18. -- {{{ relative line number and folds
  19. opt.relativenumber = true
  20. -- deprecated
  21. --opt.foldmethod = "expr"
  22. --opt.foldexpr = "nvim_treesitter#foldexpr()"
  23. vim.wo.foldmethod = "expr"
  24. vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
  25. --opt.foldexpr = vim.treesitter.foldexpr()
  26. -- }}}
  27. -- {{{ Scrolloff and tabs
  28. -- " For example - scrolloff=7
  29. -- " When cursor on 7 line, counting from bottom, and U going to next line,
  30. -- " document will scroll
  31. -- " Default value = 0
  32. opt.scrolloff = 5
  33. -- " Copying indents from prev line when adding new
  34. opt.autoindent = true
  35. -- " price of tab (in spaces)
  36. opt.tabstop = 3
  37. -- " By default - adjusting the indentation width (in spaces) adding by commands
  38. -- " >> and <<. If != tabstop, then indent can consist both of spaces and tabs.
  39. -- " When smarttab is on, may have an additional impact
  40. -- " (0 for ‘tabstop’):
  41. opt.shiftwidth = 3
  42. -- " Pressing tab in BoL (before 1-st not-space symbol) adding indent == shiftwidth
  43. -- " Backspace deleting entire indent, not just one tab
  44. opt.smarttab = true
  45. -- " Count of spaces the tab is displayed with when added
  46. -- " For example - tabstop=8 ; softtabstop=4
  47. -- " Example - Triple tab. We have - 1 tab (8 spaces) and 4 spaces
  48. -- " (0 for ‘tabstop’, -1 for ‘shiftwidth’):
  49. opt.softtabstop = -1
  50. -- " Is need change tabs by spaces
  51. -- If == false - breaks new line indents in python files
  52. opt.expandtab = false
  53. -- " Show tabs as chars
  54. --opt.list = true
  55. --opt.listchars="tab: "
  56. -- for no changing my tabs to fucking spaces by PEP8
  57. -- in /usr/share/nvim/runtime/ftplugin/python.vim line 119
  58. g.python_recommended_style = 0
  59. -- }}}
  60. -- {{{ Cursor line and clipboard
  61. -- to enable cursorline!
  62. o.cursorlineopt = "both"
  63. o.clipboard = "unnamedplus"
  64. -- }}}
  65. -- {{{
  66. -- if "a" - mouse enabled. if "" - mouse disabled
  67. opt.mouse = ""
  68. -- }}}
  69. -- {{{ If you installed python packages in virtual env - uncomment this line
  70. --g.python3_host_prog = vim.fn.expand("$HOME") .. "/.local/venv/nvim/bin/python"
  71. -- }}}