require('mappings') require('lazy-config') require('treesitter-config') require('treesitter-textobjects-config') require('noice-config') require('plugin-mappings') require('gopls') require('code-completion') require('cokeline-config') require('commands') local vim = vim -- disable netrw at the very start of your init.lua (strongly advised) vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 -- nvim-tree require('nvim-tree').setup { on_attach = nvim_tree_attach, } -- Bufferline vim.opt.termguicolors = true -- Theme require('onedark').load() -- navic local navic = require("nvim-navic") navic.setup({ icons = { File = "󰈙 ", Module = " ", Namespace = "󰌗 ", Package = " ", Class = "󰌗 ", Method = "󰆧 ", Property = " ", Field = " ", Constructor = " ", Enum = "󰕘", Interface = "󰕘", Function = "󰊕 ", Variable = "󰆧 ", Constant = "󰏿 ", String = "󰀬 ", Number = "󰎠 ", Boolean = "◩ ", Array = "󰅪 ", Object = "󰅩 ", Key = "󰌋 ", Null = "󰟢 ", EnumMember = " ", Struct = "󰌗 ", Event = " ", Operator = "󰆕 ", TypeParameter = "󰊄 ", }, }) require("lualine").setup({ sections = { lualine_c = { { require('auto-session.lib').current_session_name }, { "navic", color_correction = nil, navic_opts = nil }, } }, }) -- neodev require("neodev").setup({}) -- Mason require('mason-config') lspconfig = require "lspconfig" lspconfig.pyright.setup {} lspconfig.csharp_ls.setup {} lspconfig.lua_ls.setup { settings = { Lua = { completion = { callSnippet = "Replace" } } } } lspconfig.rust_analyzer.setup {} lspconfig.clangd.setup { on_attach = function(client, bufnr) navic.attach(client, bufnr) end } -- Goto goto_preview = require('goto-preview') goto_preview.setup {} -- conform require("conform").setup({ formatters_by_ft = { lua = { "stylua" }, -- Conform will run multiple formatters sequentially python = { "isort", "black" }, -- Use a sub-list to run only the first available formatter javascript = { { "prettierd", "prettier" } }, }, }) -- Telescope require("telescope").load_extension "file_browser" -- General vim.opt.number = true vim.opt.relativenumber = true vim.opt.tabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true -- vim.opt.foldenable = true -- vim.opt.foldopen = "all" -- vim.opt.foldmethod = 'expr' -- vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' vim.opt.foldlevel = 99 vim.opt.hlsearch = true vim.opt.cursorline = true vim.opt.splitbelow = true -- Enable spell checking vim.opt.spell = true -- GUI operations if vim.fn.has('gui_running') == 1 then -- Clipboard mappings vim.api.nvim_set_keymap('n', '', '"+y', { noremap = true }) vim.api.nvim_set_keymap('v', '', '"+y', { noremap = true }) vim.api.nvim_set_keymap('n', '', '"+x', { noremap = true }) vim.api.nvim_set_keymap('v', '', '"+x', { noremap = true }) vim.api.nvim_set_keymap('n', '', '"+p', { noremap = true }) vim.api.nvim_set_keymap('v', '', '"+p', { noremap = true }) end