settings.lua 3.8 KB

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