options.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. local opt = vim.opt
  2. -- >>>
  3. -- Settings <<<
  4. -- General <<<
  5. opt.compatible = false
  6. opt.belloff = "all"
  7. opt.clipboard:append("unnamed,unnamedplus")
  8. opt.encoding = "utf-8"
  9. opt.errorbells = false
  10. opt.visualbell = false
  11. opt.title = true
  12. opt.shell = "/bin/bash"
  13. opt.path:append "**"
  14. opt.lazyredraw = true
  15. opt.mouse:append "niv"
  16. opt.mousemodel = "popup_setpos"
  17. opt.confirm = false
  18. opt.hidden = true
  19. opt.magic = true
  20. opt.spell = true
  21. opt.spelllang = "en"
  22. opt.autoread = true
  23. opt.dictionary = "spell"
  24. opt.backspace:append "indent,eol,start"
  25. opt.showmode = false
  26. opt.showcmd = true
  27. opt.modeline = true
  28. opt.shortmess:append "sI"
  29. -- >>>
  30. -- Backup, Swap and Undo <<<
  31. opt.backup = false
  32. opt.undofile = true
  33. opt.undodir = vim.fn.stdpath('cache') .. '/undo'
  34. opt.undolevels = 1000
  35. opt.history = 1000
  36. opt.directory = vim.fn.stdpath('cache') .. '/swap'
  37. -- >>>
  38. -- UI <<<
  39. opt.termguicolors = true
  40. opt.syntax = "on"
  41. opt.background = "dark"
  42. opt.cursorline = true
  43. opt.cursorcolumn = false
  44. opt.list = true
  45. opt.listchars:append "tab:→ ,nbsp:␣,trail:•,extends:⟩,precedes:⟨"
  46. opt.wrap = false
  47. opt.showmatch = true
  48. opt.laststatus = 2
  49. opt.ruler = true
  50. opt.relativenumber = true
  51. opt.scrolloff = 8
  52. opt.sidescrolloff = 8
  53. opt.splitbelow = true
  54. opt.splitright = true
  55. -- >>>
  56. -- Indents and tabs <<<
  57. opt.autoindent = true
  58. opt.expandtab = true
  59. opt.tabstop = 2
  60. opt.softtabstop = 2
  61. opt.shiftwidth = 2
  62. -- >>>
  63. -- Folds <<<
  64. opt.fillchars = "vert:|,fold:-"
  65. opt.foldmarker = "<<<,>>>"
  66. opt.foldmethod = "marker"
  67. -- >>>
  68. -- Wildmenu <<<
  69. opt.wildmenu = true
  70. opt.wildmode = "full"
  71. opt.wildignorecase = true
  72. opt.wildignore:append ".git,.hg,.svn,*.pyc,*.o,*.out,*.jpg,*.jpeg,*.png,*.gif,*.zip,**/tmp/**,*.DS_Store,**/node_modules/**,**/bower_modules/**"
  73. -- >>>
  74. -- Autocompletion <<<
  75. opt.complete = ".,w,b,k"
  76. opt.completeopt = "menu,menuone,noselect"
  77. opt.shortmess:append "Aac"
  78. -- >>>
  79. -- Search and Highlight <<<
  80. opt.hlsearch = true
  81. opt.incsearch = true
  82. opt.smartcase = true
  83. -- >>>
  84. -- Others <<<
  85. opt.formatoptions:remove('ro')
  86. opt.diffopt = "vertical,filler"
  87. if opt.diff:get() then
  88. opt.cursorbind = true
  89. opt.scrollbind = true
  90. else
  91. opt.cursorbind = false
  92. opt.scrollbind = false
  93. end
  94. -- >>>
  95. -- >>>