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", "", "") map({"t", "n"}, "", "") map({"t", "n"}, "", "") map({"t", "n"}, "", "") map({"t", "n"}, "", "") map({"i", "n"}, "", "") map("n", '', 'noh') map("v", "J", ":m '>+1gv=gv") map("v", "K", ":m '<-2gv=gv") map("v", "", "" , ">gv") map("n", "", ":find ") map("n", "", ":Lex") map("n", "", ":bd") map("i", "", 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/rebelot/kanagawa.nvim' }, { src = 'https://github.com/rose-pine/neovim' }, { 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('kanagawa') 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()") map("n", "gr", ":lua vim.lsp.buf.rename()") map("n", "ga", ":lua vim.lsp.buf.code_action()") require("fzf-lua").setup({}) map("n", "", ":FzfLua files") map("n", "", ":FzfLua buffers") map("n", "", ":FzfLua diagnostics_workspace") map("n", "", ":FzfLua live_grep") map("n", "", ":FzfLua grep_curbuf") require("nvim-tree").setup() map("n", "", ":NvimTreeToggle") -- ----------------------------- -- @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, })