dotfiles/home/.config/nvim/lua/core/options.lua

56 lines
2.1 KiB
Lua
Raw Normal View History

local vim = require("vim")
local cmd = vim.cmd
local o = vim.opt
cmd[[filetype plugin on]]
2021-12-06 12:52:51 +00:00
-- Tab/Indent settings
2021-12-06 12:54:55 +00:00
o.autoindent = true -- Enable autoindent
o.expandtab = true -- Expand tabs to spaces
2021-12-06 12:52:51 +00:00
o.tabstop = 4 -- Tab size in spaces
o.shiftwidth = 4 -- Indentation size
o.softtabstop = 4 -- Tabs/Spaces interlop
o.tabpagemax = 50 -- More tabs
2021-12-06 12:59:10 +00:00
o.shiftround = true -- Always round indent to multiple of shiftwidth
-- Folding
o.foldmethod = "indent" -- Use indent to determine the fold levels
o.foldnestmax = 8 -- Only fold up to given amount of levels
o.foldlevel = 2 -- Set initial fold level (don't fold first 2 levels)
o.foldenable = false -- Hide all folds by default
-- Split order
o.splitbelow = true -- Put new windows below current
o.splitright = true -- Put new vertical splits to right
-- In-file search (/)
o.ignorecase = true -- Use case insensitive matching
2021-12-06 12:52:51 +00:00
o.incsearch = true -- Show partial matches while typing
o.hlsearch = true -- Highlight search matches
2021-12-06 12:53:03 +00:00
-- Show whitespace
o.list = true -- Enable showing characters like <Tab>, <EOL>, ...
o.listchars = {tab = "", trail = "·"} -- Specify which characters to show
-- Command-mode search
o.wildmode = {"longest", "list", "full"} -- Enable autocompletion
o.wildmenu = true -- Display all matching files when we tab complete
table.insert(o.path, "**") -- Search down into subfolders with tab completion
2021-12-09 00:16:50 +00:00
o.wildignore = vim.tbl_extend( -- Ignore certain files/folders in wildmenu
"force", o.wildignore, {
"*.pyc", "*_build/*",
"**/coverage/*", "**/node_modules/*",
"**/android/*", "**/ios/*",
"**/.git/*",
}
)
2021-12-06 12:56:48 +00:00
-- Files
o.encoding = "utf-8" -- Use UTF-8 encoding
o.autoread = true -- Automatically reload files on change
2021-12-06 12:56:48 +00:00
-- Misc
o.mouse = "a" -- Enable mouse mode
o.undolevels = 999 -- Lots of these
o.history = 1000 -- More history