1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-18 18:07:45 +01:00
dotfiles/.config/nvim/init.lua

141 lines
2.7 KiB
Lua
Raw Normal View History

2024-10-12 18:05:48 +02:00
-- vim.o.go = "a"
2023-01-13 04:03:00 +01:00
vim.o.showmode = false
-- disable netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
2023-01-13 04:03:00 +01:00
-- enable mouse for all modes
2024-03-09 03:52:26 +01:00
vim.o.mouse = "a"
vim.o.clipboard = "unnamedplus"
2023-01-13 04:03:00 +01:00
-- basic color settings
2024-03-09 03:52:26 +01:00
vim.o.background = "dark"
2023-01-13 04:03:00 +01:00
-- setting Tab-length
vim.o.expandtab = true
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
-- splits open at the bottom and right
vim.o.splitbelow = true
vim.o.splitright = true
-- disable case sensitive matching
vim.o.ignorecase = true
vim.o.smartcase = true
2023-01-13 04:03:00 +01:00
-- enable nocompatible mode
2024-10-12 18:05:48 +02:00
-- vim.o.nocompatible = true
2023-01-13 04:03:00 +01:00
-- enable syntax highlighting
2024-10-12 18:05:48 +02:00
vim.o.syntax = "true"
2023-01-13 04:03:00 +01:00
-- enable true colors
vim.o.termguicolors = true
-- set utf-8 encoding
vim.o.encoding = "utf-8"
-- show relative numbers on left side
vim.o.number = true
vim.o.relativenumber = true
-- speedup vim with long lines
vim.o.ttyfast = true
2024-03-07 23:19:10 +01:00
-- vim.o.lazyredraw = true
2023-01-13 04:03:00 +01:00
-- decrease update time
vim.o.updatetime = 250
vim.o.timeout = true
vim.o.timeoutlen = 300
-- enable break indent
vim.o.breakindent = true
-- textedit might fail without hidden
2023-01-13 04:03:00 +01:00
vim.o.hidden = true
-- disable backupfiles
2024-10-12 18:05:48 +02:00
-- vim.o.nobackup = true
-- vim.o.nowritebackup = true
2023-01-13 04:03:00 +01:00
-- set completeopt to have a better completion experience
2024-03-09 03:52:26 +01:00
vim.o.completeopt = "menuone,noselect"
-- set completion option for command mode
2024-03-09 03:52:26 +01:00
vim.o.wildmode = "longest:full,full"
-- minimum number of lines around the cursor
vim.o.scrolloff = 10
vim.o.sidescrolloff = 8
2023-01-13 04:03:00 +01:00
-- always show the signcolumn
vim.o.signcolumn = "yes"
-- enable persistent undo
vim.o.undofile = true
vim.o.undodir = vim.env.XDG_CACHE_HOME .. "/vim/undo"
-- python programs to use
2024-03-09 03:52:26 +01:00
vim.g.python_host_prog = "/usr/bin/python2"
vim.g.python3_host_prog = "/usr/bin/python3"
2023-01-13 04:03:00 +01:00
-- folding
2024-03-09 03:52:26 +01:00
vim.o.foldcolumn = "0"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
2024-03-09 03:52:26 +01:00
vim.o.foldexpr = "expr"
vim.o.foldenable = true
vim.o.conceallevel = 0
2023-08-10 04:08:26 +02:00
vim.g.markdown_folding = 1
-- standard settings for colorcolumn and tabbing
vim.o.shiftwidth = 4
vim.o.softtabstop = 4
vim.o.textwidth = 80
2023-09-15 18:25:47 +02:00
-- read files correctly
vim.filetype.add({
extension = {
2024-03-09 03:52:26 +01:00
c = "c",
h = "c",
html = "html",
java = "java",
js = "javascript",
lua = "lua",
md = "markdown",
nim = "nim",
py = "python",
sage = "python",
sh = "bash",
2024-03-09 03:52:26 +01:00
tex = "tex",
},
2023-09-15 18:25:47 +02:00
})
-- set mapleader for hotkeys
vim.g.mapleader = ","
-- load general mapped keys
2024-03-09 03:52:26 +01:00
require("style")
-- load dictionaries and helper functions
2024-03-09 03:52:26 +01:00
require("dictionaries")
-- load plugins (autoload all files in plugin folder)
2024-03-09 03:52:26 +01:00
require("loadplugins")
-- load commands to be run automatically
require("autocmd")
2023-01-13 04:03:00 +01:00
-- load general mapped keys
2024-03-09 03:52:26 +01:00
require("keymap")
2023-08-18 06:06:35 +02:00
vim.cmd([[
set foldopen-=hor
set foldclose-=hor
]])
-- Save localoptions to session file
vim.opt.sessionoptions:append("localoptions")