2021-04-20 18:10:56 +02:00
|
|
|
|
vim.cmd[[set undofile]]
|
|
|
|
|
vim.cmd[[set completeopt-=preview]]
|
|
|
|
|
vim.cmd[[set viewoptions-=options]]
|
2021-04-18 18:51:03 +02:00
|
|
|
|
vim.g.mapleader = ','
|
|
|
|
|
vim.o.hidden = true
|
|
|
|
|
vim.o.mouse = 'a'
|
|
|
|
|
vim.o.splitbelow = true
|
|
|
|
|
vim.o.splitright = true
|
|
|
|
|
vim.o.ttimeout = true
|
|
|
|
|
vim.o.ttimeoutlen = 50
|
|
|
|
|
vim.o.updatetime = 100
|
|
|
|
|
vim.o.autochdir = true
|
2021-06-17 11:29:04 +02:00
|
|
|
|
vim.o.backupdir = "/home/dln/.local/share/nvim/backup/"
|
|
|
|
|
vim.o.backup = true
|
2021-04-20 18:10:56 +02:00
|
|
|
|
|
2021-04-18 18:51:03 +02:00
|
|
|
|
--- Indent
|
2022-01-12 15:58:29 +01:00
|
|
|
|
vim.o.autoindent = true
|
2021-04-20 18:10:56 +02:00
|
|
|
|
vim.o.breakindent = true
|
2022-01-12 15:58:29 +01:00
|
|
|
|
vim.o.expandtab = true
|
|
|
|
|
vim.o.smartindent = true
|
2021-04-18 18:51:03 +02:00
|
|
|
|
vim.o.joinspaces = false
|
|
|
|
|
vim.o.listchars = 'extends:›,precedes:‹,nbsp:·,tab:→ ,trail:·'
|
|
|
|
|
vim.wo.foldlevel = 99
|
|
|
|
|
vim.wo.linebreak = true
|
|
|
|
|
vim.wo.list = true
|
2021-06-17 11:29:04 +02:00
|
|
|
|
vim.o.shiftwidth = 2
|
|
|
|
|
vim.o.tabstop = 2
|
|
|
|
|
vim.o.softtabstop = 2
|
2021-04-18 18:51:03 +02:00
|
|
|
|
|
|
|
|
|
--- Search
|
|
|
|
|
vim.cmd('set path+=**')
|
|
|
|
|
vim.cmd('set wildignore+=*/tmp/*,/var/*,*.so,*.swp,*.zip,*.tar,*.pyc')
|
|
|
|
|
vim.o.ignorecase = true
|
|
|
|
|
vim.o.smartcase = true
|
|
|
|
|
vim.o.wildmode = 'longest:full,full'
|
|
|
|
|
|
|
|
|
|
if vim.fn.executable('rg') then
|
2021-04-20 18:10:56 +02:00
|
|
|
|
vim.o.grepprg = 'rg --vimgrep --no-heading --smart-case'
|
2021-04-18 18:51:03 +02:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Completion
|
|
|
|
|
vim.cmd('set shortmess+=c')
|
|
|
|
|
vim.o.completeopt = 'menuone,noinsert,noselect'
|
|
|
|
|
|
|
|
|
|
--- Appearance
|
|
|
|
|
vim.o.background = 'light'
|
|
|
|
|
vim.o.scrolloff = 8
|
|
|
|
|
vim.o.showmode = false
|
|
|
|
|
vim.o.sidescrolloff = 5
|
|
|
|
|
vim.o.termguicolors = true
|
|
|
|
|
vim.wo.cursorline = true
|
|
|
|
|
vim.wo.number = true
|
2021-04-20 18:10:56 +02:00
|
|
|
|
vim.wo.signcolumn = "yes"
|
2021-04-19 20:22:00 +02:00
|
|
|
|
vim.o.laststatus = 0
|
2022-02-17 12:41:01 +01:00
|
|
|
|
vim.o.statusline = "═"
|
|
|
|
|
vim.o.fillchars = "stl:═,stlnc:═"
|
2021-04-18 18:51:03 +02:00
|
|
|
|
|
|
|
|
|
--- Key mappings
|
|
|
|
|
local map = require("dln.utils").map
|
|
|
|
|
map('n', '<C-l>', ':let @/=""<CR>') -- clear search
|
|
|
|
|
map('n', 'H', '^')
|
|
|
|
|
map('n', 'L', '$')
|
|
|
|
|
map('i', '', '<C-w>')
|
|
|
|
|
|
|
|
|
|
--- Plugins
|
|
|
|
|
vim.g.netrw_dirhistmax = 0
|
|
|
|
|
|
|
|
|
|
require('plugins')
|
2021-04-19 15:28:25 +02:00
|
|
|
|
|
2021-12-20 13:00:25 +01:00
|
|
|
|
local border = {
|
|
|
|
|
{"🭽", "FloatBorder"},
|
|
|
|
|
{"▔", "FloatBorder"},
|
|
|
|
|
{"🭾", "FloatBorder"},
|
|
|
|
|
{"▕", "FloatBorder"},
|
|
|
|
|
{"🭿", "FloatBorder"},
|
|
|
|
|
{"▁", "FloatBorder"},
|
|
|
|
|
{"🭼", "FloatBorder"},
|
|
|
|
|
{"▏", "FloatBorder"},
|
2021-04-20 18:10:56 +02:00
|
|
|
|
}
|
2021-04-19 15:28:25 +02:00
|
|
|
|
|
2021-12-20 13:00:25 +01:00
|
|
|
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
|
|
|
|
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border })
|
2021-04-19 15:28:25 +02:00
|
|
|
|
|
|
|
|
|
-- vim.cmd [[nnoremap <buffer><silent> <C-space> :lua vim.lsp.diagnostic.show_line_diagnostics({ border = border })<CR>]]
|
|
|
|
|
-- vim.cmd [[nnoremap <buffer><silent> ]g :lua vim.lsp.diagnostic.goto_next({ popup_opts = { border = border }})<CR>]]
|
|
|
|
|
-- vim.cmd [[nnoremap <buffer><silent> [g :lua vim.lsp.diagnostic.goto_prev({ popup_opts = { border = "round" }})<CR>]]
|
|
|
|
|
|