dotfiles/modules/programs/nvim/init.lua

91 lines
2.7 KiB
Lua
Raw Normal View History

2023-02-16 18:03:55 +01:00
vim.g.mapleader = " "
vim.g.maplocalleader = ","
-- FIX to create spell dir if not existent
local spelldir = vim.fn.stdpath("data") .. "/site/spell"
if not vim.loop.fs_stat(spelldir) then
vim.fn.mkdir(spelldir, "p")
end
vim.opt.autoindent = true
vim.opt.backupdir = { vim.fn.stdpath("state") .. "/nvim/backup//" } -- don't store backup in files dir
vim.opt.clipboard = "unnamedplus" -- sync with system clipboard
vim.opt.conceallevel = 2
vim.opt.expandtab = true -- spaces instead of tabs
vim.opt.guifont = "Fira Code Nerd Font:h1"
vim.opt.ignorecase = true
vim.opt.mouse = "a" -- mouse for all modes
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.scrolloff = 4 -- lines of context
vim.opt.shiftround = true -- round indent
vim.opt.shiftwidth = 0 -- use tabstop value
vim.opt.shortmess:append({ c = true })
vim.opt.signcolumn = "yes"
vim.opt.smartcase = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.tabstop = 2
vim.opt.termguicolors = true
vim.opt.undofile = true
vim.opt.undolevels = 10000
vim.opt.updatetime = 300
vim.opt_local.spell = true
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
require("catppuccin").setup({
2023-02-17 12:38:02 +01:00
compile_path = vim.fn.stdpath("cache") .. "/catppuccin", -- fix issue of writing to nix store
integrations = {
which_key = true,
},
2023-02-16 18:03:55 +01:00
})
2023-02-17 12:38:02 +01:00
vim.cmd.colorscheme("catppuccin-macchiato")
2023-02-16 18:03:55 +01:00
vim.o.timeout = true
vim.o.timeoutlen = 300
local wk = require("which-key")
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})
wk.register({
2023-02-17 12:38:02 +01:00
f = {
name = "find",
f = { "<cmd>Telescope find_files<cr>", "find file" },
g = { "<cmd>Telescope live_grep<cr>", "live grep" },
b = { "<cmd>Telescope buffers<cr>", "find buffer" },
},
2023-02-16 18:03:55 +01:00
}, { prefix = "<leader>" })
require("neogit").setup({
2023-02-17 12:38:02 +01:00
disable_commit_confirmation = true,
2023-02-16 18:03:55 +01:00
})
wk.register({
2023-02-17 12:38:02 +01:00
g = { "<cmd>Neogit<cr>", "git" },
}, { prefix = "<leader>" })
2023-02-16 18:03:55 +01:00
require("nvim-treesitter.configs").setup({
sync_install = false,
auto_install = false,
highlight = {
enable = true,
additional_vim_regex_highlighting = true,
},
})