settings.lua 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. local M = {}
  2. M.load_options = function()
  3. local default_options = {
  4. backup = false, -- creates a backup file
  5. clipboard = "unnamedplus", -- allows neovim to access the system clipboard
  6. cmdheight = 2, -- more space in the neovim command line for displaying messages
  7. colorcolumn = "99999", -- fixes indentline for now
  8. completeopt = { "menuone", "noselect" },
  9. conceallevel = 0, -- so that `` is visible in markdown files
  10. fileencoding = "utf-8", -- the encoding written to a file
  11. foldmethod = "manual", -- folding, set to "expr" for treesitter based folding
  12. foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding
  13. guifont = "monospace:h17", -- the font used in graphical neovim applications
  14. hidden = true, -- required to keep multiple buffers and open multiple buffers
  15. hlsearch = true, -- highlight all matches on previous search pattern
  16. ignorecase = true, -- ignore case in search patterns
  17. mouse = "a", -- allow the mouse to be used in neovim
  18. pumheight = 10, -- pop up menu height
  19. showmode = false, -- we don't need to see things like -- INSERT -- anymore
  20. showtabline = 2, -- always show tabs
  21. smartcase = true, -- smart case
  22. smartindent = true, -- make indenting smarter again
  23. splitbelow = true, -- force all horizontal splits to go below current window
  24. splitright = true, -- force all vertical splits to go to the right of current window
  25. swapfile = false, -- creates a swapfile
  26. termguicolors = true, -- set term gui colors (most terminals support this)
  27. timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
  28. title = true, -- set the title of window to the value of the titlestring
  29. -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
  30. undodir = CACHE_PATH .. "/undo", -- set an undo directory
  31. undofile = true, -- enable persistent undo
  32. updatetime = 300, -- faster completion
  33. 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
  34. expandtab = true, -- convert tabs to spaces
  35. shiftwidth = 2, -- the number of spaces inserted for each indentation
  36. tabstop = 2, -- insert 2 spaces for a tab
  37. cursorline = true, -- highlight the current line
  38. number = true, -- set numbered lines
  39. relativenumber = false, -- set relative numbered lines
  40. numberwidth = 4, -- set number column width to 2 {default 4}
  41. signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
  42. wrap = false, -- display lines as one long line
  43. spell = false,
  44. spelllang = "en",
  45. scrolloff = 8, -- is one of my fav
  46. sidescrolloff = 8,
  47. } --- VIM ONLY COMMANDS ---cmd "filetype plugin on"cmd('let &titleold="' .. TERMINAL .. '"')cmd "set inccommand=split"cmd "set iskeyword+=-"
  48. --- SETTINGS ---
  49. vim.opt.shortmess:append "c"
  50. for k, v in pairs(default_options) do
  51. vim.opt[k] = v
  52. end
  53. end
  54. M.load_commands = function()
  55. local cmd = vim.cmd
  56. if lvim.line_wrap_cursor_movement then
  57. cmd "set whichwrap+=<,>,[,],h,l"
  58. end
  59. if lvim.transparent_window then
  60. cmd "au ColorScheme * hi Normal ctermbg=none guibg=none"
  61. cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none"
  62. cmd "au ColorScheme * hi NormalNC ctermbg=none guibg=none"
  63. cmd "au ColorScheme * hi MsgArea ctermbg=none guibg=none"
  64. cmd "au ColorScheme * hi TelescopeBorder ctermbg=none guibg=none"
  65. cmd "au ColorScheme * hi NvimTreeNormal ctermbg=none guibg=none"
  66. cmd "let &fcs='eob: '"
  67. end
  68. end
  69. return M