require("vim._core.ui2").enable({}) map = vim.keymap.set vim.g.termguicolors = true vim.g.netrw_keepdir = 1 vim.g.netrw_winsize = 30 vim.g.netrw_browse_split = 4 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.opt.listchars:append("tab:> ") vim.opt.shortmess:append("c") vim.o.list = true vim.o.undofile = true vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir" vim.cmd.colorscheme("retrobox") 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/sheerun/vim-polyglot' }, { src = 'https://github.com/romus204/tree-sitter-manager.nvim' }, { src = 'https://github.com/xiyaowong/transparent.nvim' }, { src = "https://github.com/vague-theme/vague.nvim" }, }) require("mini.completion").setup() require("tree-sitter-manager").setup() require('vague').setup({ transparent = true, }) vim.cmd.colorscheme('vague') -- 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") -- ----------------------------- -- @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, }) require("terminal")