mirror of
https://codeberg.org/Mo8it/server_dotfiles.git
synced 2024-09-19 19:01:16 +00:00
Add nvim config
This commit is contained in:
parent
6dc2f3d9c8
commit
3f2da37952
1 changed files with 91 additions and 0 deletions
91
.config/nvim/init.lua
Normal file
91
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
-- autocmd.lua
|
||||||
|
--------------
|
||||||
|
|
||||||
|
-- Highlight on yank
|
||||||
|
local function custom_highlight_on_yank()
|
||||||
|
vim.highlight.on_yank({ timeout = 1200 })
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
pattern = "*",
|
||||||
|
callback = custom_highlight_on_yank,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Autoresize
|
||||||
|
vim.api.nvim_create_autocmd("VimResized", {
|
||||||
|
pattern = "*",
|
||||||
|
command = "wincmd =",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- keybindings.lua
|
||||||
|
------------------
|
||||||
|
|
||||||
|
local set = vim.keymap.set
|
||||||
|
local opts = {
|
||||||
|
silent = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- cmd string
|
||||||
|
local function cmd(command)
|
||||||
|
return "<cmd>" .. command .. "<CR>"
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
set("", "<Space>", "<Nop>", opts)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
set("n", "<space>l", cmd("noh"), opts)
|
||||||
|
|
||||||
|
set("v", ">", ">gv", opts)
|
||||||
|
set("v", "<", "<gv", opts)
|
||||||
|
|
||||||
|
-- options.lua
|
||||||
|
--------------
|
||||||
|
|
||||||
|
local o = vim.o
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
o.expandtab = true
|
||||||
|
o.tabstop = 4
|
||||||
|
o.shiftwidth = 4
|
||||||
|
o.smartindent = true
|
||||||
|
|
||||||
|
o.number = true
|
||||||
|
|
||||||
|
o.ignorecase = true
|
||||||
|
o.smartcase = true
|
||||||
|
|
||||||
|
o.gdefault = true
|
||||||
|
|
||||||
|
o.termguicolors = true
|
||||||
|
|
||||||
|
o.wrap = false
|
||||||
|
|
||||||
|
o.whichwrap = "b,s,h,l,<,>,[,]"
|
||||||
|
|
||||||
|
o.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
o.undofile = true
|
||||||
|
|
||||||
|
o.showmode = false
|
||||||
|
|
||||||
|
o.scrolloff = 3
|
||||||
|
o.sidescrolloff = 5
|
||||||
|
|
||||||
|
o.cursorline = true
|
||||||
|
|
||||||
|
o.shell = "/usr/bin/fish"
|
||||||
|
|
||||||
|
o.confirm = true
|
||||||
|
|
||||||
|
o.linebreak = true
|
||||||
|
|
||||||
|
o.laststatus = 3
|
||||||
|
|
||||||
|
o.pumblend = 10
|
||||||
|
|
||||||
|
-- Disable diagnostics
|
||||||
|
vim.diagnostic.disable()
|
Loading…
Reference in a new issue