settings.lua 3.4 KB

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