settings.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.backup = false -- creates a backup file
  16. opt.clipboard = O.clipboard -- allows neovim to access the system clipboard
  17. opt.cmdheight = O.cmdheight -- more space in the neovim command line for displaying messages
  18. opt.colorcolumn = O.colorcolumn
  19. opt.completeopt = { "menuone", "noselect" }
  20. opt.conceallevel = 0 -- so that `` is visible in markdown files
  21. opt.fileencoding = "utf-8" -- the encoding written to a file
  22. opt.guifont = "monospace:h17" -- the font used in graphical neovim applications
  23. opt.hidden = O.hidden_files -- required to keep multiple buffers and open multiple buffers
  24. opt.hlsearch = O.hl_search -- highlight all matches on previous search pattern
  25. opt.ignorecase = O.ignore_case -- ignore case in search patterns
  26. opt.mouse = "a" -- allow the mouse to be used in neovim
  27. opt.pumheight = 10 -- pop up menu height
  28. opt.scrolloff = O.scrolloff -- minimal number of screen lines to keep above and below the cursor
  29. opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
  30. opt.showtabline = 2 -- always show tabs
  31. opt.smartcase = O.smart_case -- smart case
  32. opt.smartindent = true -- make indenting smarter again
  33. opt.splitbelow = true -- force all horizontal splits to go below current window
  34. opt.splitright = true -- force all vertical splits to go to the right of current window
  35. opt.swapfile = false -- creates a swapfile
  36. opt.termguicolors = true -- set term gui colors (most terminals support this)
  37. opt.timeoutlen = O.timeoutlen -- time to wait for a mapped sequence to complete (in milliseconds)
  38. opt.title = true -- set the title of window to the value of the titlestring
  39. -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
  40. opt.undodir = CACHE_PATH .. "/undo" -- set an undo directory
  41. opt.undofile = true -- enable persisten undo
  42. opt.updatetime = 300 -- faster completion
  43. opt.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
  44. opt.expandtab = true -- convert tabs to spaces
  45. opt.shiftwidth = O.shift_width -- the number of spaces inserted for each indentation
  46. opt.shortmess:append "c"
  47. opt.tabstop = O.tab_stop -- insert 4 spaces for a tab
  48. opt.cursorline = O.cursorline -- highlight the current line
  49. opt.number = O.number -- set numbered lines
  50. opt.relativenumber = O.relative_number -- set relative numbered lines
  51. opt.numberwidth = O.number_width -- set number column width to 2 {default 4}
  52. opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
  53. opt.wrap = O.wrap_lines -- display lines as one long line
  54. opt.spell = O.spell
  55. opt.spelllang = O.spelllang