dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

options.lua (2123B)


      1 -- Basic options
      2 vim.opt.mouse = ''                     -- Disable visual-mode mouse select.
      3 vim.opt.incsearch = true               -- Turn on incremental searching.
      4 vim.opt.hlsearch = true                -- Highlight search.
      5 vim.opt.visualbell = true              -- Less noise.
      6 vim.opt.number = true                  -- Use line numbering.
      7 vim.opt.ruler = true                   -- Show row/col in status.
      8 vim.opt.laststatus = 2                 -- Always show status line.
      9 vim.opt.showmatch = true               -- Highlight matching bracket.
     10 vim.opt.history = 50                   -- Keep 50 lines of cmdline history.
     11 vim.opt.wildmenu = true                -- Nicer autocomplete.
     12 vim.opt.wildmode = {'longest', 'full'}
     13 vim.opt.wildignore = {'*.o', '*.pyc'}  -- Ignore some filetypes during completion.
     14 vim.opt.spelllang = 'en_ca'            -- Set the spelling language.
     15 vim.opt.completeopt:append('longest')  -- Insert longest common prefix of options.
     16 vim.opt.autoindent = true              -- Copy indent from current line when starting a new line.
     17 vim.opt.smartindent = true             -- Attempt to autoindent when starting a new line.
     18 vim.opt.smarttab = true                -- Use shiftwidth rather than tabstop at start of line.
     19 vim.opt.tabstop = 2                    -- Number of spaces per tab.
     20 vim.opt.shiftwidth = 2                 -- Number of spaces for each step of autoindent.
     21 vim.opt.softtabstop = 2                -- Number of spaces per tab when editing.
     22 vim.opt.expandtab = true               -- Insert spaces in place of tabs.
     23 
     24 -- Fix Python's indent overrides.
     25 vim.api.nvim_create_autocmd('FileType', {
     26   pattern = 'python',
     27   callback = function()
     28     vim.opt_local.tabstop = 2
     29     vim.opt_local.shiftwidth = 2
     30     vim.opt_local.softtabstop = 2
     31     vim.opt_local.expandtab = true
     32   end
     33 })
     34 
     35 -- Don't show warnings, errors, etc. by default.
     36 vim.diagnostic.enable(false)
     37 
     38 -- Use fancy diagnostics icons.
     39 for type, icon in pairs({ Error = "✘", Warn = "▲", Hint = "⚑", Info = "»" }) do
     40   local hl = "DiagnosticSign" .. type
     41   vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
     42 end