2023-06-22 12:51:25 +02:00
|
|
|
|
-- This file is automatically loaded by plugins.core
|
2023-01-04 07:56:26 +01:00
|
|
|
|
vim.g.mapleader = " "
|
2023-07-20 09:20:21 +02:00
|
|
|
|
vim.g.maplocalleader = "\\"
|
2023-01-04 07:56:26 +01:00
|
|
|
|
|
2024-05-16 16:37:26 +02:00
|
|
|
|
-- LazyVim auto format
|
2023-10-10 19:31:08 +02:00
|
|
|
|
vim.g.autoformat = true
|
|
|
|
|
|
2024-06-14 17:55:43 +02:00
|
|
|
|
-- LazyVim picker to use.
|
|
|
|
|
-- Can be one of: telescope, fzf
|
|
|
|
|
-- Leave it to "auto" to automatically use the picker
|
|
|
|
|
-- enabled with `:LazyExtras`
|
|
|
|
|
vim.g.lazyvim_picker = "auto"
|
|
|
|
|
|
2023-10-11 08:59:18 +02:00
|
|
|
|
-- LazyVim root dir detection
|
2023-10-11 09:38:34 +02:00
|
|
|
|
-- Each entry can be:
|
|
|
|
|
-- * the name of a detector function like `lsp` or `cwd`
|
|
|
|
|
-- * a pattern or array of patterns like `.git` or `lua`.
|
|
|
|
|
-- * a function with signature `function(buf) -> string|string[]`
|
2023-10-11 08:59:18 +02:00
|
|
|
|
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
|
|
|
|
|
2024-03-26 19:53:38 +01:00
|
|
|
|
-- LazyVim automatically configures lazygit:
|
|
|
|
|
-- * theme, based on the active colorscheme.
|
|
|
|
|
-- * editorPreset to nvim-remote
|
|
|
|
|
-- * enables nerd font icons
|
2024-03-26 12:43:03 +01:00
|
|
|
|
-- Set to false to disable.
|
2024-03-26 19:53:38 +01:00
|
|
|
|
vim.g.lazygit_config = true
|
2024-03-26 12:43:03 +01:00
|
|
|
|
|
2024-06-05 13:23:19 +04:00
|
|
|
|
-- Options for the LazyVim statuscolumn
|
|
|
|
|
vim.g.lazyvim_statuscolumn = {
|
|
|
|
|
folds_open = false, -- show fold sign when fold is open
|
|
|
|
|
folds_githl = false, -- highlight fold sign with git sign color
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-22 09:49:07 +01:00
|
|
|
|
-- Optionally setup the terminal to use
|
|
|
|
|
-- This sets `vim.o.shell` and does some additional configuration for:
|
|
|
|
|
-- * pwsh
|
|
|
|
|
-- * powershell
|
|
|
|
|
-- LazyVim.terminal.setup("pwsh")
|
|
|
|
|
|
2024-05-17 09:19:22 +02:00
|
|
|
|
-- Hide deprecation warnings
|
|
|
|
|
vim.g.deprecation_warnings = false
|
|
|
|
|
|
2024-06-25 20:30:57 +02:00
|
|
|
|
-- Set filetype to `bigfile` for files larger than 1.5 MB
|
|
|
|
|
-- Only vim syntax will be enabled (with the correct filetype)
|
|
|
|
|
-- LSP, treesitter and other ft plugins will be disabled.
|
|
|
|
|
-- mini.animate will also be disabled.
|
|
|
|
|
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
|
|
|
|
|
|
2024-05-31 20:07:55 +08:00
|
|
|
|
-- Show the current document symbols location from Trouble in lualine
|
|
|
|
|
vim.g.trouble_lualine = true
|
|
|
|
|
|
2023-01-11 12:56:07 +01:00
|
|
|
|
local opt = vim.opt
|
2023-01-11 08:05:29 +01:00
|
|
|
|
|
2023-01-24 13:40:18 +01:00
|
|
|
|
opt.autowrite = true -- Enable auto write
|
2024-05-16 16:37:26 +02:00
|
|
|
|
-- only set clipboard if not in ssh, to make sure the OSC 52
|
|
|
|
|
-- integration works automatically. Requires Neovim >= 0.10.0
|
|
|
|
|
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.completeopt = "menu,menuone,noselect"
|
2024-01-21 19:34:07 +00:00
|
|
|
|
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
2023-01-24 13:40:18 +01:00
|
|
|
|
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.cursorline = true -- Enable highlighting of the current line
|
|
|
|
|
opt.expandtab = true -- Use spaces instead of tabs
|
2024-05-16 16:37:26 +02:00
|
|
|
|
opt.fillchars = {
|
|
|
|
|
foldopen = "",
|
|
|
|
|
foldclose = "",
|
|
|
|
|
fold = " ",
|
|
|
|
|
foldsep = " ",
|
|
|
|
|
diff = "╱",
|
|
|
|
|
eob = " ",
|
|
|
|
|
}
|
|
|
|
|
opt.foldlevel = 99
|
|
|
|
|
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.formatoptions = "jcroqlnt" -- tcqj
|
|
|
|
|
opt.grepformat = "%f:%l:%c:%m"
|
|
|
|
|
opt.grepprg = "rg --vimgrep"
|
|
|
|
|
opt.ignorecase = true -- Ignore case
|
|
|
|
|
opt.inccommand = "nosplit" -- preview incremental substitute
|
2024-07-02 19:02:13 +02:00
|
|
|
|
opt.jumpoptions = "view"
|
2023-10-05 10:43:21 +02:00
|
|
|
|
opt.laststatus = 3 -- global statusline
|
2024-06-06 16:05:23 +02:00
|
|
|
|
opt.linebreak = true -- Wrap lines at convenient points
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.list = true -- Show some invisible characters (tabs...
|
2023-01-24 13:40:18 +01:00
|
|
|
|
opt.mouse = "a" -- Enable mouse mode
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.number = true -- Print line number
|
|
|
|
|
opt.pumblend = 10 -- Popup blend
|
|
|
|
|
opt.pumheight = 10 -- Maximum number of entries in a popup
|
|
|
|
|
opt.relativenumber = true -- Relative line numbers
|
|
|
|
|
opt.scrolloff = 4 -- Lines of context
|
2023-10-27 18:34:33 +02:00
|
|
|
|
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.shiftround = true -- Round indent
|
|
|
|
|
opt.shiftwidth = 2 -- Size of an indent
|
2023-10-01 14:17:54 +02:00
|
|
|
|
opt.shortmess:append({ W = true, I = true, c = true, C = true })
|
2023-01-24 13:40:18 +01:00
|
|
|
|
opt.showmode = false -- Dont show mode since we have a statusline
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.sidescrolloff = 8 -- Columns of context
|
|
|
|
|
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
|
|
|
|
opt.smartcase = true -- Don't ignore case with capitals
|
|
|
|
|
opt.smartindent = true -- Insert indents automatically
|
|
|
|
|
opt.spelllang = { "en" }
|
2024-06-06 22:37:47 +02:00
|
|
|
|
opt.spelloptions:append("noplainbuffer")
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.splitbelow = true -- Put new windows below current
|
2023-10-01 14:17:54 +02:00
|
|
|
|
opt.splitkeep = "screen"
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.splitright = true -- Put new windows right of current
|
2024-05-16 16:37:26 +02:00
|
|
|
|
opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.tabstop = 2 -- Number of spaces tabs count for
|
|
|
|
|
opt.termguicolors = true -- True color support
|
2024-05-16 16:37:26 +02:00
|
|
|
|
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.undofile = true
|
|
|
|
|
opt.undolevels = 10000
|
2023-01-24 13:40:18 +01:00
|
|
|
|
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
2023-10-09 17:49:00 +02:00
|
|
|
|
opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
2023-01-24 13:40:18 +01:00
|
|
|
|
opt.winminwidth = 5 -- Minimum window width
|
2023-01-11 08:05:29 +01:00
|
|
|
|
opt.wrap = false -- Disable line wrap
|
2022-12-30 17:30:52 +01:00
|
|
|
|
|
2023-10-03 08:01:48 +02:00
|
|
|
|
if vim.fn.has("nvim-0.10") == 1 then
|
|
|
|
|
opt.smoothscroll = true
|
2024-05-16 11:44:19 +05:45
|
|
|
|
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
2024-05-16 16:37:26 +02:00
|
|
|
|
opt.foldmethod = "expr"
|
2024-05-16 11:44:19 +05:45
|
|
|
|
opt.foldtext = ""
|
2023-10-03 08:02:10 +02:00
|
|
|
|
else
|
2024-05-16 11:44:19 +05:45
|
|
|
|
opt.foldmethod = "indent"
|
2024-05-16 16:37:26 +02:00
|
|
|
|
opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
2023-10-03 08:02:10 +02:00
|
|
|
|
end
|
|
|
|
|
|
2023-01-24 13:40:18 +01:00
|
|
|
|
-- Fix markdown indentation settings
|
2022-12-30 17:30:52 +01:00
|
|
|
|
vim.g.markdown_recommended_style = 0
|