require("plugins") local builtin = require('telescope.builtin') local mark = require("harpoon.mark") local ui = require("harpoon.ui") local api = vim.api local g = vim.g local opt = vim.opt local keymap = vim.api.nvim_set_keymap require('lualine').setup { options = { icons_enabled = true, theme= 'palenight', component_separators = { left = '|', right = '|'}, section_separators = { left = '', right = ''}, disabled_filetypes = { statusline = {}, winbar = {}, }, }, } require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" (the five listed parsers should always be installed) ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "cpp" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, -- Automatically install missing parsers when entering buffer -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally auto_install = true, -- List of parsers to ignore installing (for "all") ignore_install = { "javascript" }, highlight = { enable = true, additional_vim_regex_highlighting = false, }, } vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) local cmp = require("cmp") cmp.setup { window = { completion = cmp.config.window.bordered() }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.confirm{ select = false }, [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() else fallback() end end, {"i", "s"}), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() else fallback() end end) }), sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "path" } }, { { name = "buffer" }, }) } cmp.setup.cmdline({"/"}, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = "buffer" } } }) cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }) }) require('formatter').setup({ filetype = { cpp = { function() return { exe = "clang-format", stdin = true } end }, } }) require("mason").setup { ensure_installed = { "clangd", "clang-format", } } local lspconfig = require('lspconfig') lspconfig.clangd.setup { on_attach = function(client, bufnr) client.server_capabilities.signatureHelpProvider = false on_attach(client,bufnr) end, capabilities = capabilities, } lspconfig.pyright.setup {} lspconfig.rust_analyzer.setup {} require("luasnip.loaders.from_vscode").lazy_load() require('gitsigns').setup { signs = { add = { hl = 'GitGutterAdd', text = '|' }, change = { hl = 'GitGutterChange', text = '|' }, delete = { hl = 'GitGutterDelete', text = '_' }, topdelete = { hl = 'GitGutterDelete', text = '‾' }, changedelete = { hl = 'GitGutterChange', text = '~' }, }, } require('Comment').setup() require("nightfox").setup({ palettes = { terafox = { bg1 = "#1A1B1F", }, }, }) -- vim.cmd("colorscheme terafox") require('decay').setup({ style = 'dark', italics = { code = true, comments = false -- to disable italic comments, replace to true to enable }, nvim_tree = { contrast = true } }) -- require('decay').setup({ -- style = 'dark', -- nvim_tree = { -- contrast = true -- or false to disable tree contrast, -- }, -- }) -- vim.cmd("colorscheme decay") opt.number = true opt.tabstop = 4 opt.shiftwidth = 4 opt.relativenumber = true opt.mouse = "a" opt.ignorecase = true opt.termguicolors = true -- opt.showtabline = 2 opt.list = true g.loaded_netrw = 1 g.loaded_netrwPlugin = 1 g.mapleader = " " g.vimtex_view_method = "zathura" g.vimtex_compiler_method = "latexmk" keymap("n", "f", ":NvimTreeToggle", {silent = true} ) keymap("n", "t", ":ToggleTerm", {silent = true} ) keymap('n', 'y', '"+y', {silent = true}) keymap('n', 'd', '"+d', {silent = true}) keymap('n', 'pp', '"+p', {silent = true}) keymap('n', 'l', ":!zathura = expand('%:r').pdf &", {silent = true}) keymap('n', '', ":BufferLineCyclePrev", {silent = true}) keymap('n', '', ":BufferLineCycleNext", {silent = true}) vim.keymap.set('n', 'pf', builtin.find_files, {}) vim.keymap.set('n', 'pg', builtin.git_files, {}) vim.keymap.set('n', 'ps', function() builtin.grep_string({ search = vim.fn.input("Grep > ") }) end) vim.keymap.set("n", "a", mark.add_file) vim.keymap.set("n", "e", ui.toggle_quick_menu) vim.cmd [[autocmd BufWritePre lua vim.lsp.buf.format()]]