81 lines
2.6 KiB
Lua
81 lines
2.6 KiB
Lua
vim.cmd('filetype plugin indent on')
|
|
vim.cmd('language en_US.utf-8')
|
|
|
|
local opt = vim.opt
|
|
local indent = 2
|
|
opt.termguicolors = true -- Enable colors in terminal
|
|
opt.hlsearch = true --Set highlight on search
|
|
opt.number = true --Make line numbers default
|
|
opt.relativenumber = false --Make relative number default
|
|
opt.mouse = 'a' --Enable mouse mode
|
|
opt.breakindent = true --Enable break indent
|
|
opt.undofile = true --Save undo history
|
|
opt.ignorecase = true --Case insensitive searching unless /C or capital in search
|
|
opt.smartcase = true -- Smart case
|
|
opt.updatetime = 300 --Decrease update time
|
|
opt.signcolumn = 'yes' -- Always show sign column
|
|
opt.clipboard = 'unnamed,unnamedplus' -- Access system clipboard
|
|
opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete.
|
|
opt.showmode = false -- Do not need to show the mode. We use the statusline instead.
|
|
opt.scrolloff = 999 -- Lines of context
|
|
opt.joinspaces = false -- No double spaces with join after a dot
|
|
opt.showmatch = true -- Show matching braces
|
|
opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line
|
|
opt.list = true
|
|
opt.hidden= true
|
|
opt.scrolloff= 4
|
|
opt.shiftround= true
|
|
opt.relativenumber= false
|
|
opt.splitbelow= true
|
|
opt.splitright= true
|
|
opt.wildmode= 'longest:full,full'
|
|
opt.splitbelow= true
|
|
opt.splitright= true
|
|
opt.shiftwidth = indent
|
|
opt.tabstop = indent
|
|
if vim.loop.os_uname().sysname == 'Linux' then
|
|
opt.guifont= 'JetBrainsMono Nerd Font Mono:h7'
|
|
else
|
|
opt.guifont= 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
|
end
|
|
opt.swapfile= false
|
|
opt.backup= false
|
|
opt.spelllang= 'en,de'
|
|
opt.completeopt= 'menu,menuone,noselect'
|
|
opt.expandtab= true
|
|
opt.smartindent= true
|
|
opt.title = true
|
|
opt.titlestring = '%{getcwd()} - %t'
|
|
opt.laststatus = 3
|
|
|
|
-- go to previous/next line with h,l,left arrow and right arrow
|
|
-- when cursor reaches end/beginning of line
|
|
-- opt.whichwrap:append('<>[]hl')
|
|
|
|
-- disable nvim intro
|
|
opt.shortmess:append('sI')
|
|
|
|
-- Treesitter based folding
|
|
opt.foldlevel = 20
|
|
opt.foldmethod = 'expr'
|
|
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
|
|
|
local function status_line()
|
|
local file_name = "%-.32t"
|
|
local modified = " %-m"
|
|
local right_align = "%="
|
|
local line_no = "%10([%l/%L%)]"
|
|
local pct_thru_file = "%5p%%"
|
|
|
|
return string.format(
|
|
"%s%s%s%s%s",
|
|
file_name,
|
|
modified,
|
|
right_align,
|
|
line_no,
|
|
pct_thru_file
|
|
)
|
|
end
|
|
|
|
opt.winbar = status_line()
|