94 lines
2.2 KiB
Lua
94 lines
2.2 KiB
Lua
require('mappings')
|
|
|
|
require('lazy-config')
|
|
require('treesitter-config')
|
|
require('treesitter-textobjects-config')
|
|
require('noice-config')
|
|
require('plugin-mappings')
|
|
|
|
require('gopls')
|
|
require('code-completion')
|
|
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
|
|
|
|
-- Bufferline
|
|
vim.opt.termguicolors = true
|
|
|
|
-- Theme
|
|
require('onedark').load()
|
|
|
|
-- 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
|
|
}
|
|
|
|
-- 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', '<C-c>', '"+y', { noremap = true })
|
|
vim.api.nvim_set_keymap('v', '<C-c>', '"+y', { noremap = true })
|
|
vim.api.nvim_set_keymap('n', '<C-x>', '"+x', { noremap = true })
|
|
vim.api.nvim_set_keymap('v', '<C-x>', '"+x', { noremap = true })
|
|
vim.api.nvim_set_keymap('n', '<C-v>', '"+p', { noremap = true })
|
|
vim.api.nvim_set_keymap('v', '<C-v>', '"+p', { noremap = true })
|
|
end
|