2023-02-18 17:59:03 +01:00
|
|
|
|
-- luacheck: globals vim
|
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
|
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
|
|
|
vim.fn.system({
|
|
|
|
|
"git",
|
|
|
|
|
"clone",
|
|
|
|
|
"--filter=blob:none",
|
|
|
|
|
"https://github.com/folke/lazy.nvim.git",
|
|
|
|
|
"--branch=stable", -- latest stable release
|
|
|
|
|
lazypath,
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
2023-02-18 17:59:03 +01:00
|
|
|
|
|
2023-07-23 16:03:14 +02:00
|
|
|
|
vim.g.mapleader = ","
|
|
|
|
|
vim.g.maplocaleader = "\\"
|
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
require("lazy").setup('plugins')
|
|
|
|
|
|
|
|
|
|
vim.opt.wrap = false
|
|
|
|
|
vim.opt.number = true
|
|
|
|
|
vim.opt.compatible = false
|
|
|
|
|
vim.opt.mouse = "a" -- mouse support
|
|
|
|
|
vim.opt.showcmd = true -- show incomplete cmds down the bottom
|
|
|
|
|
vim.opt.showmode = true -- show current mode
|
|
|
|
|
vim.opt.showmatch = true -- set show matching parenthesis
|
|
|
|
|
vim.opt.visualbell = true -- no sounds
|
|
|
|
|
vim.opt.autoread = true -- reload files changed outside of vim
|
|
|
|
|
vim.opt.backspace = [[indent,eol,start]] -- allow backspacing over everything in insert mode
|
|
|
|
|
vim.opt.ignorecase = true -- ignore case when searching
|
|
|
|
|
vim.opt.shiftround = true -- use multiple of shiftwidth when indenting with '<' and '>'
|
|
|
|
|
vim.opt.smartcase = true -- ignore case if searching pattern is all lowecase, case-sensitive otherwise
|
|
|
|
|
vim.opt.smarttab = true -- insert tabs on the start of a line according to shiftwidth, not tabstop
|
|
|
|
|
vim.opt.hlsearch = true -- highlight search terms
|
|
|
|
|
vim.opt.incsearch = true -- show search matches as you type
|
|
|
|
|
vim.opt.hidden = true
|
|
|
|
|
vim.opt.ruler = true
|
|
|
|
|
vim.opt.clipboard = "unnamed" -- system clipboard
|
|
|
|
|
vim.opt.colorcolumn = "80"
|
|
|
|
|
|
|
|
|
|
-- vim.cmd("syntax on")
|
2023-02-18 17:59:03 +01:00
|
|
|
|
vim.cmd("filetype plugin on")
|
|
|
|
|
|
|
|
|
|
if vim.fn.has("multi_byte") == 1 and vim.o.encoding == "utf-8" then
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.listchars = [[tab:▸ ,extends:❯,precedes:❮,nbsp:±,trail:…]]
|
2023-02-18 17:59:03 +01:00
|
|
|
|
else
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.listchars = [[tab:> ,extends:>,precedes:<,nbsp:.,trail:_]]
|
2023-02-18 17:59:03 +01:00
|
|
|
|
end
|
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.splitbelow = true
|
|
|
|
|
vim.opt.splitright = true
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-r>", "<C-w>r", {})
|
2023-02-18 17:59:03 +01:00
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-1>", "1gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-2>", "2gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-3>", "3gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-4>", "4gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-5>", "5gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-6>", "6gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-7>", "7gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-8>", "8gt", {})
|
|
|
|
|
vim.api.nvim_set_keymap('n', "<A-9>", ":tablast<cr>", {})
|
2023-02-18 17:59:03 +01:00
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.api.nvim_set_keymap('n', "<C-l>", ":nohl<CR><C-l>", { noremap = true })
|
2023-02-18 17:59:03 +01:00
|
|
|
|
|
|
|
|
|
-- todo: try to do it with `vim.api.nvim_set_hl`
|
|
|
|
|
vim.cmd("hi CursorLine cterm=NONE,underline ctermbg=NONE") -- highlight line when in insert mode
|
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.timeoutlen = 1000
|
|
|
|
|
vim.opt.ttimeoutlen = 0
|
2023-02-18 17:59:03 +01:00
|
|
|
|
|
|
|
|
|
vim.cmd("autocmd InsertEnter * :set cursorline")
|
|
|
|
|
vim.cmd("autocmd InsertLeave * :set nocursorline")
|
|
|
|
|
|
|
|
|
|
-- indentation
|
|
|
|
|
vim.cmd("filetype indent on")
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.softtabstop = 4
|
|
|
|
|
vim.opt.expandtab = true
|
|
|
|
|
vim.opt.shiftwidth = 4
|
|
|
|
|
vim.opt.tabstop = 4
|
|
|
|
|
vim.opt.autoindent = true
|
|
|
|
|
vim.opt.copyindent = true
|
2023-02-18 17:59:03 +01:00
|
|
|
|
|
|
|
|
|
-- folds
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.foldmethod = "indent"
|
|
|
|
|
vim.opt.foldnestmax = 3
|
|
|
|
|
vim.opt.foldenable = false
|
2023-07-29 20:58:33 +02:00
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.termguicolors = true
|
2023-07-23 16:03:14 +02:00
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
-- vim.g.markdown_syntax_conceal = 0
|
2023-07-29 20:58:33 +02:00
|
|
|
|
|
2023-08-02 12:15:37 +02:00
|
|
|
|
vim.opt.updatetime = 100 -- to make gigutter more responsive
|
2023-07-23 16:03:14 +02:00
|
|
|
|
|
|
|
|
|
if vim.g.neovide then
|
|
|
|
|
vim.o.guifont = "Hack Nerd Font:h10"
|
|
|
|
|
end
|