2024-07-08 10:32:51 +02:00
|
|
|
vim.g.mapleader = ' '
|
|
|
|
vim.g.maplocalleader = ';'
|
2024-10-21 14:24:05 +02:00
|
|
|
-- vim.g.python3_host_prog = '/usr/bin/python3'
|
2024-07-08 10:32:51 +02:00
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.mouse = 'a' -- mouse does annoying things for me if it's not 'a'
|
|
|
|
vim.opt.signcolumn = 'yes'
|
|
|
|
vim.opt.clipboard = '' -- don't just use the system clipboard
|
|
|
|
vim.opt.wrap = false
|
|
|
|
vim.opt.breakindent = false
|
|
|
|
vim.opt.conceallevel = 2
|
2024-07-09 01:51:49 +02:00
|
|
|
vim.opt.concealcursor = 'c'
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.undofile = true
|
|
|
|
vim.opt.undolevels = 10000
|
|
|
|
vim.opt.writebackup = false
|
|
|
|
vim.opt.history = 5000
|
|
|
|
vim.opt.shada = { "'1000", '<50', 's10', 'h' }
|
2024-07-08 10:32:51 +02:00
|
|
|
vim.g.syntax = true
|
2024-07-04 11:26:39 +02:00
|
|
|
|
|
|
|
-- Tabs and Indents
|
|
|
|
-- ===
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.textwidth = 80 -- Text width maximum chars before wrapping
|
|
|
|
vim.opt.tabstop = 4 -- The number of spaces a tab is
|
|
|
|
vim.opt.shiftwidth = 4 -- Number of spaces to use in auto(indent)
|
|
|
|
vim.opt.smarttab = true -- Tab insert blanks according to 'shiftwidth'
|
|
|
|
vim.opt.autoindent = true -- Use same indenting on new lines
|
|
|
|
vim.opt.smartindent = true -- Smart autoindenting on new lines
|
|
|
|
vim.opt.shiftround = true -- Round indent to multiple of 'shiftwidth'
|
2024-07-04 11:26:39 +02:00
|
|
|
|
|
|
|
-- Timing
|
|
|
|
-- ===
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.ttimeout = true
|
|
|
|
vim.opt.timeoutlen = 500 -- Time out on mappings
|
|
|
|
vim.opt.ttimeoutlen = 10 -- Time out on key codes
|
|
|
|
vim.opt.updatetime = 250 -- Idle time to write swap and trigger CursorHold
|
2024-07-04 11:26:39 +02:00
|
|
|
|
|
|
|
-- Searching
|
|
|
|
-- ===
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.ignorecase = true -- Search ignoring case
|
|
|
|
vim.opt.smartcase = true -- Keep case when searching with *
|
|
|
|
vim.opt.infercase = true -- Adjust case in insert completion mode
|
|
|
|
vim.opt.incsearch = true -- Incremental search
|
2024-07-04 11:26:39 +02:00
|
|
|
vim.opt.hlsearch = true -- highlight searched stuff
|
|
|
|
|
|
|
|
-- Formatting
|
|
|
|
-- ===
|
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.wrap = false -- No wrap by default
|
|
|
|
vim.opt.linebreak = true -- Break long lines at 'breakat'
|
|
|
|
vim.opt.breakat = '\\ \\ ;:,!?' -- Long lines break chars
|
|
|
|
vim.opt.startofline = false -- Cursor in same column for few commands
|
|
|
|
vim.opt.splitbelow = true -- Splits open bottom right
|
|
|
|
vim.opt.splitright = true
|
|
|
|
vim.opt.breakindentopt = { shift = 2, min = 20 }
|
2024-07-11 17:52:59 +02:00
|
|
|
vim.opt.formatoptions = 'trowcnlm1jp' -- see :h fo-table & :h formatoptions
|
2024-07-04 10:55:27 +02:00
|
|
|
vim.opt.breakindent = true
|
|
|
|
|
2024-07-04 11:26:39 +02:00
|
|
|
-- Diff
|
|
|
|
-- ===
|
2024-07-04 10:55:27 +02:00
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.diffopt:append { 'iwhite', 'indent-heuristic', 'algorithm:patience' }
|
|
|
|
vim.opt.wildmode = 'longest:full,full' -- Command-line completion mode
|
2024-07-04 10:55:27 +02:00
|
|
|
|
2024-07-04 11:26:39 +02:00
|
|
|
-- Folds
|
|
|
|
-- ===
|
2024-07-04 10:55:27 +02:00
|
|
|
|
2024-07-19 10:20:02 +02:00
|
|
|
vim.opt.foldlevelstart = 60
|
|
|
|
vim.opt.foldlevel = 60
|
|
|
|
vim.opt.foldminlines = 5
|
2024-07-04 10:55:27 +02:00
|
|
|
|
2024-07-04 11:26:39 +02:00
|
|
|
-- Editor UI
|
|
|
|
-- ===
|
2024-07-04 10:55:27 +02:00
|
|
|
|
2024-07-04 12:09:09 +02:00
|
|
|
vim.o.guifont = 'FiraCode Nerd Font:h15'
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.termguicolors = true
|
|
|
|
vim.opt.shortmess = 'xsTOInfFitloCaAs'
|
|
|
|
vim.opt.showmode = true -- Show mode in cmd window
|
2024-07-09 14:57:28 +02:00
|
|
|
vim.opt.scrolloff = 6 -- Keep at least n lines above/below
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.sidescrolloff = 10 -- Keep at least n lines left/right
|
|
|
|
vim.opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
|
|
|
vim.opt.number = true -- Show line numbers
|
|
|
|
vim.opt.relativenumber = true -- Show relative line numbers
|
|
|
|
vim.opt.ruler = true -- Default status ruler
|
|
|
|
vim.opt.showtabline = 1 -- Don't change this, goes back to a vanilla vim default
|
|
|
|
vim.opt.laststatus = 3 -- Always show laststatus
|
2024-07-04 10:55:27 +02:00
|
|
|
|
|
|
|
-- Sets how neovim will display certain whitespace characters in the editor.
|
|
|
|
-- See `:help 'list'`
|
|
|
|
-- and `:help 'listchars'`
|
|
|
|
vim.opt.list = true
|
|
|
|
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
|
|
|
|
2024-07-04 11:26:39 +02:00
|
|
|
if vim.g.started_by_firenvim == true then
|
|
|
|
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
|
|
|
|
opt.laststatus = 1 -- Don't show laststatus in firenvim
|
|
|
|
opt.wrap = true
|
|
|
|
end
|
|
|
|
|
2024-07-04 10:55:27 +02:00
|
|
|
-- Preview substitutions live, as you type!
|
|
|
|
vim.opt.inccommand = 'split'
|
|
|
|
|
2024-07-04 11:26:39 +02:00
|
|
|
if vim.g.neovide == true then
|
|
|
|
-- fulscreen with F11
|
2024-07-04 12:09:09 +02:00
|
|
|
vim.api.nvim_set_keymap('n', '<F11>', ':let g:neovide_fullscreen = !g:neovide_fullscreen<CR>', {})
|
2024-07-04 11:26:39 +02:00
|
|
|
|
|
|
|
vim.g.neovide_underline_automatic_scaling = true
|
|
|
|
|
|
|
|
-- vim.g.neovide_floating_blur_amount_x = 2.0
|
|
|
|
-- vim.g.neovide_floating_blur_amount_y = 2.0
|
|
|
|
|
|
|
|
vim.g.neovide_scroll_animation_length = 0.1
|
|
|
|
-- vim.g.neovide_cursor_animation_length = 0
|
|
|
|
-- vim.g.neovide_cursor_trail_size = 0
|
|
|
|
vim.g.neovide_hide_mouse_when_typing = true
|
|
|
|
|
|
|
|
vim.g.neovide_fullscreen = true
|
|
|
|
end
|
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.helpheight = 0 -- Disable help window resizing
|
|
|
|
vim.opt.winwidth = 30 -- Minimum width for active window
|
|
|
|
vim.opt.winminwidth = 1 -- Minimum width for inactive windows
|
|
|
|
vim.opt.winheight = 1 -- Minimum height for active window
|
|
|
|
vim.opt.winminheight = 1 -- Minimum height for inactive window
|
2024-07-04 11:26:39 +02:00
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.showcmd = false -- show command in status line
|
|
|
|
vim.opt.cmdheight = 0
|
|
|
|
vim.opt.cmdwinheight = 5 -- Command-line lines
|
|
|
|
vim.opt.equalalways = true -- Resize windows on split or close
|
|
|
|
vim.opt.colorcolumn = '80' -- Column highlight at textwidth's max character-limit
|
2024-07-04 11:26:39 +02:00
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.cursorline = true
|
|
|
|
vim.opt.cursorlineopt = { 'number', 'screenline' }
|
2024-07-04 11:26:39 +02:00
|
|
|
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.pumheight = 10 -- Maximum number of items to show in the popup menu
|
|
|
|
vim.opt.pumwidth = 10 -- Minimum width for the popup menu
|
|
|
|
vim.opt.pumblend = 10 -- Popup blend
|
2024-07-04 11:26:39 +02:00
|
|
|
|
|
|
|
-- Spelling correction
|
|
|
|
-- ===
|
|
|
|
|
2024-07-09 14:57:28 +02:00
|
|
|
vim.opt.spell = true -- manually enable spell with `set spell` or `<leader>ts`
|
|
|
|
vim.opt.spelllang = 'en,de_de'
|
2024-07-08 11:12:40 +02:00
|
|
|
vim.opt.spellsuggest = 'double,50,timeout:5000'
|
2024-07-04 11:26:39 +02:00
|
|
|
|
|
|
|
-- autocommands
|
|
|
|
-- ===
|
|
|
|
local function augroup(name)
|
2024-07-04 12:09:09 +02:00
|
|
|
return vim.api.nvim_create_augroup('plex_' .. name, {})
|
2024-07-04 11:26:39 +02:00
|
|
|
end
|
2023-01-07 09:11:43 +01:00
|
|
|
|
2024-07-04 10:55:27 +02:00
|
|
|
-- [[ Basic Keymaps ]]
|
|
|
|
-- See `:help vim.keymap.set()`
|
|
|
|
|
|
|
|
-- [[ Basic Autocommands ]]
|
|
|
|
-- See `:help lua-guide-autocommands`
|
|
|
|
|
|
|
|
-- Highlight when yanking (copying) text
|
|
|
|
-- Try it with `yap` in normal mode
|
|
|
|
-- See `:help vim.highlight.on_yank()`
|
|
|
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
|
|
|
desc = 'Highlight when yanking (copying) text',
|
|
|
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
|
|
|
callback = function()
|
|
|
|
vim.highlight.on_yank()
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
|
|
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
|
|
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
|
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
|
|
|
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
|
|
|
end ---@diagnostic disable-next-line: undefined-field
|
2023-01-07 09:11:43 +01:00
|
|
|
vim.opt.rtp:prepend(lazypath)
|
2024-07-04 10:55:27 +02:00
|
|
|
|
2024-07-04 12:09:09 +02:00
|
|
|
require 'custom.maps'
|
2024-07-08 10:32:51 +02:00
|
|
|
require 'custom.autocmds'
|
2024-07-04 12:09:09 +02:00
|
|
|
require('lazy').setup({
|
|
|
|
{ import = 'custom.plugins' },
|
2024-10-21 14:24:05 +02:00
|
|
|
{ import = 'kickstart.plugins.debug' },
|
2024-07-04 12:09:09 +02:00
|
|
|
}, {
|
|
|
|
ui = {
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
|
|
|
icons = vim.g.have_nerd_font and {} or {
|
|
|
|
cmd = '⌘',
|
|
|
|
config = '🛠',
|
|
|
|
event = '📅',
|
|
|
|
ft = '📂',
|
|
|
|
init = '⚙',
|
|
|
|
keys = '🗝',
|
|
|
|
plugin = '🔌',
|
|
|
|
runtime = '💻',
|
|
|
|
require = '🌙',
|
|
|
|
source = '📄',
|
|
|
|
start = '🚀',
|
|
|
|
task = '📌',
|
|
|
|
lazy = '💤 ',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2024-07-04 11:26:39 +02:00
|
|
|
|
2024-07-04 12:09:09 +02:00
|
|
|
require 'kickstart.health'
|
2024-07-04 10:55:27 +02:00
|
|
|
|
|
|
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
|
|
|
-- vim: ts=2 sts=2 sw=2 et
|