2021-11-30 19:22:51 +00:00
|
|
|
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
|
2021-11-30 19:22:51 +00:00
|
|
|
o.expandtab = true -- Expand tabs to spaces
|
2021-12-06 12:52:51 +00:00
|
|
|
o.tabstop = 4 -- Tab size in spaces
|
2021-11-30 19:22:51 +00:00
|
|
|
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
|
2021-11-30 19:22:51 +00:00
|
|
|
|
|
|
|
-- Folding
|
|
|
|
o.foldmethod = "indent" -- Use indent to determine the fold levels
|
|
|
|
o.foldnestmax = 8 -- Only fold up to given amount of levels
|
2021-12-09 00:16:25 +00:00
|
|
|
o.foldlevel = 2 -- Set initial fold level (don't fold first 2 levels)
|
2021-11-30 19:22:51 +00:00
|
|
|
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
|
2021-11-30 19:22:51 +00:00
|
|
|
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
|
2021-11-30 19:22:51 +00:00
|
|
|
|
|
|
|
-- 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-11-30 19:22:51 +00:00
|
|
|
|
2021-12-06 12:56:48 +00:00
|
|
|
-- Files
|
2021-11-30 19:22:51 +00:00
|
|
|
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
|
2021-11-30 19:22:51 +00:00
|
|
|
o.undolevels = 999 -- Lots of these
|
|
|
|
o.history = 1000 -- More history
|