126 lines
4.1 KiB
Lua
126 lines
4.1 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.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete.
|
|
opt.ttimeoutlen = 10
|
|
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.winborder = 'rounded'
|
|
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.fn.has('wsl') == 1 then
|
|
vim.g.clipboard = {
|
|
name = 'WslClipboard',
|
|
copy = {
|
|
['+'] = 'clip.exe',
|
|
['*'] = 'clip.exe',
|
|
},
|
|
paste = {
|
|
['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
|
['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
|
},
|
|
cache_enabled = 0,
|
|
}
|
|
-- opt.guifont = 'Hack Nerd Font Mono:h10'
|
|
opt.guifont = 'RobotoMono Nerd Font:h10'
|
|
elseif vim.loop.os_uname().sysname == 'Linux' then
|
|
opt.guifont = 'Iosevka NFM:h11'
|
|
if vim.env.SSH_TTY or vim.env.SSH_CLIENT or vim.env.SSH_CONNECTION then
|
|
function no_paste(reg)
|
|
return function(lines)
|
|
-- Do nothing! We can't paste with OSC52
|
|
end
|
|
end
|
|
|
|
vim.g.clipboard = {
|
|
name = 'OSC 52',
|
|
copy = {
|
|
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
|
|
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
|
|
},
|
|
paste = {
|
|
-- ['+'] = require('vim.ui.clipboard.osc52').paste('+'),
|
|
-- ['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
|
['+'] = no_paste('+'), -- Pasting disabled
|
|
['*'] = no_paste('*'), -- Pasting disabled
|
|
},
|
|
}
|
|
end
|
|
else
|
|
-- opt.guifont = 'Hack Nerd Font:h10'
|
|
-- opt.guifont = 'JetBrainsMono Nerd Font:h10'
|
|
-- opt.guifont = 'FiraCode Nerd Font:h10'
|
|
-- opt.guifont = 'RobotoMono Nerd Font:h10'
|
|
opt.guifont = 'IosevkaTerm Nerd Font Mono:h11'
|
|
-- opt.guifont = 'Cousine Nerd Font Mono:h10'
|
|
-- opt.guifont = 'DroidSansM Nerd Font Propo:h10'
|
|
-- opt.guifont = 'AnonymicePro Nerd Font:h11'
|
|
-- opt.guifont = 'SauceCodePro Nerd Font:h10'
|
|
-- opt.guifont = 'Monoid Nerd Font Propo:h10'
|
|
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 = '%(%{fnamemodify(getcwd(),":t")}%) Neovim'
|
|
opt.laststatus = 3 -- for lualine
|
|
opt.background = 'dark'
|
|
|
|
-- 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()'
|
|
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
|
|
|
vim.diagnostic.config({
|
|
virtual_text = false,
|
|
signs = true,
|
|
float = {
|
|
border = 'single',
|
|
format = function(diagnostic)
|
|
return string.format('%s (%s) [%s]', diagnostic.message, diagnostic.source, diagnostic.code or diagnostic.user_data.lsp.code)
|
|
end,
|
|
},
|
|
})
|
|
|
|
-- Window border for floating windows
|
|
require('lspconfig.ui.windows').default_options.border = 'rounded'
|
|
|
|
require('bamboo').load()
|