settings.lua 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --- HELPERS ---
  2. local cmd = vim.cmd
  3. local opt = vim.opt
  4. --- VIM ONLY COMMANDS ---
  5. cmd('filetype plugin on') -- filetype detection
  6. cmd('let &titleold="'..TERMINAL..'"')
  7. cmd('set inccommand=split') -- show what you are substituting in real time
  8. cmd('set iskeyword+=-') -- treat dash as a separate word
  9. cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
  10. --- SETTINGS ---
  11. opt.backup = false -- creates a backup file
  12. opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
  13. opt.cmdheight = 2 -- more space in the neovim command line for displaying messages
  14. opt.colorcolumn = "99999" -- fix indentline for now
  15. opt.completeopt = {'menuone', 'noselect'}
  16. opt.conceallevel = 0 -- so that `` is visible in markdown files
  17. opt.fileencoding = "utf-8" -- the encoding written to a file
  18. opt.guifont = "monospace:h17" -- the font used in graphical neovim applications
  19. opt.hidden = O.hidden_files -- required to keep multiple buffers and open multiple buffers
  20. opt.hlsearch = O.hl_search -- highlight all matches on previous search pattern
  21. opt.ignorecase = O.ignore_case -- ignore case in search patterns
  22. opt.mouse = "a" -- allow the mouse to be used in neovim
  23. opt.pumheight = 10 -- pop up menu height
  24. opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
  25. opt.showtabline = 2 -- always show tabs
  26. opt.smartcase = O.smart_case -- smart case
  27. opt.smartindent = true -- make indenting smarter again
  28. opt.splitbelow = true -- force all horizontal splits to go below current window
  29. opt.splitright = true -- force all vertical splits to go to the right of current window
  30. opt.swapfile = false -- creates a swapfile
  31. opt.termguicolors = true -- set term gui colors (most terminals support this)
  32. opt.timeoutlen = O.timeoutlen -- time to wait for a mapped sequence to complete (in milliseconds)
  33. opt.title = true -- set the title of window to the value of the titlestring
  34. opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
  35. opt.undodir = CACHE_PATH .. '/undo' -- set an undo directory
  36. opt.undofile = true -- enable persisten undo
  37. opt.updatetime = 300 -- faster completion
  38. 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
  39. opt.expandtab = true -- convert tabs to spaces
  40. opt.shiftwidth = 4 -- the number of spaces inserted for each indentation
  41. opt.shortmess:append("c") -- don't pass messages to |ins-completion-menu|
  42. opt.tabstop = 4 -- insert 4 spaces for a tab
  43. opt.cursorline = O.cursorline -- highlight the current line
  44. opt.number = O.number -- set numbered lines
  45. opt.relativenumber = O.relative_number -- set relative numbered lines
  46. opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
  47. opt.wrap = O.wrap_lines -- display lines as one long line