neovim

mrgrouse's beloved, handmade neovim configuration
Log | Files | Refs | README

options.lua (776B)


      1 -- leaders
      2 vim.g.mapleader = " "
      3 vim.g.maplocalleader = "\\"
      4 
      5 local opt = vim.opt
      6 vim.g.autoformat = false
      7 
      8 -- clipboard
      9 opt.clipboard:append("unnamedplus")
     10 
     11 -- indentation & tabs
     12 opt.tabstop = 2 -- space count for tabs
     13 opt.shiftwidth = 2 -- indent width
     14 opt.expandtab = true -- tabs are spaces
     15 opt.autoindent = true -- copy indent from current line to next line
     16 
     17 -- numbering
     18 opt.number = true
     19 opt.relativenumber = false
     20 
     21 -- text wrapping
     22 opt.wrap = true
     23 
     24 -- option for themes, requires truecolor terminal
     25 opt.termguicolors = true
     26 
     27 local has_words_before = function()
     28   unpack = unpack or table.unpack
     29   local line, col = unpack(vim.api.nvim_win_get_cursor(0))
     30   return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
     31 end