summaryrefslogtreecommitdiff
path: root/.config/nvim/init.lua
blob: a7afba80d7840fad58b6cfa8d0878c38f8d34600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- general settings
vim.opt.number = true                       -- show line numbers
vim.opt.relativenumber = true               -- relative line numbers for navigation
vim.opt.clipboard:append { 'unnamedplus' }  -- use clipboard
vim.opt.mouse = "a"                         -- enable mouse support
vim.opt.updatetime = 250                    -- Faster updates (e.g., for LSP diagnostics)
vim.opt.timeoutlen = 500                    -- Shorter timeout for key sequences
vim.opt.splitright = true                   -- vsplit opens new buffer on the right side

-- tab and indentation settings
vim.opt.expandtab = true            -- tabs are converted to spaces
vim.opt.shiftwidth = 4              -- 4 spaces for indentation
vim.opt.tabstop = 4                 -- 4 spaces for tabs
vim.opt.softtabstop = 4             -- 4 spaces for tab key
vim.opt.autoindent = true           -- Copy indent from previous line

-- plugin preparation
vim.opt.signcolumn = "yes"                              -- LSP diagnostics
vim.opt.termguicolors = true                            -- enable true colors
vim.opt.completeopt = { "menu", "menuone", "noselect" } -- required for nvim-cmp

-- plugin manager (set leader key before loading lazy.nvim)
vim.g.mapleader = " "               -- Set leader to space
vim.g.maplocalleader = "\\"         -- Set local leader to backslash
require("config.lazy")

-- load lsp's
vim.lsp.enable({
    'lua_ls',
    'clangd',
    'pyright'
})