settings.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. --- HELPERS ---
  2. local cmd = vim.cmd
  3. local opt = vim.opt
  4. --- VIM ONLY COMMANDS ---
  5. cmd "filetype plugin on"
  6. cmd('let &titleold="' .. TERMINAL .. '"')
  7. cmd "set inccommand=split"
  8. cmd "set iskeyword+=-"
  9. cmd "set whichwrap+=<,>,[,],h,l"
  10. if O.transparent_window then
  11. cmd "au ColorScheme * hi Normal ctermbg=none guibg=none"
  12. cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none"
  13. end
  14. --- SETTINGS ---
  15. opt.shortmess:append "c"
  16. O.default_options = {
  17. backup = false, -- creates a backup file
  18. clipboard = "unnamedplus", -- allows neovim to access the system clipboard
  19. cmdheight = 2, -- more space in the neovim command line for displaying messages
  20. colorcolumn = "99999", -- fixes indentline for now
  21. completeopt = { "menuone", "noselect" },
  22. conceallevel = 0, -- so that `` is visible in markdown files
  23. fileencoding = "utf-8", -- the encoding written to a file
  24. guifont = "monospace:h17", -- the font used in graphical neovim applications
  25. hidden = true, -- required to keep multiple buffers and open multiple buffers
  26. hlsearch = false, -- highlight all matches on previous search pattern
  27. ignorecase = true, -- ignore case in search patterns
  28. mouse = "a", -- allow the mouse to be used in neovim
  29. pumheight = 10, -- pop up menu height
  30. showmode = false, -- we don't need to see things like -- INSERT -- anymore
  31. showtabline = 2, -- always show tabs
  32. smartcase = true, -- smart case
  33. smartindent = true, -- make indenting smarter again
  34. splitbelow = true, -- force all horizontal splits to go below current window
  35. splitright = true, -- force all vertical splits to go to the right of current window
  36. swapfile = false, -- creates a swapfile
  37. termguicolors = true, -- set term gui colors (most terminals support this)
  38. timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
  39. title = true, -- set the title of window to the value of the titlestring
  40. -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
  41. undodir = CACHE_PATH .. "/undo", -- set an undo directory
  42. undofile = true, -- enable persisten undo
  43. updatetime = 300, -- faster completion
  44. writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
  45. expandtab = true, -- convert tabs to spaces
  46. shiftwidth = 2, -- the number of spaces inserted for each indentation
  47. tabstop = 2, -- insert 2 spaces for a tab
  48. cursorline = true, -- highlight the current line
  49. number = true, -- set numbered lines
  50. relativenumber = false, -- set relative numbered lines
  51. numberwidth = 4, -- set number column width to 2 {default 4}
  52. signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
  53. wrap = false, -- display lines as one long line
  54. spell = false,
  55. spelllang = "en",
  56. scrolloff = 8, -- is one of my fav
  57. }
  58. for k, v in pairs(O.default_options) do
  59. opt[k] = v
  60. end
  61. local disabled_built_ins = {
  62. "netrw",
  63. "netrwPlugin",
  64. "netrwSettings",
  65. "netrwFileHandlers",
  66. "gzip",
  67. "zip",
  68. "zipPlugin",
  69. "tar",
  70. "tarPlugin", -- 'man',
  71. "getscript",
  72. "getscriptPlugin",
  73. "vimball",
  74. "vimballPlugin",
  75. "2html_plugin",
  76. "logipat",
  77. "rrhelper",
  78. "spellfile_plugin",
  79. -- 'matchit', 'matchparen', 'shada_plugin',
  80. }
  81. for _, plugin in pairs(disabled_built_ins) do
  82. vim.g["loaded_" .. plugin] = 1
  83. end