vim

Log | Files | Refs

options.lua (1065B)


      1 local opt = vim.opt
      2 
      3 opt.number = true
      4 opt.relativenumber = true
      5 
      6 opt.tabstop = 2
      7 opt.shiftwidth = 2
      8 opt.expandtab = true
      9 opt.autoindent = true
     10 opt.smartindent = true
     11 
     12 opt.wrap = false
     13 opt.scrolloff = 8
     14 
     15 opt.ignorecase = true
     16 opt.smartcase = true
     17 opt.hlsearch = false
     18 opt.incsearch = true
     19 
     20 opt.termguicolors = true
     21 opt.signcolumn = "yes"
     22 opt.cursorline = true
     23 opt.updatetime = 250
     24 opt.timeoutlen = 300
     25 
     26 opt.mouse = "a"
     27 opt.clipboard = "unnamedplus"
     28 opt.splitbelow = true
     29 opt.splitright = true
     30 opt.undofile = true
     31 opt.swapfile = false
     32 opt.backup = false
     33 
     34 opt.completeopt = "menu,menuone,noselect"
     35 opt.encoding = "utf-8"
     36 opt.fileencoding = "utf-8"
     37 
     38 -- Disable smart indent for INI/cfg files
     39 vim.api.nvim_create_autocmd("FileType", {
     40   pattern = { "dosini", "cfg" },
     41   callback = function()
     42     vim.opt_local.smartindent = false
     43     vim.opt_local.autoindent = false
     44   end,
     45 })
     46 
     47 -- Python indentation (PEP 8)
     48 vim.api.nvim_create_autocmd("FileType", {
     49   pattern = "python",
     50   callback = function()
     51     vim.opt_local.tabstop = 4
     52     vim.opt_local.shiftwidth = 4
     53   end,
     54 })