Files
dotfiles/config/nvim/init.lua
T
jasonhilder ccd02e718b Cleanup/updates for new software.
Dropped xfwm for awesomewm
Themed it accordingly, theme, icons, cursor, rofi
Cleaned up picom for awesome and made better animations
Install script cleanup and removed unneeded tools
2026-07-01 10:31:20 +02:00

110 lines
3.3 KiB
Lua

require("vim._core.ui2").enable({})
map = vim.keymap.set
vim.o.termguicolors = true
vim.o.nu = true
vim.o.swapfile = false
vim.o.winborder = "single"
vim.o.winblend = 0
vim.o.pumblend = 0
vim.o.scrolloff = 20
vim.o.shiftwidth = 4
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.path = "**"
vim.o.clipboard = "unnamedplus"
vim.o.foldmethod = "expr"
vim.o.foldlevel = 99
vim.o.completeopt = "menuone,noselect,fuzzy,nosort"
vim.o.undofile = true
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
vim.o.errorformat = "%f(%l:%c) %m,%-G%.%#"
-- -----------------------------
-- @BINDS
-- -----------------------------
map("t", "<ESC><ESC>", "<C-\\><C-n>")
map({"t", "n"}, "<C-h>", "<C-\\><C-n><C-w><C-h>")
map({"t", "n"}, "<C-j>", "<C-\\><C-n><C-w><C-j>")
map({"t", "n"}, "<C-k>", "<C-\\><C-n><C-w><C-k>")
map({"t", "n"}, "<C-l>", "<C-\\><C-n><C-w><C-l>")
map({"i", "n"}, "<C- >", "<C-x><C-o>")
map("n", '<Esc>', '<Cmd>noh<CR><Esc>')
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")
map("v", "<S-Tab>", "<gv")
map("v", "<Tab>" , ">gv")
map("n", "<C-p>", ":find ")
map("n", "<C-e>", ":Lex<CR>")
map("n", "<C-backspace>", ":bd<CR>")
map("i", "<C-h>", vim.lsp.buf.signature_help)
-- -----------------------------
-- @PLUGINS
-- -----------------------------
vim.pack.add({
{ src = 'https://github.com/ibhagwan/fzf-lua' },
{ src = 'https://github.com/neovim/nvim-lspconfig' },
{ src = 'https://github.com/echasnovski/mini.nvim' },
{ src = 'https://github.com/nvim-tree/nvim-tree.lua' },
{ src = 'https://github.com/romus204/tree-sitter-manager.nvim' },
{ src = 'https://github.com/lukas-reineke/indent-blankline.nvim' },
{ src = 'https://github.com/slugbyte/lackluster.nvim' },
{ src = 'https://github.com/xiyaowong/transparent.nvim' },
})
require("terminal")
require("mini.completion").setup()
require('mini.statusline').setup({})
require("tree-sitter-manager").setup()
require("ibl").setup({
indent = { char = "" },
scope = { show_start = false, show_end = false },
})
vim.cmd.colorscheme('lackluster-night')
vim.api.nvim_set_hl(0, "WinSeparator", { fg = "#54546D" })
-- Lsp specific, uses nvim-lspconfigs with the below
vim.lsp.enable({ "gopls", "ols" })
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
map("n", "gr", ":lua vim.lsp.buf.rename()<CR>")
map("n", "ga", ":lua vim.lsp.buf.code_action()<CR>")
require("fzf-lua").setup({})
map("n", "<C-p>", ":FzfLua files<CR>")
map("n", "<C-m>", ":FzfLua buffers<CR>")
map("n", "<C-i>", ":FzfLua diagnostics_workspace<CR>")
map("n", "<C-f>", ":FzfLua live_grep<CR>")
map("n", "<C-b>", ":FzfLua grep_curbuf<CR>")
require("nvim-tree").setup()
map("n", "<C-e>", ":NvimTreeToggle<CR>")
-- -----------------------------
-- @AUTOCMDS
-- -----------------------------
-- Terminals should open with insert mode
vim.api.nvim_create_autocmd({ "BufEnter", "TermEnter", "WinEnter" }, {
pattern = "term://*",
callback = function()
if vim.bo.buftype == "terminal" then
vim.schedule(function()
vim.cmd("startinsert")
end)
end
end
})
-- highlights yanked text
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank({
higroup = "IncSearch",
timeout = 200,
})
end,
})
-- removes trailing whitespace on save
vim.api.nvim_create_autocmd("BufWritePre", {
callback = function()
local save_cursor = vim.fn.getpos(".")
vim.cmd([[%s/\s\+$//e]])
vim.fn.setpos(".", save_cursor)
end,
})