dotfiles

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

options.lua (2211B)


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